摘要: ``` #include using namespace std; const int N=1e5+5; const int inf=INT_MAX; int n,m,e,s,t; struct Graph { int nxt,to,w; } edge[Nq; q.push(s); vis[s]=1 阅读全文
posted @ 2023-06-09 18:54 N0zoM1z0 阅读(4) 评论(0) 推荐(0) 编辑
摘要: ``` #include using namespace std; template void read(T& x) { x=0; int f=1; char ch=getchar(); while(ch'9') { if(ch=='-')f=-1; ch=getchar(); } while(ch 阅读全文
posted @ 2023-06-09 18:29 N0zoM1z0 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 注意φ(m)的求法 和细节处理 ``` #include using namespace std; #define int long long int a,m; void MOD(int& x) { x=(x%m+m)%m; } string s; int qpow(int a,int b) { i 阅读全文
posted @ 2023-06-09 18:15 N0zoM1z0 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 算 a mod m的逆元 转换成 a x + b y = 1 求解 x,y即可 ``` #include using namespace std; int xx,yy; int exgcd(int a,int b) { if(b==0) { xx=1; yy=0; return a; } int G 阅读全文
posted @ 2023-06-09 17:54 N0zoM1z0 阅读(1) 评论(0) 推荐(0) 编辑