CF - USB vs. PS/2
Author: Benjamin Qi
Greedy
As described in editorial.
1#include <bits/stdc++.h>2#include <ext/pb_ds/tree_policy.hpp>3#include <ext/pb_ds/assoc_container.hpp>45using namespace std;6using namespace __gnu_pbds;78typedef long long ll;9typedef vector<int> vi;10typedef pair<int, int> pii;
Two Pointers
As described in editorial.
1#include <bits/stdc++.h>2using namespace std;34using ll = long long;5using ld = long double;6using db = double;7using str = string; // yay python!89using pi = pair<int,int>;10using pl = pair<ll,ll>;
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!