Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1237 | Codeforces Global Round 5 | FINISHED | False | 9000 | 160586699 | Oct. 16, 2019, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 373 ) | H | Balanced Reversals | PROGRAMMING | constructive algorithms | 3200 |
B"You have two strings a and b of equal even length n consisting of characters 0 and 1. We're in the endgame now. To finally make the universe perfectly balanced, you need to make strings a and b equal. In one step, you can choose any prefix of a of even length and reverse it. Formally, if a = a_1 a_2 ldots a_n , you can choose a positive even integer p <= n and set a to a_p a_{p-1} ldots a_1 a_{p+1} a_{p+2} ldots a_n . Find a way to make a equal to b using at most n + 1 reversals of the above kind, or determine that such a way doesn't exist. The number of reversals doesn't have to be minimized. The first line contains a single integer t ( 1 <= t <= 2000 ), denoting the number of test cases. Each test case consists of two lines. The first line contains a string a of length n , and the second line contains a string b of the same length ( 2 <= n <= 4000 ; n bmod 2 = 0 ). Both strings consist of characters 0 and 1. The sum of n over all t test cases doesn't exceed 4000 . For each test case, if it's impossible to make a equal to b in at most n + 1 reversals, output a single integer -1 . Otherwise, output an integer k ( 0 <= k <= n + 1 ), denoting the number of reversals in your sequence of steps, followed by k even integers p_1, p_2, ldots, p_k ( 2 <= p_i <= n ; p_i bmod 2 = 0 ), denoting the lengths of prefixes of a to be reversed, in chronological order. Note that k doesn't have to be minimized. If there are many solutions, output any of them. In the first test case, string a changes as follows: "... |
T |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
62743329 | rainboy | H | Oct. 16, 2019, 8:32 p.m. | OK | GNU C11 | TESTS | 88 | 46 | 0 | 3200 | |
63108562 | yuguotianqing | H | Oct. 22, 2019, 6:18 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 0 | 3200 | |
62762456 | RNS_KSB | H | Oct. 17, 2019, 7:23 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 0 | 3200 | |
62748417 | xay5421 | H | Oct. 16, 2019, 11:17 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 0 | 3200 | |
63265681 | cjy2003 | H | Oct. 23, 2019, 11:46 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 0 | 3200 | |
65656049 | Akasaka | H | Nov. 24, 2019, 10:42 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 0 | 3200 | |
63405528 | duality | H | Oct. 25, 2019, 8:11 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 102400 | 3200 | |
62744922 | cxmsqjh | H | Oct. 16, 2019, 9:09 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 102400 | 3200 | |
62744641 | cxmsqjh | H | Oct. 16, 2019, 9:02 p.m. | OK | GNU C++11 | TESTS | 88 | 31 | 102400 | 3200 | |
67780578 | _twilight | H | Dec. 28, 2019, 10:48 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 102400 | 3200 | |
65414182 | bqq | H | Nov. 20, 2019, 6:04 a.m. | OK | GNU C++11 | TESTS | 88 | 31 | 819200 | 3200 | |
62742219 | krijgertje | H | Oct. 16, 2019, 8:10 p.m. | OK | GNU C++14 | TESTS | 88 | 31 | 102400 | 3200 | |
62765083 | RomaWhite | H | Oct. 17, 2019, 8:21 a.m. | OK | GNU C++14 | TESTS | 88 | 31 | 204800 | 3200 | |
62740907 | MiFaFaOvO | H | Oct. 16, 2019, 7:44 p.m. | OK | GNU C++14 | TESTS | 88 | 31 | 204800 | 3200 | |
66584126 | yan-zp | H | Dec. 10, 2019, 10:31 a.m. | OK | GNU C++14 | TESTS | 88 | 31 | 204800 | 3200 | |
64158938 | newbiegcz | H | Nov. 3, 2019, 1:47 p.m. | OK | GNU C++14 | TESTS | 88 | 31 | 307200 | 3200 | |
64773315 | bzh | H | Nov. 13, 2019, 2:03 a.m. | OK | GNU C++14 | TESTS | 88 | 46 | 0 | 3200 | |
62849762 | beginend | H | Oct. 18, 2019, 6:51 a.m. | OK | GNU C++14 | TESTS | 88 | 46 | 102400 | 3200 | |
66581955 | yan-zp | H | Dec. 10, 2019, 9:44 a.m. | OK | GNU C++14 | TESTS | 88 | 46 | 204800 | 3200 | |
63242774 | hjc20032003 | H | Oct. 23, 2019, 1:52 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 204800 | 3200 | |
62770589 | mayaohua2003 | H | Oct. 17, 2019, 10:08 a.m. | OK | GNU C++14 | TESTS | 88 | 46 | 204800 | 3200 | |
62838587 | xgcxgc | H | Oct. 18, 2019, 12:50 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 0 | 3200 | |
63411644 | user202729_ | H | Oct. 26, 2019, 1:03 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 102400 | 3200 | |
62776754 | LayCurse | H | Oct. 17, 2019, 11:54 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 102400 | 3200 | |
63107679 | Xellos | H | Oct. 22, 2019, 5:50 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
62827082 | neal | H | Oct. 17, 2019, 6:26 p.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
62734860 | hbi1998 | H | Oct. 16, 2019, 6:12 p.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
62751723 | RNS_CUS | H | Oct. 17, 2019, 1:50 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
66160034 | Nakagawa.Kanon | H | Dec. 2, 2019, 3:33 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
64622378 | StepMommy | H | Nov. 10, 2019, 7:21 a.m. | OK | GNU C++17 | TESTS | 88 | 31 | 204800 | 3200 | |
62743196 | Golovanov399 | H | Oct. 16, 2019, 8:29 p.m. | OK | GNU C++17 | TESTS | 88 | 31 | 512000 | 3200 | |
62761896 | ashraf101 | H | Oct. 17, 2019, 7:10 a.m. | OK | Java 8 | TESTS | 88 | 124 | 0 | 3200 | |
62729319 | Petr | H | Oct. 16, 2019, 4:53 p.m. | OK | Java 8 | TESTS | 88 | 140 | 0 | 3200 | |
62716157 | Dukkha | H | Oct. 16, 2019, 3:56 p.m. | OK | Java 8 | TESTS | 88 | 140 | 0 | 3200 |
Back to search problems