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 |
---|---|---|---|---|---|---|
1384 | Codeforces Round 659 (Div. 2) | FINISHED | False | 7200 | 136221899 | July 24, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 18846 ) | A | Common Prefixes | PROGRAMMING | constructive algorithms greedy strings |
B"The length of the longest common prefix of two strings s = s_1 s_2 ldots s_n and t = t_1 t_2 ldots t_m is defined as the maximum integer k ( 0 <= k <= min(n,m) ) such that s_1 s_2 ldots s_k equals t_1 t_2 ldots t_k . Koa the Koala initially has n+1 strings s_1, s_2, ... , s_{n+1} . For each i ( 1 <= i <= n ) she calculated a_i -- the length of the longest common prefix of s_i and s_{i+1} . Several days later Koa found these numbers, but she couldn't remember the strings. So Koa would like to find some strings s_1, s_2, ... , s_{n+1} which would have generated numbers a_1, a_2, ... , a_n . Can you help her? If there are many answers print any. We can show that answer always exists for the given constraints. Each test contains multiple test cases. The first line contains t ( 1 <= t <= 100 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the number of elements in the list a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 50 ) -- the elements of a . It is guaranteed that the sum of n over all test cases does not exceed 100 . For each test case: Output n+1 lines. In the i -th line print string s_i ( 1 <= |s_i| <= 200 ), consisting of lowercase Latin letters. Length of the longest common prefix of strings s_i and s_{i+1} has to be equal to a_i . If there are many answers print any. We can show that answer always exists for the given constraints. In the 1 -st test case one of the possible answers is s = [aeren, ari, arousal, around, ari] . Lengths of longest common prefixes are: "... |
Codeforces Round #659 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
90028389 | HQT2003 | A | Aug. 15, 2020, 3:02 p.m. | OK | FPC | TESTS | 35 | 31 | 204800 | ||
90028892 | LeCaToX | A | Aug. 15, 2020, 3:08 p.m. | OK | FPC | TESTS | 35 | 46 | 204800 | ||
88015399 | Shadhin08 | A | July 25, 2020, 8:49 p.m. | OK | GNU C11 | TESTS | 33 | 15 | 3686400 | ||
89185756 | Amin.s | A | Aug. 7, 2020, 7:59 a.m. | OK | GNU C11 | TESTS | 35 | 30 | 3993600 | ||
90403973 | hieu28 | A | Aug. 19, 2020, 3:53 p.m. | OK | GNU C11 | TESTS | 35 | 31 | 0 | ||
91084160 | blueChip | A | Aug. 26, 2020, 6:32 p.m. | OK | GNU C11 | TESTS | 35 | 31 | 0 | ||
88094033 | Conqueror71 | A | July 27, 2020, 2:59 a.m. | OK | GNU C11 | TESTS | 33 | 31 | 3686400 | ||
87994325 | AtulNits | A | July 25, 2020, 2:33 p.m. | OK | GNU C11 | TESTS | 33 | 31 | 3686400 | ||
91120205 | KCSB | A | Aug. 27, 2020, 9:28 a.m. | OK | GNU C11 | TESTS | 35 | 46 | 0 | ||
88053869 | chowdhuryshashwoto | A | July 26, 2020, 12:15 p.m. | OK | GNU C11 | TESTS | 33 | 78 | 3686400 | ||
89517268 | Gaurav_Gadeela | A | Aug. 10, 2020, 2:19 p.m. | OK | GNU C11 | TESTS | 35 | 124 | 3686400 | ||
90462421 | Gaurav_Gadeela | A | Aug. 20, 2020, 12:37 p.m. | OK | GNU C11 | TESTS | 35 | 140 | 0 | ||
90237780 | catchmeifyocan | A | Aug. 17, 2020, 2:33 p.m. | OK | GNU C++11 | TESTS | 35 | 15 | 0 | ||
90398682 | krishnu9 | A | Aug. 19, 2020, 2:49 p.m. | OK | GNU C++11 | TESTS | 35 | 15 | 0 | ||
91680776 | hjh | A | Sept. 3, 2020, 1:26 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 0 | ||
89300557 | ciao_sora | A | Aug. 8, 2020, 3:01 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3686400 | ||
88046507 | Attis-chen | A | July 26, 2020, 10:15 a.m. | OK | GNU C++11 | TESTS | 33 | 15 | 3686400 | ||
88427201 | sairamkolla | A | July 30, 2020, 10:14 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3891200 | ||
88252926 | nithya570 | A | July 29, 2020, 5:39 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3891200 | ||
89560220 | vjudge3 | A | Aug. 11, 2020, 8:11 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3891200 | ||
89490825 | NadmanKhan | A | Aug. 10, 2020, 7:48 a.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3891200 | ||
88451553 | Davidshx | A | July 30, 2020, 2:41 p.m. | OK | GNU C++11 | TESTS | 35 | 15 | 3891200 | ||
88019856 | Durgeshmaurya07 | A | July 25, 2020, 11:18 p.m. | OK | GNU C++14 | TESTS | 33 | 30 | 3686400 | ||
89629126 | thanos_ashu | A | Aug. 12, 2020, 7:07 a.m. | OK | GNU C++14 | TESTS | 35 | 30 | 3788800 | ||
87995832 | mondal_shubham | A | July 25, 2020, 2:56 p.m. | OK | GNU C++14 | TESTS | 33 | 30 | 3891200 | ||
91661693 | francp22 | A | Sept. 2, 2020, 5:03 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91644569 | CyberGhost0112 | A | Sept. 2, 2020, 1:29 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91597227 | Second_id | A | Sept. 1, 2020, 8:01 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91574514 | seungjiqueen Yuris Minju | A | Sept. 1, 2020, 2:34 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91563075 | wanderlust0804 | A | Sept. 1, 2020, 12:05 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91672680 | namitachoudhary000013 | A | Sept. 2, 2020, 8:14 p.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
91683715 | the_eppisai | A | Sept. 3, 2020, 3:13 a.m. | OK | GNU C++14 | TESTS | 35 | 31 | 0 | ||
90004664 | htmltya | A | Aug. 15, 2020, 9:09 a.m. | OK | GNU C++17 | TESTS | 35 | 30 | 0 | ||
89730482 | wewark | A | Aug. 12, 2020, 5:39 p.m. | OK | GNU C++17 | TESTS | 35 | 30 | 204800 | ||
87987092 | pilus | A | July 25, 2020, 12:45 p.m. | OK | GNU C++17 | TESTS | 33 | 30 | 3686400 | ||
88026099 | karnika_15 | A | July 26, 2020, 4:01 a.m. | OK | GNU C++17 | TESTS | 33 | 30 | 3686400 | ||
88626871 | zagabi | A | Aug. 1, 2020, 12:57 a.m. | OK | GNU C++17 | TESTS | 35 | 30 | 3788800 | ||
88385670 | adel54321 | A | July 29, 2020, 8:39 p.m. | OK | GNU C++17 | TESTS | 35 | 30 | 3788800 | ||
88258191 | c0d3r_G4ur4v | A | July 29, 2020, 6:54 a.m. | OK | GNU C++17 | TESTS | 35 | 30 | 3788800 | ||
88447057 | m_10984 | A | July 30, 2020, 2:15 p.m. | OK | GNU C++17 | TESTS | 35 | 30 | 3788800 | ||
88014290 | kumaramantiwari99 | A | July 25, 2020, 8:21 p.m. | OK | GNU C++17 | TESTS | 33 | 30 | 3891200 | ||
88008731 | Suhovenko17 | A | July 25, 2020, 6:34 p.m. | OK | GNU C++17 | TESTS | 33 | 30 | 4505600 | ||
91344999 | Anik_Rigel | A | Aug. 30, 2020, 1:17 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 15 | 4403200 | ||
88093906 | gxucm | A | July 27, 2020, 2:55 a.m. | OK | GNU C++17 (64) | TESTS | 33 | 15 | 8294400 | ||
90449373 | Don_McMeMad | A | Aug. 20, 2020, 9:16 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 0 | ||
91038228 | zuiyu | A | Aug. 26, 2020, 9:49 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 0 | ||
89279247 | Edgelord1234 | A | Aug. 7, 2020, 5:46 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
88820435 | Naumovich | A | Aug. 3, 2020, 5:42 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
89602734 | conan1024hao | A | Aug. 11, 2020, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
89125618 | alwyntandiono | A | Aug. 6, 2020, 1:28 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
89171934 | suzuken_w | A | Aug. 7, 2020, 4:20 a.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
89271731 | _1nikitas_ | A | Aug. 7, 2020, 4:25 p.m. | OK | GNU C++17 (64) | TESTS | 35 | 30 | 4300800 | ||
88054814 | vienhx | A | July 26, 2020, 12:30 p.m. | OK | Go | TESTS | 33 | 46 | 10854400 | ||
87988421 | corgc0der | A | July 25, 2020, 1:07 p.m. | OK | Go | TESTS | 33 | 46 | 10854400 | ||
88697565 | pohzipohzi | A | Aug. 2, 2020, 12:50 a.m. | OK | Go | TESTS | 35 | 46 | 13004800 | ||
89073363 | shaposhnik | A | Aug. 5, 2020, 9:43 p.m. | OK | Haskell | TESTS | 35 | 31 | 11571200 | ||
88954082 | StepMommy | A | Aug. 5, 2020, 2:21 p.m. | OK | Java 11 | TESTS | 35 | 171 | 23756800 | ||
88432494 | jd_dreamer | A | July 30, 2020, 11:20 a.m. | OK | Java 11 | TESTS | 35 | 171 | 23756800 | ||
88279825 | pritam.ndp | A | July 29, 2020, 11:23 a.m. | OK | Java 11 | TESTS | 35 | 171 | 23756800 | ||
88020835 | jay_vish | A | July 26, 2020, 12:23 a.m. | OK | Java 11 | TESTS | 33 | 171 | 23859200 | ||
88575846 | gladwin_rojer | A | July 31, 2020, 9:03 a.m. | OK | Java 11 | TESTS | 35 | 171 | 23961600 | ||
88014042 | cassiopeia_delphinus | A | July 25, 2020, 8:16 p.m. | OK | Java 11 | TESTS | 33 | 171 | 24371200 | ||
88620792 | Oops_an_exception | A | July 31, 2020, 8:08 p.m. | OK | Java 11 | TESTS | 35 | 186 | 23756800 | ||
88621054 | Oops_an_exception | A | July 31, 2020, 8:15 p.m. | OK | Java 11 | TESTS | 35 | 186 | 23756800 | ||
88371919 | monimoy_2000 | A | July 29, 2020, 5:10 p.m. | OK | Java 11 | TESTS | 35 | 186 | 23756800 | ||
88143483 | megyeri99 | A | July 27, 2020, 4:18 p.m. | OK | Java 11 | TESTS | 35 | 186 | 23756800 | ||
88425262 | 4qqqqzzz | A | July 30, 2020, 9:51 a.m. | OK | Java 8 | TESTS | 35 | 108 | 20377600 | ||
91035852 | vjudge5 | A | Aug. 26, 2020, 9:16 a.m. | OK | Java 8 | TESTS | 35 | 109 | 0 | ||
90382927 | ramez | A | Aug. 19, 2020, 11:19 a.m. | OK | Java 8 | TESTS | 35 | 109 | 0 | ||
90258519 | AirAir | A | Aug. 17, 2020, 7:10 p.m. | OK | Java 8 | TESTS | 35 | 109 | 0 | ||
89728536 | tirth9960 | A | Aug. 12, 2020, 5:11 p.m. | OK | Java 8 | TESTS | 35 | 109 | 0 | ||
91313767 | partizan22 | A | Aug. 29, 2020, 9:47 p.m. | OK | Java 8 | TESTS | 35 | 109 | 0 | ||
87988695 | manan_0104 | A | July 25, 2020, 1:11 p.m. | OK | Java 8 | TESTS | 33 | 109 | 20275200 | ||
91465195 | chesiver | A | Aug. 31, 2020, 6:51 a.m. | OK | Java 8 | TESTS | 35 | 109 | 20377600 | ||
88293279 | sam_code | A | July 29, 2020, 2:17 p.m. | OK | Java 8 | TESTS | 35 | 109 | 20377600 | ||
88176949 | Justcodeit22 | A | July 28, 2020, 6:30 a.m. | OK | Java 8 | TESTS | 35 | 109 | 20377600 | ||
88038586 | Spheniscine | A | July 26, 2020, 8:08 a.m. | OK | Kotlin | TESTS | 33 | 109 | 20480000 | ||
88883817 | ostroumov | A | Aug. 4, 2020, 3:20 p.m. | OK | Kotlin | TESTS | 35 | 140 | 22528000 | ||
88678590 | wpansdl1004 | A | Aug. 1, 2020, 3:54 p.m. | OK | Kotlin | TESTS | 35 | 140 | 22835200 | ||
88046178 | a11eca | A | July 26, 2020, 10:09 a.m. | OK | Kotlin | TESTS | 33 | 170 | 23040000 | ||
91695602 | azukun | A | Sept. 3, 2020, 7:18 a.m. | OK | Mono C# | TESTS | 35 | 77 | 3788800 | ||
88098588 | TRR | A | July 27, 2020, 5:15 a.m. | OK | Mono C# | TESTS | 33 | 77 | 8601600 | ||
90387740 | dixmw34 | A | Aug. 19, 2020, 12:28 p.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 0 | ||
91115647 | YaMi506 | A | Aug. 27, 2020, 8:18 a.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 0 | ||
89858146 | wjddms206 | A | Aug. 14, 2020, 9:30 a.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 0 | ||
89802029 | vjudge1 | A | Aug. 13, 2020, 2:18 p.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 307200 | ||
88941167 | Hayk.Bakhshyan | A | Aug. 5, 2020, 11:33 a.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
88864580 | LmanTheMiner | A | Aug. 4, 2020, 11:02 a.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
88673889 | ningBr | A | Aug. 1, 2020, 2:45 p.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
88629491 | 1520193025 | A | Aug. 1, 2020, 2:39 a.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
89206536 | MrBear | A | Aug. 7, 2020, 1:11 p.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
89206145 | GeKa | A | Aug. 7, 2020, 1:05 p.m. | OK | MS C++ 2017 | TESTS | 35 | 31 | 3686400 | ||
87993219 | explorer_sifat | A | July 25, 2020, 2:17 p.m. | OK | Node.js | TESTS | 33 | 93 | 12185600 | ||
88035866 | mayakin | A | July 26, 2020, 7:26 a.m. | OK | PHP | TESTS | 33 | 62 | 6041600 | ||
88035341 | melug | A | July 26, 2020, 7:17 a.m. | OK | PyPy 2 | TESTS | 33 | 93 | 23142400 | ||
87992968 | sharpquagga | A | July 25, 2020, 2:13 p.m. | OK | PyPy 2 | TESTS | 33 | 124 | 24678400 | ||
88726370 | SK_EON | A | Aug. 2, 2020, 11:21 a.m. | OK | PyPy 2 | TESTS | 35 | 140 | 25907200 | ||
87994785 | sarthakmanna | A | July 25, 2020, 2:40 p.m. | OK | PyPy 2 | TESTS | 33 | 265 | 32563200 | ||
88380032 | adish | A | July 29, 2020, 6:57 p.m. | OK | PyPy 3 | TESTS | 35 | 124 | 20172800 | ||
88220746 | sankalp0104 | A | July 28, 2020, 4:07 p.m. | OK | PyPy 3 | TESTS | 35 | 124 | 20172800 | ||
90389743 | KiranKP | A | Aug. 19, 2020, 12:56 p.m. | OK | PyPy 3 | TESTS | 35 | 139 | 0 | ||
90332987 | tahsin_siad27 | A | Aug. 18, 2020, 5:31 p.m. | OK | PyPy 3 | TESTS | 35 | 139 | 0 | ||
88822304 | cellokid63 | A | Aug. 3, 2020, 6:15 p.m. | OK | PyPy 3 | TESTS | 35 | 139 | 20172800 | ||
88528538 | evoxtorm | A | July 30, 2020, 5:42 p.m. | OK | PyPy 3 | TESTS | 35 | 139 | 20172800 | ||
88015432 | byaghro_419 | A | July 25, 2020, 8:50 p.m. | OK | PyPy 3 | TESTS | 33 | 139 | 20172800 | ||
87996414 | Tactician.MDP | A | July 25, 2020, 3:05 p.m. | OK | PyPy 3 | TESTS | 33 | 139 | 21504000 | ||
91678179 | bradley.louie1 | A | Sept. 2, 2020, 11:30 p.m. | OK | PyPy 3 | TESTS | 35 | 140 | 0 | ||
91137672 | Steve-B | A | Aug. 27, 2020, 1:42 p.m. | OK | PyPy 3 | TESTS | 35 | 140 | 0 | ||
88031275 | ShadhinAshraf | A | July 26, 2020, 6:11 a.m. | OK | Python 2 | TESTS | 33 | 156 | 6451200 | ||
89370633 | ComptineDunAutreEte | A | Aug. 9, 2020, 3:12 a.m. | OK | Python 2 | TESTS | 35 | 170 | 6553600 | ||
88208440 | elistark | A | July 28, 2020, 1:39 p.m. | OK | Python 2 | TESTS | 35 | 170 | 6553600 | ||
91537154 | riimac_24 | A | Sept. 1, 2020, 5:15 a.m. | OK | Python 3 | TESTS | 35 | 93 | 0 | ||
90475549 | guruvishnu2 | A | Aug. 20, 2020, 3:19 p.m. | OK | Python 3 | TESTS | 35 | 93 | 307200 | ||
90529653 | prmangal | A | Aug. 21, 2020, 12:08 p.m. | OK | Python 3 | TESTS | 35 | 93 | 6963200 | ||
88236524 | tahaelghazi | A | July 28, 2020, 8:40 p.m. | OK | Python 3 | TESTS | 35 | 93 | 6963200 | ||
88154689 | a_s_h_i_s_h | A | July 27, 2020, 7:18 p.m. | OK | Python 3 | TESTS | 35 | 93 | 6963200 | ||
88007562 | N3RDSLQYER84 | A | July 25, 2020, 6:12 p.m. | OK | Python 3 | TESTS | 33 | 93 | 6963200 | ||
88007072 | rohitk07 | A | July 25, 2020, 6:05 p.m. | OK | Python 3 | TESTS | 33 | 93 | 6963200 | ||
87986087 | p_143 | A | July 25, 2020, 12:29 p.m. | OK | Python 3 | TESTS | 33 | 93 | 6963200 | ||
88632573 | ipsg | A | Aug. 1, 2020, 4:09 a.m. | OK | Python 3 | TESTS | 35 | 93 | 7065600 | ||
90473908 | litt_izatullo | A | Aug. 20, 2020, 3:01 p.m. | OK | Python 3 | TESTS | 35 | 108 | 307200 | ||
88230553 | Andrey_R | A | July 28, 2020, 6:37 p.m. | OK | Ruby | TESTS | 35 | 483 | 49561600 | ||
88731305 | terraformer | A | Aug. 2, 2020, 12:38 p.m. | OK | Rust | TESTS | 35 | 31 | 3788800 | ||
88219432 | jrodrigues | A | July 28, 2020, 3:49 p.m. | OK | Rust | TESTS | 35 | 31 | 3788800 | ||
88102276 | Strorkis | A | July 27, 2020, 6:30 a.m. | OK | Rust | TESTS | 33 | 31 | 4096000 | ||
88293331 | meetyouagain | A | July 29, 2020, 2:18 p.m. | OK | Rust | TESTS | 35 | 46 | 4096000 |
Back to search problems