Facebook
From Kunal Pisolkar , 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 87
  1. {
  2.         // Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
  3.         // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  4.         // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
  5.         // same ids are connected.
  6.         "template": {
  7.                 "prefix": "getTemplate",
  8.                 "body": [
  9.                         "#include \"bits/stdc++.h\"",
  10.                         "#define ll long long",
  11.                         "#define lli long long int",
  12.                         "using namespace std;",
  13.                         "",
  14.                         "typedef pair<int, int> pii;",
  15.                         "typedef pair<ll, ll> pll;",
  16.                         "typedef pair<string, string> pss;",
  17.                         "typedef vector<int> vi;",
  18.                         "typedef vector<vi> vvi;",
  19.                         "typedef vector<pii> vii;",
  20.                         "typedef vector<ll> vl;",
  21.                         "typedef vector<vl> vvl;",
  22.                         "typedef vector<bool> vb;",
  23.                         "typedef stack<int> si;",
  24.                         "",
  25.                         "double EPS = 1e-9;",
  26.                         "int INF = 1000000005;",
  27.                         "long long INFF = 1000000000000000005LL;",
  28.                         "double PI = acos(-1);",
  29.                         "int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};",
  30.                         "int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};",
  31.                         "",
  32.                         "#ifdef TESTING",
  33.                         "#define DEBUG fprintf(stderr, \"====TESTING====\\n\")",
  34.                         "#define VALUE(x) cerr << \"The value of \" << #x << \" is \" << x << endl",
  35.                         "#define debug(...) fprintf(stderr, __VA_ARGS__)",
  36.                         "#else",
  37.                         "#define DEBUG",
  38.                         "#define VALUE(x)",
  39.                         "#define debug(...)",
  40.                         "#endif",
  41.                         "",
  42.                         "#define FOR(a, b, c) for (ll(a) = (b); (a) < (c); ++(a))",
  43.                         "#define FORN(a, b, c) for (ll(a) = (b); (a) <= (c); ++(a))",
  44.                         "#define FORD(a, b, c) for (ll(a) = (b); (a) >= (c); --(a))",
  45.                         "#define FORSQ(a, b, c) for (ll(a) = (b); (a) * (a) <= (c); ++(a))",
  46.                         "#define FORC(a, b, c) for (char(a) = (b); (a) <= (c); ++(a))",
  47.                         "#define FOREACH(a, b) for (auto &(a) : (b))",
  48.                         "#define REP(i, n) FOR(i, 0, n)",
  49.                         "#define REPN(i, n) FORN(i, 1, n)",
  50.                         "#define MAX(a, b) a = max(a, b)",
  51.                         "#define MIN(a, b) a = min(a, b)",
  52.                         "#define SQR(x) ((LL)(x) * (x))",
  53.                         "#define RESET(a, b) memset(a, b, sizeof(a))",
  54.                         "#define fi first",
  55.                         "#define se second",
  56.                         "#define mp make_pair",
  57.                         "#define pb push_back",
  58.                         "#define ALL(v) v.begin(), v.end()",
  59.                         "#define ALLA(arr, sz) arr, arr + sz",
  60.                         "#define SIZE(v) (int)v.size()",
  61.                         "#define SORT(v) sort(ALL(v))",
  62.                         "#define REVERSE(v) reverse(ALL(v))",
  63.                         "#define SORTA(arr, sz) sort(ALLA(arr, sz))",
  64.                         "#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))",
  65.                         "#define PERMUTE next_permutation",
  66.                         "#define TC(t) while (t--)",
  67.                         "#define vec(a) vector<a>",
  68.                         "",
  69.                         "void solve()",
  70.                         "{",
  71.                         "}",
  72.                         "",
  73.                         "int main()",
  74.                         "{",
  75.                         "    ios_base::sync_with_stdio(false);",
  76.                         "    cin.tie(NULL);",
  77.                         "    cout.tie(NULL);",
  78.                         "",
  79.                         "#ifndef ONLINE_JUDGE",
  80.                         "    freopen(\"/home/kunalpisolkar/Cp/inputOutput/input.text\", \"r\", stdin);",
  81.                         "    freopen(\"/home/kunalpisolkar/Cp/inputOutput/output.text\", \"w\", stdout);",
  82.                         "#endif",
  83.                         "",
  84.                         "    int t;",
  85.                         "    cin >> t;",
  86.                         "",
  87.                         "    TC(t)",
  88.                         "    {",
  89.                         "        solve();",
  90.                         "        cout << \"\\n\";",
  91.                         "    }",
  92.                         "    return 0;",
  93.                         "}"
  94.                 ],
  95.                 "description": "template"
  96.         }
  97. }