Implementation
Time Complexity:
import java.io.*;import java.util.*;public class TeamBuilding {public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));StringTokenizer st = new StringTokenizer(br.readLine());int poolSize = Integer.parseInt(st.nextToken());int teamSize = Integer.parseInt(st.nextToken());
Alternate Solution
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!