嘤嘤嘤,我又来了,刚A完就写,这个沙雕题有丶恶心. ???时间4.11发现所有表情包都莫得了 题目: In an n×n chessboard, Prince and Princess plays a game. The squares in the chessboard are numbered 1, 2, 3, . . . , n∗n, as shown below: Prince stands in square 1, make p jumps and…
1.筛\(phi\) \(logn\)求少数\(phi\) inline int phi(R int x){ R int res=x,tmp=x; for(R int i=2;i*i<=x;i++){ if(tmp%i==0)res=res*(i-1)/i; while(tmp%i==0)tmp/=i; } if(tmp>1)res=res*(tmp-1)/tmp; return res; } 线性求\(phi\) inline void getphi(R int n){ vis[1]=0;…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=4512 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28195#problem/G 吉哥系列故事--完美队形I Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1454 Ac…
LCIS模板 #include <cstdio> #include <cstring> #include <iostream> using namespace std; int n; long long a[3005],b[3005],f[3005]; int main() { scanf("%d",&n); for(int i=1; i<=n; i++) scanf("%lld",&a[i]); for(i…