上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要:题目大意 有k个长度为k的数组,从每个数组中选出1个数,再把这k个数进行求和,问在所有的这些和中,最小的前k个和。 考虑将前i个数组合并,保留前k个和。然后考虑将第(i + 1)个数组和它合并,保留前k个和。 如果暴力的话就进行就暴力枚举每一对,然后进行求和,然后再选出前k个,然而这样会TLE。 可 阅读全文
posted @ 2017-11-07 07:49 阿波罗2003 阅读 (146) 评论 (0) 编辑
摘要:Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a ne 阅读全文
posted @ 2017-11-06 21:09 阿波罗2003 阅读 (44) 评论 (0) 编辑
摘要:You are given a connected weighted graph with n vertices and m edges. The graph doesn't contain loops nor multiple edges. Consider some edge with id i 阅读全文
posted @ 2017-11-05 10:20 阿波罗2003 阅读 (191) 评论 (0) 编辑
摘要:Treeland is a country in which there are n towns connected by n - 1 two-way road such that it's possible to get from any town to any other town. In Tr 阅读全文
posted @ 2017-11-05 09:57 阿波罗2003 阅读 (74) 评论 (0) 编辑
摘要:题目描述 本题中,我们将用符号\lfloor c \rfloor⌊c⌋表示对c向下取整,例如:\lfloor 3.0 \rfloor= \lfloor 3.1 \rfloor=\lfloor 3.9 \rfloor=3⌊3.0⌋=⌊3.1⌋=⌊3.9⌋=3。 蛐蛐国最近蚯蚓成灾了!隔壁跳蚤国的跳蚤也 阅读全文
posted @ 2017-11-04 07:49 阿波罗2003 阅读 (136) 评论 (0) 编辑
摘要:题目描述 对于刚上大学的牛牛来说,他面临的第一个问题是如何根据实际情况申请合适的课程。 在可以选择的课程中,有 2n2n 节课程安排在 nn 个时间段上。在第 ii(1 \leq i \leq n1≤i≤n)个时间段上,两节内容相同的课程同时在不同的地点进行,其中,牛牛预先被安排在教室 c_ici​ 阅读全文
posted @ 2017-10-29 16:40 阿波罗2003 阅读 (87) 评论 (0) 编辑
摘要:题目传送门 传送点I 传送点II 题目大意 (此题目不需要大意,我认为它已经很简洁了) 题目传送门 传送点I 传送点II 题目大意 (此题目不需要大意,我认为它已经很简洁了) 显然线段树合并(我也不知道哪来这么多显然) 考虑将每条路径拆成两条路径 s -> lca 和 t -> lca 。 对于前一 阅读全文
posted @ 2017-10-29 10:54 阿波罗2003 阅读 (128) 评论 (0) 编辑
摘要:题目大意 给定A串,选择A串的前lB个字符作为B串,再在B串后增加一个字符,问最长的相等的A串前缀和B串的后缀。 Solution 1(KMP) 用1个奇怪的字符连接A串和B串,再用KMP求最长公共前后缀。 Solution 2(Hash) hash A串的前缀和B的后缀,然后for去比较,取最大的 阅读全文
posted @ 2017-10-28 17:07 阿波罗2003 阅读 (80) 评论 (0) 编辑
摘要:This is an interactive problem. You are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which i 阅读全文
posted @ 2017-10-08 16:55 阿波罗2003 阅读 (121) 评论 (0) 编辑
摘要:Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building, Oshino's 阅读全文
posted @ 2017-10-07 19:29 阿波罗2003 阅读 (279) 评论 (0) 编辑
摘要:— This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere at a speed 阅读全文
posted @ 2017-10-07 19:04 阿波罗2003 阅读 (298) 评论 (0) 编辑
摘要:Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense, and arise again from the flames and ashes of its 阅读全文
posted @ 2017-10-07 18:52 阿波罗2003 阅读 (109) 评论 (0) 编辑
摘要:Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new g 阅读全文
posted @ 2017-10-07 18:46 阿波罗2003 阅读 (54) 评论 (0) 编辑
摘要:You are given n strings s1, s2, ..., sn consisting of characters 0 and 1. m operations are performed, on each of them you concatenate two existing str 阅读全文
posted @ 2017-10-06 20:32 阿波罗2003 阅读 (255) 评论 (0) 编辑
摘要:Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of nproblems, and the 阅读全文
posted @ 2017-10-06 20:20 阿波罗2003 阅读 (167) 评论 (0) 编辑
摘要:Have you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And 阅读全文
posted @ 2017-10-06 19:36 阿波罗2003 阅读 (47) 评论 (0) 编辑
摘要:As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock its new phone, Arkady's pet 阅读全文
posted @ 2017-10-06 19:31 阿波罗2003 阅读 (122) 评论 (0) 编辑
摘要:(Another) YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulti 阅读全文
posted @ 2017-09-09 17:35 阿波罗2003 阅读 (81) 评论 (0) 编辑
摘要:In this problem you will meet the simplified model of game Pudding Monsters. An important process in developing any game is creating levels. A game fi 阅读全文
posted @ 2017-09-09 16:10 阿波罗2003 阅读 (152) 评论 (0) 编辑
摘要:Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherland — Uzhlyandia. It is widely known that Uzhl 阅读全文
posted @ 2017-08-26 21:24 阿波罗2003 阅读 (58) 评论 (0) 编辑
摘要:Grigory loves strings. Recently he found a metal strip on a loft. The strip had length n and consisted of letters "V" and "K". Unfortunately, rust has 阅读全文
posted @ 2017-08-21 22:52 阿波罗2003 阅读 (332) 评论 (0) 编辑
摘要:Leha plays a computer game, where is on each level is given a connected graph with n vertices and m edges. Graph can contain multiple edges, but can n 阅读全文
posted @ 2017-08-21 22:20 阿波罗2003 阅读 (232) 评论 (0) 编辑
摘要:给定n个正整数a1,a2,…,an,求 的值(答案模10^9+7)。 Input 第一行一个正整数n。 接下来n行,每行一个正整数,分别为a1,a2,…,an。 Output 仅一行答案。 Sample Input Sample Output Hint 1<=n<=10^5,1<=ai<=10^7。 阅读全文
posted @ 2017-08-16 22:51 阿波罗2003 阅读 (62) 评论 (0) 编辑
摘要:Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rules are 阅读全文
posted @ 2017-08-15 21:31 阿波罗2003 阅读 (130) 评论 (0) 编辑
摘要:Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting f 阅读全文
posted @ 2017-08-15 15:34 阿波罗2003 阅读 (106) 评论 (0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页