-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets.txt
103 lines (102 loc) · 2.7 KB
/
snippets.txt
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
// Place your cp workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Codeforces Boilerplate C++ (One Testcase)": {
"prefix": "cpo",
"body": [
"#include <bits/stdc++.h>",
"using namespace std;",
"#define MOD 1000000007",
"#define ll long long",
"#define f first",
"#define s second",
"#define py cout << \"YES\" << endl",
"#define pn cout << \"NO\" << endl",
"#define fr (x) for (int i = 0; i < x; i++)",
"",
"void solve()",
"{",
"\t$1",
"}",
"",
"int main()",
"{",
"\tios_base::sync_with_stdio(false);",
"\tcin.tie(NULL);",
"\tsolve();",
"\treturn 0;",
"}"
],
"description": "Codeforces Boilerplate C++ (One Testcase) by @sxmbaka"
},
"Codeforces Boilerplate C++ (t Testcases)": {
"prefix": "cpt",
"body": [
"#include <bits/stdc++.h>",
"using namespace std;",
"#define MOD 1000000007",
"#define ll long long",
"#define f first",
"#define s second",
"#define py cout << \"YES\" << endl",
"#define pn cout << \"NO\" << endl",
"#define fr (x) for (int i = 0; i < x; i++)",
"",
"void solve()",
"{",
"\t$1",
"}",
"",
"int main()",
"{",
"\tios_base::sync_with_stdio(false);",
"\tcin.tie(NULL);",
"\tll testcase = 0;",
"\tcin >> testcase;",
"\twhile (testcase--)",
"\t{",
"\t\tsolve();",
"\t}",
"\treturn 0;",
"}"
],
"description": "Codeforces Boilerplate C++ (t Testcases) by @sxmbaka"
},
"vector<int> and input of n size": {
"prefix": "vi",
"body": [
"int n;",
"cin >> n;",
"vector<int> arr(n);",
"for (int i = 0; i < n; i++)",
"\tcin >> arr[i];"
],
"description": "Create and input an array of size n."
},
"matrix : vector<vector<int>> of size m x n": {
"prefix": "mi",
"body": [
"int m, n;",
"cin >> m >> n;",
"vector<vector<int>> mat(m, vector<int> (n, 0));",
"for (int i = 0; i < m; i++)",
"\tfor (int j = 0; j < n; j++)",
"\t\tcin >> mat[i][j];",
],
"description": "Create and input a m x n matrix."
}
}