ZOJ Problem Set - 3593 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3593 One Person Game Time Limit: 2 Seconds Memory Limit: 65536 KB There is an interesting and simple one person game. Suppose there is a number axis under your f…
#欧几里得求最大公约数 #!/usr/bin/env python #coding -*- utf:8 -*- #iteration def gcd(a,b): if b==0: return a else: return gcd(b, remainder(a, b)) #此方法仅仅书用于a和b都为正数 def gcd_1(a,b): while(b>0): rem = remainder(a,b) a = b b = rem return a def remainder(x,y): retur…