A water problem
Description
Two planets named Haha and Xixi in the universe and they were created with the universe beginning.
There is 73 days in Xixi a year and 137 days in Haha a year.
...
分类:
编程语言 时间:
2016-08-15 19:14:37
阅读次数:
272
1千万长度的数对73和137取模。(两个数有点像,不要写错了) 效率要高的话,每15位取一次模,因为取模后可能有3位,因此用ll就最多15位取一次。 一位一位取模也可以,但是比较慢,取模运算是个耗时的运算。 ...
分类:
其他好文 时间:
2016-08-15 17:20:05
阅读次数:
123
HDOJ题目地址:传送门
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7350 Accepted Submission(s): 5079
Problem Desc...
分类:
其他好文 时间:
2016-08-02 17:07:56
阅读次数:
195
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1212
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7083 Accepted Subm...
分类:
其他好文 时间:
2016-07-10 19:03:24
阅读次数:
157
题目连接 排行榜 A和I都是签到题 按位BFS K Yet Another Multiple Problem 题意:给一些可以用的数字,求最小的数,它由特定的数字组成且是n的倍数 分析:暴力枚举不可行,因为数字可能非常大。考虑到大数取模为0,BFS每一层即数位,递归输出路径。 同类型的题目: URA ...
分类:
其他好文 时间:
2016-04-19 18:50:30
阅读次数:
138
大数取模算法: 这个又不同于幂取模算法,对于几百万位的数字取模,直接的方法是行不通的。最好利用数论的知识 (a*b)%c = ((a%c)*b)%c ;利用这个公式我们只要从n的一次方开始不断计算,乘于一个数同时就对其求余,这样就可以在不溢出的情况下得出最后的结果。 设bignum的个位数是x 设 ...
分类:
其他好文 时间:
2016-04-07 20:48:44
阅读次数:
127
问题描述:假如有一个很大的数,大到10^1000,那么求这个值对17取模的值! 1 #include 2 int main() 3 { 4 char num[1001];//char数组存储 5 int i,ans=0; 6 gets(num); 7 for (...
分类:
其他好文 时间:
2015-10-26 00:10:15
阅读次数:
308
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5339给你n个数字b1...bn和一个数字a,让你用a对b1...bn内的数字取模,求取模后值为0的最少的数。可以重复b内取值。首先明确一点,那就是一个数对一个较小数取模后再对一个较大数取模是没有任何意义...
分类:
其他好文 时间:
2015-09-05 13:50:13
阅读次数:
114
vjudge上题目链接:Huge Mods 附上截图: 题意不难理解,因为指数的范围太大,所以我就想是不是需要用求幂大法: AB % C = AB % phi(C) + phi(C)% C ( B > phi(C) ) 呢?后来发现确实需要用到,而且因为它有很多重指数,所以需要 dfs,深搜...
分类:
其他好文 时间:
2015-08-01 14:10:22
阅读次数:
322
1243. Divorce of the Seven Dwarfs
Time limit: 1.0 second
Memory limit: 64 MB
After the Snow White with her bridegroom had left the house of the seven dwarfs, their peaceful and prosperous l...
分类:
其他好文 时间:
2015-07-22 18:56:14
阅读次数:
131