HDU 5373 The shortest problem (数学)】的更多相关文章

题意:给定两个数的n和m,有一种操作,把 n 的各位数字加起来放到 n后面形成一个新数n,问重复 m 次所得的数能否整除 11. 析:这个题首先要知道一个规律奇数位的和减去偶数位的和能被11整除的数字一定能被11整除.当然不知道这个题也可以过,直接模拟. 还有几个其他的规律; 被3整除:每位的和能被3整除即可: 被4整除:末尾两位能被4整除即可: 被7整除:将个位数字截去,在余下的数中减去个位数字的二倍,差是7的倍数即可:(可以递归) 被8整除:末尾三位能被8整除即可: 被9整除:每位的和能被9…
题目链接: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…
题目传送门 /* 题意:题目讲的很清楚: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)…
题目地址:pid=5373">HDU 5373 题意:给你一个数n和操作次数t,每次操作将n的各位数之和求出来放在n的末尾形成新的n,问t次操作后得到的n能否够被11整除. 思路:就是简单的模拟一下乱搞.额,对于%11有一个性质,当一个数的奇数位之和与偶数位之和的差的绝对值能被11整除,那么该数就能够被11整除. #include <stdio.h> #include <math.h> #include <string.h> #include <s…
The shortest problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description In this problem, we should solve an interesting game. At first, we have an…
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…
HDU - 4725 The Shortest Path in Nya Graph http://acm.hdu.edu.cn/showproblem.php?pid=4725 This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not und…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…