Advertisement
jbn6972

Untitled

Oct 18th, 2022
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.70 KB | None | 0 0
  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.     // Example:
  7.     "boilerplate": {
  8.         "prefix": "boilerplate code",
  9.         "body": [
  10.             "// Code Written by : John Nixon",
  11.             "// Date: $CURRENT_DATE:$CURRENT_MONTH:$CURRENT_YEAR  Time: $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
  12.             "// Copyrights are applicable",
  13.             "#include<bits/stdc++.h>",
  14.             "using namespace std;",
  15.             "#define ll long long",
  16.             "#define vi vector<int>",
  17.             "#define vll vector<long long int>",
  18.             "int main(){",
  19.             "#ifndef ONLINE_JUDGE",
  20.             "freopen(\"input.txt\",\"r\",stdin);",
  21.             "freopen(\"output.txt\",\"w\",stdout);",
  22.             "#endif",
  23.             "std::ios::sync_with_stdio(false);",
  24.             "$1",
  25.             "}",
  26.         ],
  27.         "description": "Log output to console"
  28.     },
  29.     "competitive": {
  30.         "prefix": "boilerplate code",
  31.         "body": [
  32.             "// Code Written by : John Nixon",
  33.             "// Date: $CURRENT_DATE:$CURRENT_MONTH:$CURRENT_YEAR  Time: $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
  34.             "// Copyrights are applicable",
  35.             "#include <bits/stdc++.h>",
  36.  
  37.             "using namespace std;",
  38.  
  39.             "#define int            long long int",
  40.             "#define mod            1e9+7",
  41.             "#define F              first",
  42.             "#define S              second",
  43.             "#define pb             push_back",
  44.             "#define si             set <int>",
  45.             "#define vi             vector <int>",
  46.             "#define pii            pair <int, int>",
  47.             "#define vpi            vector <pii>",
  48.             "#define vpp            vector <pair<int, pii>>",
  49.             "#define mii            map <int, int>",
  50.             "#define mpi            map <pii, int>",
  51.             "#define spi            set <pii>",
  52.             "#define endl           \"\\n\"",
  53.             "#define sz(x)          ((int) x.size())",
  54.             "#define all(p)         p.begin(), p.end()",
  55.             "#define double         long double",
  56.             "#define que_max        priority_queue <int>",
  57.             "#define que_min        priority_queue <int, vi, greater<int>>",
  58.             "#define bug(...)       __f (#__VA_ARGS__, __VA_ARGS__)",
  59.             "#define print(a)       for(auto x : a) cout << x << \" \"; cout << endl",
  60.             "#define print1(a)      for(auto x : a) cout << x.F << \" \" << x.S << endl",
  61.             "#define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< \" \"; cout << endl",
  62.  
  63.             "inline int power(int a, int b)",
  64.             "{",
  65.             "int x = 1;",
  66.             "while (b)",
  67.             "{",
  68.             "if (b & 1) x *= a;",
  69.             "a *= a;",
  70.             "b >>= 1;",
  71.             "}",
  72.             "return x;",
  73.             "}",
  74.             "",
  75.             "template <typename Arg1>",
  76.             "void __f (const char* name, Arg1&& arg1) { cout << name << \" : \" << arg1 << endl; }",
  77.             "template <typename Arg1, typename... Args>",
  78.             "void __f (const char* names, Arg1&& arg1, Args&&... args)",
  79.             "{",
  80.             "const char* comma = strchr (names + 1, ',');",
  81.             "cout.write (names, comma - names) << \" : \" << arg1 << \" | \"; __f (comma + 1, args...);",
  82.             "}",
  83.  
  84.             "const int N = 200005;",
  85.  
  86.             "void solve() {",
  87.             "int n, m;",
  88.             "cin >> n >> m;",
  89.             "bug(n, m);",
  90.             "}",
  91.  
  92.             "int32_t main()",
  93.             "{",
  94.             "ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);",
  95.  
  96.             "#ifndef ONLINE_JUDGE",
  97.             "freopen(\"input.txt\",  \"r\",  stdin);",
  98.             "freopen(\"output.txt\", \"w\", stdout);",
  99.             "#endif",
  100.  
  101.             "clock_t z = clock();",
  102.  
  103.             "int t = 1;",
  104.             "// cin >> t;",
  105.             "while (t--) solve();",
  106.  
  107.             "cerr << \"Run Time : \" << ((double)(clock() - z) / CLOCKS_PER_SEC);",
  108.  
  109.             "return 0;",
  110.             "}",
  111.         ],
  112.         "description": "Log output to console"
  113.     },
  114.  
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement