摘要: P2512 [HAOI2008]糖果传递 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define debug(x) cout<<#x<<':'<<x<<endl; const int maxn=1e6+10 阅读全文
posted @ 2021-02-05 21:30 zx0710 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 模数的世界[数论] 题解: \[ \begin{align} &要使gcd(x,y)=gcd(Ap+a,Bp+B)=p-1\Rightarrow p-1|Ap+a,\quad p-1|B+b ,\quad gcd((Ap+a)/(p-1),(Bp+b)/(p-1))=1\\ &构造Ap+a=(k1* 阅读全文
posted @ 2021-02-05 21:13 zx0710 阅读(140) 评论(1) 推荐(0) 编辑
摘要: P2602 [ZJOI2010]数字计数 递推写法: 主要观察到对于所有小于1000的数每一个数字1,2,3,...都是平均出现的(不考虑前导零) #include<bits/stdc++.h> using namespace std; typedef long long ll; const int 阅读全文
posted @ 2021-02-05 17:23 zx0710 阅读(54) 评论(0) 推荐(0) 编辑