-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.json
More file actions
82 lines (82 loc) · 3.18 KB
/
cpp.json
File metadata and controls
82 lines (82 loc) · 3.18 KB
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
{
"Custom C++ Boilerplate with STL & Utilities": {
"prefix": "cpp-self",
"body": [
"#include <bits/stdc++.h> // Includes most STL libraries (GCC only)",
"// #include <iostream> // Standard IO",
"// #include <vector> // Dynamic arrays",
"// #include <string> // String handling",
"// #include <algorithm> // Sorting, searching",
"// #include <map> // map, multimap",
"// #include <unordered_map> // Unordered maps",
"// #include <set> // set, multiset",
"// #include <queue> // queue, priority_queue",
"// #include <stack> // stack",
"// #include <cmath> // Math functions",
"// #include <iomanip> // Output formatting",
"// #include <chrono> // Time utilities",
"// #include <cassert> // Assertions",
"// #include <fstream> // File handling",
"// #include <sstream> // String streams",
"",
"using namespace std;",
"",
"/* FAST I/O */",
"void fast_io() {",
" ios::sync_with_stdio(false);",
" cin.tie(nullptr);",
"}",
"",
"/* COMMON TYPEDEFS */",
"using ll = long long;",
"using ull = unsigned long long;",
"using ld = long double;",
"",
"template<typename T>",
"void print_vector(const vector<T>& v) {",
" for (const auto& x : v) cout << x << \" \";",
" cout << \"\\n\";",
"}",
"",
"/* DEBUG MACROS (Optional) */",
"#ifdef DEBUG",
" #define dbg(x) cerr << #x << \" = \" << x << \"\\n\";",
"#else",
" #define dbg(x)",
"#endif",
"",
"/* SAMPLE FUNCTION */",
"int add(int a, int b) {",
" return a + b;",
"}",
"",
"/* OOP SNIPPET (Optional) */",
"class Sample {",
"public:",
" int x;",
" Sample(int x): x(x) {}",
"",
" void show() const {",
" cout << \"Value: \" << x << \"\\n\";",
" }",
"};",
"",
"/* MAIN FUNCTION */",
"int main(int argc, char **argv) {",
" fast_io();",
"",
" ${1:// Your code here}",
"",
" return 0;",
"}",
"",
"/* OPTIONAL INFO: Command-line arguments */",
"${2:// // argc -> Number of arguments",
"// // argv -> Argument values (array of char*)",
"// cout << \"argc: \" << argc << \"\\n\";",
"// if (argc > 1) cout << \"First argument: \" << argv[1] << \"\\n\";}",
""
],
"description": "Custom C++ Boilerplate with STL, utilities, fast IO, debug macros, and optional OOP templates"
}
}