-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
47 lines (41 loc) · 948 Bytes
/
Copy pathtemplate.cpp
File metadata and controls
47 lines (41 loc) · 948 Bytes
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
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
inline bool valid(int x, int n) {
return 0 <= x && x < n;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
template <typename T>
inline T pop(queue<T>& q) {
T front = q.front();
q.pop();
return front;
}
template <typename T>
inline T gcd(T a, T b) {
for (; b; a %= b, swap(a, b));
return a;
}
template <typename T>
tuple<T, T, T> xgcd(T a, T b) {
if (b == 0) return {1, 0, a};
T x, y, g;
tie(x, y, g) = xgcd(b, a%b);
return {y, x-(a/b)*y, g};
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}