随笔分类 -  Codeforces

摘要:题意:原题在这 Genos最近在他的手机上下载了祖玛游戏。在祖玛游戏里,存在n个一行的宝石,第i个宝石的颜色是Ci 。这个游戏的目标是尽快的消灭一行中所有的宝石。 在一秒钟,Genos能很快的挑选出这些有颜色的宝石中的一个回文的,连续的子串,并将这个子串移除。每当一个子串被删除后,剩余的宝石将连接在 阅读全文
posted @ 2018-09-09 23:07 LocaEtric 阅读(379) 评论(0) 推荐(0)
摘要:题意:原题在这 给出一个配对的括号序列(如"(())()"、"()"等, ")()"、"(()"是不符合要求的 ),对该序列按以下方法进行染色: 1.一个括号可以染红色、蓝色或不染色 2.一对匹配的括号需要且只能将其中一个染色 3.相邻两个括号颜色不能相同(但可以都不染色) 求符合条件的染色方案数( 阅读全文
posted @ 2018-09-09 23:03 LocaEtric 阅读(535) 评论(0) 推荐(0)
摘要:题意:原题在这 You've got a string s = s1s2... s|s| of length |s|, consisting of lowercase English letters. There also are q queries, each query is described 阅读全文
posted @ 2018-09-09 20:58 LocaEtric 阅读(220) 评论(0) 推荐(0)
摘要:题意:原题在这 Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English letters, so he writes any 阅读全文
posted @ 2018-09-09 20:41 LocaEtric 阅读(324) 评论(0) 推荐(0)
摘要:题意:原题在这 Wilbur the pig really wants to be a beaver, so he decided today to pretend he is a beaver and bite at trees to cut them down. There are nn tre 阅读全文
posted @ 2018-09-09 20:33 LocaEtric 阅读(442) 评论(0) 推荐(0)
摘要:题意:原题在这 有n个人(1<=n<=1000)。每个人有一个重量wi(1<=wi<=1000)和一个魅力值bi(1<=bi<=10^6)。 n个人之间有m(1<=m<=min(n*(n-1)/2, 10^5))个关系。第i个关系由两个数字xi和yi组成,表示第xi个人和第yi个人是朋友,朋友关系是 阅读全文
posted @ 2018-09-09 18:45 LocaEtric 阅读(248) 评论(0) 推荐(0)