随笔分类 -  数论

摘要:卡了~卡了就写不下去了~其实是不会~大牛提醒,答案必定是SUM的因子~细细想了好久,才想通~差距~因为是所有的和GCD,所以GCD必定整除SUM。。然后,枚举这些因子,统计前缀和的MOD,看有多少个,最多的便是以它为最大公约数的段数最多的情况。如果存在以它为GCD更多的段数的情况,必定会在前缀和统计... 阅读全文
posted @ 2015-11-03 23:57 chenjunjie1994 阅读(90) 评论(0) 推荐(0)
摘要:[background]保研的事终于告一段落了,之后去北京折腾了一段时间,本以为会在那里实习一个月,谁知道刚去ICT,心中就各种反感,可能是因为LP的态度吧,否则我可能会留在那里读研也说不定。花了两千多,最终灰溜溜的回来了,信心就大受打击。幸好的是,家人给予理解。八月的那一段时间,内心实在十分苦闷,... 阅读全文
posted @ 2015-09-08 10:49 chenjunjie1994 阅读(289) 评论(0) 推荐(0)
摘要:就是求最大公倍数,但要用分解质因子求。自己写的WA到爆。。。。#include#include#include#includeusing namespace std;#define rd(x) scanf("%d",&x)#define rd2(x,y) scanf("%d%d",&x,&y)#de... 阅读全文
posted @ 2015-08-18 23:10 chenjunjie1994 阅读(211) 评论(0) 推荐(0)
摘要:E. Mike and Foamtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike is a bartender at Rico's ba... 阅读全文
posted @ 2015-05-29 20:15 chenjunjie1994 阅读(166) 评论(0) 推荐(0)
摘要:C. Mike and Frogtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike has a frog and a flower. His... 阅读全文
posted @ 2015-05-28 23:40 chenjunjie1994 阅读(158) 评论(0) 推荐(0)
摘要:T_T终于让我过了,坑啊,竟然时限是200ms。。。我是预处理出不整除了个数的,因为这个较容易一点。利用算术基本定理,f=p1^a1*p2^a2......所以,整除它的个数就是(a1+1)*(a2+1)......开始预处理时,利用线性筛来先求素数,再计算,。。。呃,果断TLE了。后来发度娘告诉我... 阅读全文
posted @ 2015-03-23 09:59 chenjunjie1994 阅读(208) 评论(0) 推荐(0)
摘要:超简单的公式题(2^n-2)。不过,要过可不容易,因为会爆64位,所以,可以使用快速乘法。#include #include #include #define LL unsigned __int64using namespace std;LL n,p;LL mul(LL x,LL m,LL p)//... 阅读全文
posted @ 2015-03-15 21:01 chenjunjie1994 阅读(162) 评论(0) 推荐(0)
摘要:我想了很久了,后来还是把N分解质因数,枚举各种组合,反正也不多吧,按题目条件,然后就过了。#include #include #include #include #include #define LL __int64using namespace std; LL prime[1000... 阅读全文
posted @ 2015-03-09 11:12 chenjunjie1994 阅读(174) 评论(0) 推荐(0)