-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodint.cpp
More file actions
90 lines (81 loc) · 1.98 KB
/
Copy pathmodint.cpp
File metadata and controls
90 lines (81 loc) · 1.98 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
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define pii pair<int, int>
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define vvl vector<vl>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpii vector<pii>
#define vvpii vector<vpii>
#define rep(s, l, r) for (int s = l; s < r; s++)
#define per(s, r, l) for (int s = r - 1; s >= l; s--)
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef long double ld;
using namespace std;
template<class T> using minheap = priority_queue<T, vector<T>, greater<T>>;
template<typename T> void setmax(T& a, T b) { a = max(a, b); };
template<typename T> void setmin(T& a, T b) { a = min(a, b); };
template<typename T> bool in(T lo, T v, T hi) { return lo <= v && v <= hi; };
template<ll MOD>
struct ModInt {
ll x = 0;
ModInt() { x = 0; }
ModInt(ll _x) {
x = _x;
if (x >= MOD || x <= -MOD) x %= MOD;
if (x < 0) x += MOD;
}
friend ModInt operator+(ModInt a, ModInt b) {
return ModInt(a.x + b.x);
}
friend ModInt operator-(ModInt a, ModInt b) {
return ModInt(a.x - b.x);
}
friend ModInt operator*(ModInt a, ModInt b) {
return ModInt(a.x * b.x);
}
friend ModInt operator/(ModInt a, ModInt b) {
return a * inv(b);
}
friend ModInt operator+=(ModInt &a, ModInt b) {
return a = a + b;
}
friend ModInt power(ModInt a, ll b) {
if (b == 0) return 1;
ModInt y = 1, p = 1;
while (b > 0) {
if (b & 1) y = y * a;
a = a * a;
b >>= 1;
}
return y;
}
friend ModInt inv(ModInt a) {
// this only works for nonzero elements
return power(a, MOD - 2);
}
friend ostream& operator<<(ostream &os, const ModInt &a) {
os << a.x;
return os;
}
friend istream& operator>>(istream &is, ModInt &a) {
ll y; is >> y; a = ModInt(y);
return is;
}
};
using mint = ModInt<1000000007>;
using vm = vector<mint>;
using vvm = vector<vm>;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
mint b = 1 / 2;
cout << b << endl;
return 0;
}