C. Hidden Word time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let’s define a grid to be a set of tiles with 2 rows and 13 columns. Each tile has an English letter written in it. The lette…
http://codeforces.com/contest/725/problem/C Each English letter occurs at least once in s. 注意到题目有这样一句话,那么就是说S中只有一个重复的字母.一定要看到这句话,不然做不了. 然后就找到pos1和pos2分别代表那两个字母的位置,把他们中间的所有字母对折一下,放在最右边就可以了.因为这样才能用上同一个位置. 只有连续两个相同的字母才会impossible,同样是因为只有两个相同的字母. #includ…
模拟Canada Cup 2016,ABC三题,Rank1376 第三题卡住了 Codeforces 725 C 求出两个相同字符的位置,记为x和y. 然后考虑把相同的那个字符放在第一行的什么地方, 然后把x+1..y-1的部分一折两半,放在第一行的末尾再折回第二行. 再把1..x-1和y+1..n放下来就可以了. Codeforces 725 D 题意:有n个队伍,你是第一个队伍的一员,然后你可以把你们队伍拿到的一些气球给其他的队伍,如果一个队伍的气球数量大于他们的质量,那么他们就会被删除.…
A. Jumping Ball time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In a new version of the famous Pinball game, one of the most important parts of the game field is a sequence of n bumpers. T…
最近好弱做什么题目都是做一晚上 这是合肥站炼铜后遗症? 这题就是贪心 我已开始还写了1小时---三分-----. #include<bits/stdc++.h> using namespace std; #define sz(X) ((int)X.size()) typedef long long ll; const int INF = 0x3f3f3f3f; const int N = 3e5+5; struct Node{ int id; ll t, w; }p[N]; bool cmp1…
Hidden Word time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let’s define a grid to be a set of tiles with 2 rows and 13 columns. Each tile has an English letter written in it. The letters…
[Problem Description] Problem On the game show The Last Word, the host begins a round by showing the contestant a string S of uppercase English letters. The contestant has a whiteboard which is initially blank. The host will then present the contesta…
A. Bear and Reverse Radewoosh 题目连接: http://www.codeforces.com/contest/658/problem/A Description Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in…