USACO Silver 2020 US Open - Social Distancing
Authors: Qi Wang (Java), Tanish Tyagi (C++)
Appears In
Time Complexity:
C++
C++ Implementation
#include <bits/stdc++.h>using namespace std;#define ll long longint n, m;pair<ll,ll> intervals[100005];void setIO(string name, bool includeout=false) { // name is nonempty for USACO file I/Oios_base::sync_with_stdio(0); cin.tie(0); // see Fast Input & Output
Java
import java.util.*;import java.io.*;public class socdist{static int N, M;static Pair[] P;public static void main(String[] args) throws IOException{InputReader in = new InputReader("socdist.in");N = in.nextInt(); M = in.nextInt(); P = new Pair[M];for(int i = 0; i<M; i++){
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!