forked from Alafazam/lecture_notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
46 lines (35 loc) · 1.07 KB
/
template.cpp
File metadata and controls
46 lines (35 loc) · 1.07 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
#include <stdio.h>
#include <string.h>
#define SET(p) memset(p, -1, sizeof(p))
#define READ freopen("input.txt", "r", stdin);
#define WRITE freopen("output.txt", "w", stdout);
#define getcx getchar_unlocked
#define MX 9999999
using namespace std;
inline int fi (){//fast input function
register int c = getcx();
int x = 0;
int neg = 0;
for(;((c<48 || c>57) && c != '-');c = getcx());
if(c=='-') {neg=1;c=getcx();}
for(;c>47 && c<58;c = getcx()) {x = (x<<1) + (x<<3) + c - 48;}
if(neg) x=-x;
return x;
}
// you can also write your own min,absolute functions using this
template< class T > T _max(T a, T b) { return (!(a < b) ? a : b); }
int a[MX], b[MX];
int main() {
// when you want to take input from input.txt just uncommment the next line
// READ
// similarly next line is for output.txt
// WRITE
int t;//number of test cases
scanf("%d",&t);
while(t--){
// erase this line and start coding from here.
}
return 0;
}
// this template can be used with both c and c++.
// c++ is backwards compatible, scanf() and printf() also work in c++