算法录
eazo
这个作者很懒,什么都没留下…
展开
-
逆序对
定义 设 A 为一个有 n 个数字的有序集 (n>1),其中所有数字各不相同。 如果存在正整数 i, j 使得 1 ≤ i < j ≤ n 而且 A[i] > A[j],则 <A[i], A[j]> 这个有序对称为 A 的一个逆序对,也称作逆序数。 求解方法 1.暴力枚举 利用两重循环进行枚举。该算法的时间复杂原创 2019-02-19 16:04:39 · 2445 阅读 · 0 评论 -
Multiple Clocks(gcd和lcm)
题目描述 We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly Ti seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all...原创 2019-03-26 19:36:18 · 242 阅读 · 0 评论 -
Hunter’s Apprentice(判断顺逆时针)
题目描述 When you were five years old, you watched in horror as a spiked devil murdered your parents. You would have died too, except you were saved by Rose, a passing demon hunter. She ended up adopting ...原创 2019-04-12 12:01:53 · 130 阅读 · 0 评论