摘要: 题意:给定长度n的整数数组,以及整数s,求出总和不小于s的子数组长度的最小值。 Input 第一行输入n和s,第二行输入n个正整数。 Output 找到满足要求的子数组的最小长度,如果没有,输出0。 Sample Input 2 10 15 5 1 3 5 10 7 4 9 2 8 5 11 1 2 阅读全文
posted @ 2020-04-13 09:11 AlexLIN· 阅读(160) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-09 18:04 AlexLIN· 阅读(231) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-09 16:39 AlexLIN· 阅读(437) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-08 13:09 AlexLIN· 阅读(149) 评论(0) 推荐(0)
摘要: Jungle Roads Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27279 Accepted: 12839 Description The Head Elder of the tropical island of Lag 阅读全文
posted @ 2020-04-08 01:18 AlexLIN· 阅读(129) 评论(0) 推荐(0)
摘要: 参考博客:https://blog.csdn.net/Shaosenmonitor/article/details/102681095拿 HDU-1233 还是畅通工程 这道题作为例子Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全 阅读全文
posted @ 2020-04-07 23:59 AlexLIN· 阅读(176) 评论(0) 推荐(0)
摘要: 鸡山村发生了一次地震。ACM (Asia Cooperated Medical 亚洲联合医疗队) 已经为圣维尔供电中心的电脑搭建了一个无线网络,但受到了一次不可预知的余震攻击,因此网络中的所有电脑都被破坏了。电脑被逐台修复,网络逐步恢复了工作。由于受到硬件的约束,每台电脑只能与距离它不超过 d 米的 阅读全文
posted @ 2020-04-07 21:10 AlexLIN· 阅读(221) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-07 01:54 AlexLIN· 阅读(127) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-06 23:34 AlexLIN· 阅读(195) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-06 20:01 AlexLIN· 阅读(246) 评论(0) 推荐(0)