摘要:
给出 n, 写成 n= x^p 的形式,求p最大值 #include <iostream> #include <vector> #include <cmath> #include <algorithm> using namespace std ; #define int long long int 阅读全文
posted @ 2023-04-10 22:36
towboat
阅读(16)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <cstring> #include <cmath> #include <algorithm> using namespace std ; const int M =1e6+33; #define int long long int b[M] 阅读全文
posted @ 2023-04-10 20:52
towboat
阅读(7)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <cstring> #include <cmath> #include <algorithm> using namespace std ; const int M =1e4+33; int b[M],c[M],tot; int s[M] ; 阅读全文
posted @ 2023-04-10 20:29
towboat
阅读(17)
评论(0)
推荐(0)
摘要:
选择K个质数,使它们的和等于N。问有多少种方案? 例如,n=24, k=2时有3种方案:5+19=7+17=11+13=24 #include <iostream> #include <cstring> #include <cmath> #include <algorithm> using name 阅读全文
posted @ 2023-04-10 18:50
towboat
阅读(25)
评论(0)
推荐(0)
摘要:
对序列A, 求 (j-i+1) * gcd( i, i+1, ... j ) 最大值 G(i) =gcd( G[i-1] ,a[i] ) 即前缀值不升 维护 1~j-1 可能的 i 值 (logn 个) O(n *log^2 #include <iostream> #include <map> #i 阅读全文
posted @ 2023-04-10 18:22
towboat
阅读(19)
评论(0)
推荐(0)
摘要:
类似 https://www.cnblogs.com/towboa/p/17303216.html , 不过给的是n ,m (n<=2000) 枚举 i (1<=i<=n) ,考虑 有多少 j (1<=j<=m) gcd__(i,j)==0 然后分段考虑 (gcd(x,y) = gcd(x,y-x) 阅读全文
posted @ 2023-04-10 16:57
towboat
阅读(15)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<algorithm> using namespace std; const int M=1e6; int vis[M+4],P[M+4],cnt; int fi[M+4]; void shai(int top){ cnt=0; fi[1]=1; 阅读全文
posted @ 2023-04-10 15:56
towboat
阅读(15)
评论(0)
推荐(0)