摘要:
bobo has a sequence a 1,a 2,…,a n. He is allowed to swap two adjacent numbers for no more than k times. Find the minimum number of inversions after hi 阅读全文
摘要:
In this problem, you are given two permutations a and b of n numbers, and you need to play a game with them! In this game, you are required to perform 阅读全文
摘要:
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say t 阅读全文
摘要:
Jungle Roads Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27279 Accepted: 12839 Description The Head Elder of the tropical island of Lag 阅读全文
摘要:
鸡山村发生了一次地震。ACM (Asia Cooperated Medical 亚洲联合医疗队) 已经为圣维尔供电中心的电脑搭建了一个无线网络,但受到了一次不可预知的余震攻击,因此网络中的所有电脑都被破坏了。电脑被逐台修复,网络逐步恢复了工作。由于受到硬件的约束,每台电脑只能与距离它不超过 d 米的 阅读全文
摘要:
A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea 阅读全文
摘要:
Given N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences 阅读全文
摘要:
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the 阅读全文