摘要:
Hard problem CodeForces - 706C 现在有 n 个由小写字母组成的字符串。他想要让这些字符串按字典序排列,但是他不能交换任意两个字符串。他唯一能做的事是翻转字符串。 翻转第 i 个字符串需要花费 ci 的能量。他想知道将所有字符串排序最少要多少能量。 两个相邻的字符串可以相 阅读全文
摘要:
Qualifying Contest CodeForces - 659B Very soon Berland will hold a School Team Programming Olympiad. From each of the mBerland regions a team of two p 阅读全文
摘要:
Shower Line CodeForces - 431B Many students live in a dormitory. A dormitory is a whole new world of funny amusements and possibilities but it does ha 阅读全文
摘要:
Optimal Point on a Line CodeForces - 710B You are given n points on a line with their coordinates xi. Find the point x so the sum of distances to the 阅读全文
摘要:
Devu, the Dumb Guy CodeForces - 439B Devu is a dumb guy, his learning curve is very slow. You are supposed to teach him nsubjects, the ith subject has 阅读全文
摘要:
Die Roll CodeForces - 9A Yakko,Wakko和Dot,世界著名的狂欢三宝,哈哈,不知道你是否看过这个动画片。 某一天,过年了,他们决定暂定卡通表演,并去某些地方旅游一下。Yakko梦想去宾夕法尼亚州,那是他的故乡。Wakko想过塔斯马尼亚,它的海滩,阳光和大海。Dot选择 阅读全文
摘要:
Design Tutorial: Learn from Life CodeForces - 472B One way to create a task is to learn from life. You can choose some experience in real life, formal 阅读全文
摘要:
Save Luke CodeForces - 624A Luke Skywalker got locked up in a rubbish shredder between two presses. R2D2 is already working on his rescue, but Luke ne 阅读全文
摘要:
Professor GukiZ's Robot CodeForces - 620A 机器人很好玩 一开始在(x1,y1) 最后在(x2,y2) 每秒钟内横坐标最多变化1(也可以不变化)纵坐标也是 问最少几秒钟到 Inputx1 和 x2 绝对值在10^9以内Output最少几秒可以走到Example 阅读全文
摘要:
Kefa and Park CodeForces - 580C 一棵以1为根的树,树上有些点是红的。一个叶子是合法的当且仅当从根到它的路径上出现的连续红点个数不超过m。求有多少个叶子是合法的。Input第一行两个整数n和m(2≤n ≤105,1≤m≤n) 第二行n个整数0或1,如果是1,表示第i个点 阅读全文