Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3cf86e5

Browse files
author
atcoder-live
committed
initial commit
0 parents commit 3cf86e5

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

‎mint.cpp‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// https://youtu.be/L8grWxBlIZ4?t=9858
2+
// https://youtu.be/ERZuLAxZffQ?t=4765
3+
const int mod = 1000000007;
4+
struct mint {
5+
ll x;
6+
mint(ll x=0):x(x%mod){}
7+
mint& operator+=(const mint a) {
8+
if ((x += a.x) >= mod) x -= mod;
9+
return *this;
10+
}
11+
mint& operator-=(const mint a) {
12+
if ((x += mod-a.x) >= mod) x -= mod;
13+
return *this;
14+
}
15+
mint& operator*=(const mint a) {
16+
(x *= a.x) %= mod;
17+
return *this;
18+
}
19+
mint operator+(const mint a) const {
20+
mint res(*this);
21+
return res+=a;
22+
}
23+
mint operator-(const mint a) const {
24+
mint res(*this);
25+
return res-=a;
26+
}
27+
mint operator*(const mint a) const {
28+
mint res(*this);
29+
return res*=a;
30+
}
31+
};

‎template.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main() {
5+
return 0;
6+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /