-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcf_code2.cpp
More file actions
112 lines (74 loc) · 3.84 KB
/
Copy pathcf_code2.cpp
File metadata and controls
112 lines (74 loc) · 3.84 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
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
110
111
// Explaination (if uploaded) available at https://www.dropbox.com/sh/204cee9j2ebr12o/AACMue1QTlo42O-B_d4OJnt4a?dl=0
#include<bits/stdc++.h>
// ++++++++++++++++++++++++++++++++++++++++++++ @its_shyam640 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
using namespace std;
#define li long int
#define lf long float
#define ld long double
#define lli long long int
#define llf long long float
#define lld long long double
#define endl "\n"
#define vlli vector<long long int>
#define it(var) var.begin(),var.end()
#define rit(var) var.rbegin(),var.rend()
#define mid(left,right) (left+(right-left)/2)
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define _print(x) cerr << #x << " = " << x << endl;
template <typename T> T _gcd(T a, T b){if(a%b) return _gcd(b,a%b);return b;}
template <typename T> T _lcm(T a, T b){return (a*(b/_gcd(a,b)));}
template <typename T, typename... Args> auto sum(T a, Args... args) { return a + sum(args...); }
template<typename T> bool comparator(pair<T,T>& a, pair<T,T>& b){return (a.second<b.second);}
const long double pi = atan2(0, -1);
string pi100 = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
class Debug{
public:
void dbg(auto var) {cerr << var;}
// pair print
template <class T, class V>
void dbg(pair <T, V> p) {cerr<< "pair = {"; dbg(p.first); cerr << ","; dbg(p.second); cerr << "}" << endl;}
// vector print
template <class T>
void dbg(vector <T> v) {cerr << "array = { "; for (T i : v) {dbg(i); cerr << " ";} cerr << "}" << endl;}
// print set
template <class T>
void dbg(set <T> v) {cerr << "set = [ "; for (T i : v) {dbg(i); cerr << " ";} cerr << "]" << endl;}
// print map
template <class T, class V>
void dbg(map <T, V> v) {cerr << "map = [ \n"; for (auto i : v) {dbg(i); cerr << endl;} cerr << "]" << endl;}
// print unordered_map
template <class T, class V>
void dbg(unordered_map <T, V> v) {cerr << "ump = [ "; for (auto i : v) {dbg(i); cerr << " ";} cerr << "]" << endl;}
// print multiset
template <class T>
void dbg(multiset <T> v) {cerr << "multiset = [ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]" << endl;}
};
/****************************** Generate Testcases **************************/
void genTestArr(auto &arr, auto pivot){ generate(arr.begin(), arr.end(), [&pivot]{ return (rand() % pivot); });}
void file_input_output(){
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);
freopen("error.txt", "w", stderr);
#endif
}
/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ SNIPPET ENDED $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
int main(int argc, char const *argv[]) {
clock_t begin = clock();
Debug d;
fast_io
// file_input_output(); // Taking file input and displaying output in output.txt
// Write your code here....
#ifndef ONLINE_JUDGE
clock_t end = clock();
cout<<"\n\nExecuted In: "<<double(end - begin) / CLOCKS_PER_SEC*1000<<" ms"<<endl;
cout<<"Date : "<<__DATE__<< endl;
cout<<"Time : "<<__TIME__<< endl;
#endif
return 0;
}
/************ INTPUT *****************/
/************* OUTPUT *****************/