POJ
jia_zheng
这个作者很懒,什么都没留下…
展开
-
Happy 2006
Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9…are all relatively prime to 2006. Now your job is easy: for the g原创 2016-12-06 15:10:29 · 393 阅读 · 0 评论 -
Prime Test
应用:Miller_Rabin算法 和Pollard_rho 算法Given a big integer number, you are required to find out whether it's a prime number. Input The first line contains the number of test cases T (1 <= T <= 20 ), th原创 2016-12-05 22:37:46 · 295 阅读 · 0 评论 -
Values whose Sum is 0 (二分查找)
Description The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In原创 2016-11-26 10:34:40 · 389 阅读 · 0 评论 -
POJ 1061 青蛙的约会
Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮原创 2017-02-27 14:33:19 · 293 阅读 · 0 评论