扩展欧几里德第二题~
这个题真是搞了好长时间才懂啊~~
题目大意:
有一个数mod ri 等于ai ,求这个数,若求不出来输出“-1”。
解题思路:
对于 x=r1(mod a1)
x=r2(mod a2)
相当于解不定方程:x*a1+y*a2=r2-r1
先求解方程:x*a1+y*a2=r2-r1=gcd(a1,a2)
得出解x,则方程x*...
分类:
其他好文 时间:
2014-08-08 21:27:16
阅读次数:
302
1 /* 2 题目大意: 3 就是一幢大厦中有0~99的楼层, 然后有1~5个电梯!每个电梯有一定的上升或下降速度和楼层的停止的位置! 4 问从第0层楼到第k层最少经过多长时间到达! 5 6 思路:明显的Dijkstra ,在建图的时候u->v可能...
分类:
其他好文 时间:
2014-08-08 21:13:26
阅读次数:
188
F - Strange Way to Express Integers
Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Elina is reading a book written by Rujia...
分类:
其他好文 时间:
2014-08-07 23:10:15
阅读次数:
402
favoriteI have nginx+php-fpm web serverSo I've noticed in php5-fpm.log many strange lines:[03-Sep-2013 09:25:23] NOTICE: [pool www] child 23999 exited...
分类:
Web程序 时间:
2014-08-06 22:53:12
阅读次数:
367
题目链接:http://acm.hdu.edu.cn/showproblem.pihp?pid=2899题目大意:找出满足F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 2 #include 3 #include 4 using namespace std; 5...
分类:
其他好文 时间:
2014-08-03 12:42:05
阅读次数:
172
Description
Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.
It orders two arms of negligible weight and each arm's lengt...
分类:
其他好文 时间:
2014-08-02 15:30:13
阅读次数:
235
B - Balance
Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Gigel has a strange "balance" and he wants to poise it. Actually, t...
分类:
其他好文 时间:
2014-07-30 17:45:24
阅读次数:
271
Description
Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.
It orders two arms of negligible weight and each arm's length...
分类:
其他好文 时间:
2014-07-28 16:14:46
阅读次数:
244
http://acm.hdu.edu.cn/showproblem.php?pid=1548
A strange lift
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11341 Accepted Submission...
分类:
其他好文 时间:
2014-07-26 02:28:36
阅读次数:
236
A strange lift
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11341 Accepted Submission(s): 4289
Problem Description
There is a str...
分类:
其他好文 时间:
2014-07-26 02:28:26
阅读次数:
228