-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheuclid.cpp
More file actions
60 lines (48 loc) · 1.2 KB
/
euclid.cpp
File metadata and controls
60 lines (48 loc) · 1.2 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
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()
template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}
const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD
const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)
template<typename T> T gcd(T a, T b){
if(b==0){
return a;
}
return gcd(b, a%b);
}
template<typename T> T lcm(T a, T b){
return a/gcd(a, b)*b;
}
template<typename T> T extgcd(T a, T b, T& x, T& y){
T d=a;
if(b>0){
d=extgcd(b, a%b, y, x);
y-=a/b*x;
}
else{
x=1;
y=0;
}
return d;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
return 0;
}