Skip to content

Instantly share code, notes, and snippets.

@rep-movsd
Last active May 16, 2016 18:44
Show Gist options
  • Save rep-movsd/9a5c966bb622a8203652345964853b63 to your computer and use it in GitHub Desktop.
Save rep-movsd/9a5c966bb622a8203652345964853b63 to your computer and use it in GitHub Desktop.
Topcoder template
#include <bits/stdc++.h>
#define vec vector
#define vint vector<int>
#define vstr vector<string>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define st string
#define stref string&
#define cstref const string&
#define sz(x) int(x.size())
#define beg(x) begin(x)
#define all(x) begin(x), end(x)
#define var auto
#define pbeg(x) &x[0]
#define pend(x) (&x[0] + sz(x))
#define FOR_EVERY_UNIQUE_PAIR(I, J, N) for(int I = 0; I < N; ++I) for(int J = I+1; J < N; ++J)
#define FOR(I,N) for(int I = 0; I < N; ++I)
#define FORV(I,V) for(int I = 0; I < V.size(); ++I)
#define LOOP(I, J, K) for(int I = J; I < K; ++I)
#define IDX(IT, CONT) distance(begin(CONT), IT)
#define DUMP(X) do {for(auto x:X) cout << x << " "; cout << endl;} while(0)
#define P(X) cout << X << "\t"
#define NL cout << endl
#define ACCUM accumulate
#define XFORM transform
#define PAR_SUM partial_sum
#define ADJ_DIFF adjacent_difference
#define IN_PROD inner_product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment