摘要:
欧几里德算法欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。其计算原理依赖于下面的定理:定理:gcd(a,b) = gcd(b,a mod b)证明:a可以表示成a = kb + r,则r = a mod b假设d是a,b的一个公约数,则有d|a, d|b,而r = a - kb,因... 阅读全文
posted @ 2015-01-03 23:42
neverlandly
阅读(1425)
评论(0)
推荐(0)
摘要:
You are given a binary array with N elements: d[0], d[1], ... d[N - 1]. You can perform AT MOST one move on the array: choose any two integers [L, R],... 阅读全文
posted @ 2015-01-03 04:52
neverlandly
阅读(688)
评论(0)
推荐(0)
摘要:
Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. For exampl... 阅读全文
posted @ 2015-01-03 04:18
neverlandly
阅读(481)
评论(0)
推荐(0)
浙公网安备 33010602011771号