题目传送门 /* 题意:题目讲的很清楚:When n=123 and t=3 then we can get 123->1236->123612->12361215.要求t次操作后,能否被11整除 同余模定理:每次操作将后缀值加到上次操作的值%11后的后面,有点绕,纸上模拟一下就行了 */ /************************************************ * Author :Running_Time * Created Time :2015-8-12 8…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5373 一开始想到用整除11的性质去做,即奇位数的和和偶位数的和的差为11的倍数,但估不准数据范围没敢去做, 尝试去敲大数,HFZ想出了一个比较巧的方法,模拟计算的过程,用变量去存sum,sum = sum + 各位数字之和, 如果更新后的num是11的倍数,num就可以归0了,极大简化了过程,Int范围内就可以做.代码如下: #include<stdio.h> int get_sum(int x)…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5373 The shortest problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 995    Accepted Submission(s): 498 Problem Description In this problem, w…
The shortest problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 346    Accepted Submission(s): 167 Problem Description In this problem, we should solve an interesting game. At first, we hav…
题意:给定两个数的n和m,有一种操作,把 n 的各位数字加起来放到 n后面形成一个新数n,问重复 m 次所得的数能否整除 11. 析:这个题首先要知道一个规律奇数位的和减去偶数位的和能被11整除的数字一定能被11整除.当然不知道这个题也可以过,直接模拟. 还有几个其他的规律; 被3整除:每位的和能被3整除即可: 被4整除:末尾两位能被4整除即可: 被7整除:将个位数字截去,在余下的数中减去个位数字的二倍,差是7的倍数即可:(可以递归) 被8整除:末尾三位能被8整除即可: 被9整除:每位的和能被9…
The shortest problem http://acm.hdu.edu.cn/showproblem.php?pid=5373 Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 181 Accepted Submission(s): 92 Problem Description In this problem, we should sol…
The shortest problem Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 969 Accepted Submission(s): 491 Problem Description In this problem, we should solve an interesting game. At first, we have an…
题意:给出一大数K(4 <= K <= 10^100)与一整数L(2 <= L <= 106),K为两个素数的乘积(The cryptographic keys are created from the product of two primes) 问构成K的最小素数是否绝对小于L,若是,则输出BAD p,p为最小素数,否则输出GOOD; 分析:从小到大枚举1~10^6内的素数p,while(p<L)时,判断K是否能被p整除,若能则证明构成K的最小素数绝对小于L,反之则大于L…
Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 11435   Accepted: 3040 Description The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in…
完全想不到啊,同余模定理没学过啊,想起上学期期末考试我问好多同学'≡'这个符号什么意思,都说不知道,你们不是上了离散可的吗?不过看了别人的解法我现在会了,同余模定理介绍及运用点这里点击打开链接 简单说一下同余模定理:如果(a - b) / m = 0,说明a%m等于b%m,那么对于本题应该如何运用呢?  已知a % n = m,那么(a * 10 + x) % n = a * 10 % n + x % n = (a % n * 10 + x ) % n = (m *10 + x ) % n,有了…