-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtemplatecpp2.sublime-snippet
74 lines (62 loc) · 1.38 KB
/
templatecpp2.sublime-snippet
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
<snippet>
<content><![CDATA[
//abhiy13
#include <bits/stdc++.h>
using namespace std;
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
bool first = true;
string res = "{";
for (const auto &x : v) {
if (!first) {
res += ", ";
}
first = false;
res += to_string(x);
}
res += "}";
return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T...);
}
#ifdef ABHI
#define debu(x) cerr << "[" << __LINE__ << "]: " << #x << "->" << to_string(x) << '\n';
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debu(x) 42
#define debug(...) 42
#endif
void solve(){
$1
}
int32_t main(){
ios::sync_with_stdio(false);
int t = 1;
// cin >> t;
for(int tt = 1 ; tt <= t ; ++tt){
solve();
}
return 0;
}
]]></content>
<tabTrigger>long template</tabTrigger>
<scope>source.cpp, source.c++, source.cc , source.cxx</scope>
<description>My Code template for C++</description>
</snippet>