-
Notifications
You must be signed in to change notification settings - Fork 0
/
cft.sublime-snippet
109 lines (90 loc) · 3.08 KB
/
cft.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
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
104
105
106
107
108
109
<snippet>
<content><![CDATA[
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef __gnu_pbds::tree<int, __gnu_pbds::null_type, less<int>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set;
#define ll long long int
#define infi INT_MAX
const long long int mod = 1000000007;
#define spc " "
#define nline "\n"
#define pii pair<int,int>
#define all(a) a.begin(), a.end()
#define print(a) cout << (a) << nline;
#define print2(a,b) cout << (a) << " " << (b) << nline;
#define logarr(arr,a,b) for(int z=(a);z<=(b);z++) cout<<(arr[z])<<" ";cout<<endl;
#define printarr(arr,n) logarr(arr,0,(n)-1)
#define printmat(arr,r,c) for(int i=(0);i<(r);++i){logarr(arr[i],0,(c)-1)}
#define rep(i,_srt,_end) for(int i=(_srt); i < (_end); ++i)
#ifndef ONLINE_JUDGE
#define bug(...) __f (#__VA_ARGS__, __VA_ARGS__)
#else
#define bug(...) ;
#endif
template<typename T1, typename T2> // cin >> pair<T1, T2>
istream& operator>>(istream &istream, pair<T1,T2> &p){ return (istream >> p.first >> p.second); }
template<typename T> // cin >> vector<T>
istream& operator>>(istream &istream, vector<T> &v){
for(auto &it: v) cin >> it;
return istream;
}
template <typename T> // cout << vector<T>
ostream &operator<<(ostream &ostream, const vector<T> &c)
{
for (auto &it : c)
cout << it << " ";
return ostream;
}
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) {cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
const char* comma = strchr (names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
ll highest_power_of_two(ll _n){
ll n = _n;
n |= n>>1;n |= n>>2;n |= n>>4;n |= n>>8;n |= n>>16; n |= n>>32;
++n;return n >> 1;
}
ll totient(ll n){ ll result = n;
for(ll p = 2; p * p <= n; ++p)
if (n % p == 0){ while (n % p == 0)n /= p; result -= result / p;}
if (n > 1) result -= result / n; return result;
}
bool check_prime(ll n){
if(n<=1) return false; else if(n <= 3) return true;
if(n%2 == 0 || n%3 == 0) return false;
for(ll i=5;i*i<=n;i=i+6) if(n%i == 0 || n%(i+2) == 0) return false;
return true;
}
void file_i_o(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif
}
//---------------------------Jay Bajrangbali----------------------------
void solve(){
}
int32_t main(int argc, char const *argv[]){
file_i_o();
int tc;
cin >> tc;
while(tc--){
solve();
}
return 0;
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>codechef</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.cpp</scope> -->
</snippet>