-
Notifications
You must be signed in to change notification settings - Fork 0
/
vscode_c++_snippet.json
71 lines (70 loc) · 2.53 KB
/
vscode_c++_snippet.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"cpp snippets":
{
"prefix" : "cppstart",
"body" : [
"#include<bits/stdc++.h>",
"using namespace std;",
"",
"int main()",
"{",
" $0",
" return 0;",
"}"
],
"description" : "Boilerplate code for C++ Competitive Programming"
},
"cp c++ start":{
"prefix": "cpstart",
"body": [
"#include <bits/stdc++.h>",
"",
"// Aarif Khan",
"// Codechef: https://www.codechef.com/users/aarifkhan_7",
"// Github: https://github.com/aarifkhan7",
"",
"#define pi (3.141592653589)",
"#define MOD 1000000007",
"#define ll long long int",
"#define all(x) x.begin(), x.end()",
"#define rep(i, a, b) for(int i = a; i < b; i++)",
"#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);",
"#define pii pair<int,int>",
"#define ff first",
"#define ss second",
"#define vi vector<int>",
"#define pb push_back",
"#define mp make_pair",
"template<typename T> std::istream& operator >>(std::istream& input, std::vector<T>& data) { for (auto& item : data) { input >> item; } return input; }",
"template<typename T> std::ostream& operator <<(std::ostream& output, const std::vector<T>& data) { for (const T& x : data) output << x << \" \"; output << '\\n'; return output; }",
"template<typename T, typename S> std::ostream& operator <<(std::ostream& os, const std::pair<T, S>& v) { os << \"(\"; os << v.first << \", \" << v.second << \")\"; return os; }",
"template<typename T, typename S> std::ostream& operator <<(std::ostream& os, const std::map<T, S>& v) { for (auto it : v) os << it.first << \" : \" << it.second << \"\\n\"; return os; }",
"template<typename T> std::ostream& operator <<(std::ostream& os, const std::set<T>& v) { os << \"[\"; for (auto it : v) { os << it; if (it != *v.rbegin()) os << \", \"; } os << \"]\\n\"; return os; }",
"",
"using namespace std;",
"",
"void solve(){",
" $0",
"}",
"",
"int main()",
"{",
" fast;",
" int t; cin >> t;",
" while(t--){",
" solve();",
" }",
" return 0;",
"}"
],
"description": "CP C++ Boilerplate"
},
"usaco file in/out":{
"prefix": "usacoinout",
"body": [
"freopen(\"$0problemname.in\", \"r\", stdin);",
"freopen(\"$0problemname.out\", \"w\", stdout);"
],
"description": "CP C++ Boilerplate"
}
}