摘要: input T <=10 n k n<=1000 k<=10^18 a1,a2,...an |ai|<=10^18 output (a1^k+a2^k+...+an^k)%10^10+7 Sample Input 2 Sample Output 6 60074 做法:快速幂+__int128,需注意 阅读全文
posted @ 2016-03-25 23:39 cdongyang 阅读(203) 评论(0) 推荐(0)
摘要: input 样例个数T <=10000 每个样例一个n(2<=n<=10^8) output lcm(1,2,...,n)%2^32 Sample Input 5 10 5 200 15 20 Sample Output 2520 60 2300527488 360360 232792560做法:质 阅读全文
posted @ 2016-03-25 22:02 cdongyang 阅读(374) 评论(0) 推荐(0)
摘要: input n 不超过50个例子,n==0结束输入 Sample Input 7 15 16 101 0 7 15 16 101 0 7 15 16 101 0 output 最少个不同数字的n的倍数的x,若不同数字个数一样,输出最小的x Sample Output 7 555 16 1111 根据 阅读全文
posted @ 2015-12-22 15:26 cdongyang 阅读(234) 评论(0) 推荐(0)
摘要: inputT 132,输出Impossible,否则输出x做法:dp,d(x,y)=d(x,y-1)+d(x-1,y-1),x:egg,y:floor求出下限,即x个鸡蛋至少要试多少次 1 # include 2 # include 3 #define INF 2000000010 4 int... 阅读全文
posted @ 2015-12-21 20:06 cdongyang 阅读(347) 评论(0) 推荐(0)
摘要: n m 1<=n,m<=1000 n*m的地图,全为大写字母 1 #include <bits/stdc++.h> 2 #define MAX 1000000 3 #define LL long long 4 using namespace std; 5 int cas=1,T,n,m,v[1010 阅读全文
posted @ 2015-12-21 19:53 cdongyang 阅读(356) 评论(0) 推荐(0)
摘要: 搬砖 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 5134 Accepted Submission(s): 1288 Problem Desc 阅读全文
posted @ 2015-12-18 14:45 cdongyang 阅读(472) 评论(0) 推荐(0)
摘要: inputT 1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #define... 阅读全文
posted @ 2015-12-18 14:25 cdongyang 阅读(799) 评论(0) 推荐(0)
摘要: inputn 1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #includ... 阅读全文
posted @ 2015-12-18 13:52 cdongyang 阅读(521) 评论(0) 推荐(0)
摘要: inputn 1g(i) 0 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #... 阅读全文
posted @ 2015-12-16 15:06 cdongyang 阅读(404) 评论(0) 推荐(0)
摘要: inputT 1=0)步走到(x,y),只能从(x,y)走到(x,y+lcm(x,y))/(x+lcm(x,y),y)标准解:从(x,y0)走到(x,y),则设x=ag,y0=bg,g=gcd(x,y0),有y=bg+abg=(a+1)bg,因为a,b互质,a,(a+1)互质,所以a和(a+1)b... 阅读全文
posted @ 2015-12-16 14:56 cdongyang 阅读(301) 评论(0) 推荐(0)