上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 56 下一页
摘要: https://vjudge.net/problem/CodeForces-510D题目可以转化为花最小代价选一些数,然后这些数可以经过加减运算得到1或-1,不然1你就凑不出来,一旦凑出来1,其他的都有了。由贝祖定理,ax+by=gcd(a,b)=1,贝祖定理能推广到n个,ax+by+cz+…=gc 阅读全文
posted @ 2019-08-07 15:28 WeiAR 阅读(138) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #define inf 2147483647 #define N 1000010 #define p(a) putchar(a) #define For(i,a,b) for(int i=a;im; void in(int &x){ int y=1;... 阅读全文
posted @ 2019-08-07 10:44 WeiAR 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Gym - 100941G https://vjudge.net/problem/Gym-100941G比赛的时候真的是不会啊,那就没办法了。结论:每x周减一次头发,第k次剪发时的头发长度为x^k。x^k=L,x=L^(1/k)ans=kx=k*L^(1/k) 阅读全文
posted @ 2019-08-06 19:34 WeiAR 阅读(114) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/317000#problem/F #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cst 阅读全文
posted @ 2019-08-05 18:05 WeiAR 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 主函数由int main()改成signed main() 好处:把int改成long long 的时候不用单独把它改成int了,懂的人都懂(滑稽 阅读全文
posted @ 2019-08-05 16:19 WeiAR 阅读(1310) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 2147483647 #define P 99824 阅读全文
posted @ 2019-08-05 16:13 WeiAR 阅读(169) 评论(0) 推荐(0) 编辑
摘要: UVA - 11327https://vjudge.net/problem/28358/origin求欧拉函数的前缀和,二分查找到那个位置,再从它开始暴力gcd找 阅读全文
posted @ 2019-08-05 14:59 WeiAR 阅读(185) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #define inf 2147483647 #define N 1000010 #define p(a) putchar(a) #define For(i,a,b) for(long long i=a;i'9'){if(c=='-')y=-1;c=getchar();} ... 阅读全文
posted @ 2019-08-05 10:01 WeiAR 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 求1~n的欧拉函数的值 阅读全文
posted @ 2019-08-05 09:04 WeiAR 阅读(167) 评论(0) 推荐(0) 编辑
摘要: sqrt(n)复杂度 欧拉函数模板 阅读全文
posted @ 2019-08-04 10:53 WeiAR 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 56 下一页