USACO Silver 2017 December - Milk Measurement

Author: Qi Wang

Official Analysis

Time Complexity: O(NlogN)\mathcal{O}(N\log N)

Java

//Created by Qi Wang
import java.util.*;
import java.io.*;
public class measurement {
static int N, G, A;
static Log[] L;
static Map<Integer, Integer> ids = new HashMap<>();
//Sorting keys from greatest to least
static TreeMap<Integer, Integer> values = new TreeMap<>((o1, o2) -> o2-o1);

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!