摘要:
板子 处理模数运算的自定义数据类 点击查看代码 const int mod = 1e9+7; long long ext_gcd(long long a, long long b, long long &x, long long &y) { if (b == 0) { x = 1; y = 0; r 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define pii pair<int, int> const int mod = 998244353; const int 阅读全文
摘要:
K Tokitsukaze and Shawarma 签到题,三种时长去max即可。 点击查看代码 #include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long typedef pair<i 阅读全文
摘要:
威尔逊定理: 如果p是指数,那么(p-1)!对于p取模恒等于p-1. 逆元 逆元可以用来干什么呢,比如说对于 (a/b) mod p,并没有 ((a mod p) / (b mod p)) mod p,但是直接除又会爆精度,这时我们就可以用到逆元,假设用 inv(b) 代表 b 的逆元, 那么 (a 阅读全文