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 |
---|---|---|---|---|---|---|
1167 | Educational Codeforces Round 65 (Rated for Div. 2) | FINISHED | False | 7200 | 179508287 | May 15, 2019, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 7052 ) | D | Bicolored RBS | PROGRAMMING | constructive algorithms greedy | 1500 |
B'A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain correct arithmetic expression by inserting characters "+" and "1" into this sequence. For example, "", "(())" and "()()" are RBS and ")(" and "(()" are not. We can see that each opening bracket in RBS is paired with some closing bracket, and, using this fact, we can define nesting depth of the RBS as maximum number of bracket pairs, such that the 2 -nd pair lies inside the 1 -st one, the 3 -rd one -- inside the 2 -nd one and so on. For example, nesting depth of "" is 0 , "()()()" is 1 and "()((())())" is 3 . Now, you are given RBS s of even length n . You should color each bracket of s into one of two colors: red or blue. Bracket sequence r , consisting only of red brackets, should be RBS, and bracket sequence, consisting only of blue brackets b , should be RBS. Any of them can be empty. You are not allowed to reorder characters in s , r or b . No brackets can be left uncolored. Among all possible variants you should choose one that minimizes maximum of r 's and b 's nesting depth. If there are multiple solutions you can print any of them. The first line contains an even integer n ( 2 <= n <= 2 cdot 10^5 ) -- the length of RBS s . The second line contains regular bracket sequence s ( |s| = n , s_i in { "(", ")" } ). Print single string t of length n consisting of "0"-s and "1"-s. If t_i is equal to 0 then character s_i belongs to RBS r , otherwise s_i belongs to b . In the first example one of optimal solutions is s = " color{blue}{()} ". r is empty and b = " () ". The answer is max(0, 1) = 1 . In the second example it 's optimal to make s = " color{red}{(} color{blue}{('... |
67058 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
54580663 | BenL | D | May 25, 2019, 4:31 a.m. | OK | Clang++17 Diagnostics | TESTS | 21 | 248 | 23654400 | 1500 | |
55219558 | LaSWeeG | D | June 6, 2019, 6:41 p.m. | OK | Delphi | TESTS | 21 | 77 | 409600 | 1500 | |
55214393 | LaSWeeG | D | June 6, 2019, 4:02 p.m. | OK | FPC | TESTS | 21 | 577 | 1331200 | 1500 | |
55830601 | Craspedacusta | D | June 20, 2019, 12:57 p.m. | OK | FPC | TESTS | 21 | 592 | 1331200 | 1500 | |
69476303 | kaiboy | D | Jan. 24, 2020, 4:17 p.m. | OK | GNU C11 | TESTS | 21 | 31 | 409600 | 1500 | |
54319240 | _nmp_ | D | May 17, 2019, 7:56 p.m. | OK | GNU C11 | TESTS | 21 | 31 | 409600 | 1500 | |
54506638 | apbondarev | D | May 23, 2019, 4:26 a.m. | OK | GNU C11 | TESTS | 21 | 31 | 409600 | 1500 | |
69476067 | kaiboy | D | Jan. 24, 2020, 4:13 p.m. | OK | GNU C11 | TESTS | 21 | 31 | 409600 | 1500 | |
69476617 | kaiboy | D | Jan. 24, 2020, 4:23 p.m. | OK | GNU C11 | TESTS | 21 | 46 | 409600 | 1500 | |
55692994 | rainboy | D | June 17, 2019, 7:20 p.m. | OK | GNU C11 | TESTS | 21 | 46 | 409600 | 1500 | |
54506553 | apbondarev | D | May 23, 2019, 4:22 a.m. | OK | GNU C11 | TESTS | 21 | 607 | 204800 | 1500 | |
67847676 | raresmihai01 | D | Dec. 28, 2019, 10:58 p.m. | OK | GNU C11 | TESTS | 21 | 608 | 1024000 | 1500 | |
54320172 | about | D | May 17, 2019, 8:32 p.m. | OK | GNU C11 | TESTS | 21 | 624 | 6246400 | 1500 | |
54262396 | Tannidy | D | May 17, 2019, 3:06 a.m. | OK | GNU C++11 | TESTS | 21 | 15 | 819200 | 1500 | |
54880411 | Vivek_Rathi_53 | D | May 31, 2019, 2 p.m. | OK | GNU C++11 | TESTS | 21 | 15 | 1331200 | 1500 | |
54434198 | maomao330 | D | May 21, 2019, 3:39 a.m. | OK | GNU C++11 | TESTS | 21 | 30 | 204800 | 1500 | |
54224177 | xht37 | D | May 16, 2019, 5:25 a.m. | OK | GNU C++11 | TESTS | 21 | 30 | 512000 | 1500 | |
54588110 | qiongwxian | D | May 25, 2019, 7:38 a.m. | OK | GNU C++11 | TESTS | 21 | 30 | 819200 | 1500 | |
54274227 | e0210206 | D | May 17, 2019, 10:19 a.m. | OK | GNU C++11 | TESTS | 21 | 30 | 1331200 | 1500 | |
54226645 | nightlemon | D | May 16, 2019, 6:42 a.m. | OK | GNU C++11 | TESTS | 21 | 31 | 0 | 1500 | |
61424579 | Jackpei | D | Sept. 28, 2019, 12:47 p.m. | OK | GNU C++11 | TESTS | 21 | 31 | 204800 | 1500 | |
61358956 | luogu_bot4 | D | Sept. 27, 2019, 11:30 a.m. | OK | GNU C++11 | TESTS | 21 | 31 | 204800 | 1500 | |
60823069 | disposrestfuIly | D | Sept. 19, 2019, 1:55 a.m. | OK | GNU C++11 | TESTS | 21 | 31 | 204800 | 1500 | |
55090246 | Half-Blood_Prince | D | June 4, 2019, 2:13 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 204800 | 1500 | |
54215525 | jlr.terceiro | D | May 15, 2019, 8:38 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 204800 | 1500 | |
55306141 | 321zazaza123 | D | June 8, 2019, 2:33 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 512000 | 1500 | |
54427580 | shivam2298 | D | May 20, 2019, 7:32 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 512000 | 1500 | |
54244133 | Deep_123 | D | May 16, 2019, 2:10 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 512000 | 1500 | |
62609429 | kirakira | D | Oct. 15, 2019, 9:09 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 716800 | 1500 | |
54216805 | SiDdharth_Joy | D | May 15, 2019, 10:23 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 819200 | 1500 | |
55602461 | Ciafrino | D | June 15, 2019, 7:19 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 819200 | 1500 | |
55736161 | shashanks367 | D | June 19, 2019, 4:10 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 819200 | 1500 | |
57158402 | pk842 | D | July 16, 2019, 5:47 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 819200 | 1500 | |
54563175 | NelsonGomesNeto | D | May 24, 2019, 2:59 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 409600 | 1500 | |
54900034 | nqbinh17 | D | June 1, 2019, 6:04 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 512000 | 1500 | |
54449134 | hankJIN | D | May 21, 2019, 12:45 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 512000 | 1500 | |
54450506 | LBJHan | D | May 21, 2019, 1:19 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 512000 | 1500 | |
54471767 | elyutin159164 | D | May 22, 2019, 5:56 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 512000 | 1500 | |
54235918 | Vichitr | D | May 16, 2019, 10:49 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 819200 | 1500 | |
54384842 | Einstein314 | D | May 19, 2019, 12:47 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 819200 | 1500 | |
54836500 | Rudy358 | D | May 30, 2019, 11:08 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 819200 | 1500 | |
60848284 | APwhitehat | D | Sept. 19, 2019, 1:14 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 819200 | 1500 | |
56398527 | charity | D | July 1, 2019, 3:44 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 921600 | 1500 | |
58470755 | sighduck | D | Aug. 8, 2019, 11:56 p.m. | OK | Go | TESTS | 21 | 46 | 0 | 1500 | |
54700784 | qianhailong | D | May 26, 2019, 11:05 p.m. | OK | Go | TESTS | 21 | 46 | 0 | 1500 | |
54336690 | xuanwo | D | May 18, 2019, 8:27 a.m. | OK | Go | TESTS | 21 | 46 | 0 | 1500 | |
54662014 | Phantasm | D | May 26, 2019, 11:17 a.m. | OK | Go | TESTS | 21 | 655 | 0 | 1500 | |
55126577 | tkachenko | D | June 5, 2019, 1:07 p.m. | OK | Go | TESTS | 21 | 655 | 0 | 1500 | |
55126276 | tkachenko | D | June 5, 2019, 12:59 p.m. | OK | Go | TESTS | 21 | 655 | 0 | 1500 | |
54272438 | SureYeaah | D | May 17, 2019, 9:26 a.m. | OK | Haskell | TESTS | 21 | 61 | 10547200 | 1500 | |
66736462 | tusharjape007 | D | Dec. 12, 2019, 7:05 p.m. | OK | Java 11 | TESTS | 21 | 187 | 0 | 1500 | |
69486203 | pauline4234 lightseba | D | Jan. 24, 2020, 7:41 p.m. | OK | Java 11 | TESTS | 21 | 202 | 0 | 1500 | |
62927986 | vjudge1 | D | Oct. 19, 2019, 11:53 a.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | 1500 | |
55693031 | Baelish | D | June 17, 2019, 7:21 p.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | 1500 | |
54649469 | TheSawan | D | May 26, 2019, 4:07 a.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | 1500 | |
54280917 | OmarIhab12 | D | May 17, 2019, 1:21 p.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | 1500 | |
54237334 | di_halt | D | May 16, 2019, 11:24 a.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | 1500 | |
64723235 | ijxjdjd | D | Nov. 12, 2019, 5:15 a.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | 1500 | |
63952543 | goyalnikhil064 | D | Oct. 31, 2019, 10:28 p.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | 1500 | |
63271687 | Agnimandur | D | Oct. 24, 2019, 4:34 a.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | 1500 | |
60586352 | LeamyCodes | D | Sept. 14, 2019, 9:32 p.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | 1500 | |
55692993 | Dukkha | D | June 17, 2019, 7:20 p.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | 1500 | |
66206128 | Tlatoani | D | Dec. 3, 2019, 3:05 a.m. | OK | Kotlin | TESTS | 21 | 156 | 0 | 1500 | |
54730077 | Deemo | D | May 27, 2019, 10:45 p.m. | OK | Kotlin | TESTS | 21 | 156 | 0 | 1500 | |
54351682 | wbars | D | May 18, 2019, 3:12 p.m. | OK | Kotlin | TESTS | 21 | 186 | 0 | 1500 | |
54397398 | MAndrey | D | May 19, 2019, 9:35 p.m. | OK | Kotlin | TESTS | 21 | 764 | 0 | 1500 | |
55099564 | MattM | D | June 4, 2019, 7:15 p.m. | OK | Kotlin | TESTS | 21 | 811 | 0 | 1500 | |
54969151 | redjohn | D | June 2, 2019, 7:49 a.m. | OK | Kotlin | TESTS | 21 | 811 | 0 | 1500 | |
54508496 | skok_d | D | May 23, 2019, 5:43 a.m. | OK | Kotlin | TESTS | 21 | 888 | 9625600 | 1500 | |
55109394 | QuantumKnight | D | June 5, 2019, 5:22 a.m. | OK | Mono C# | TESTS | 21 | 62 | 1945600 | 1500 | |
54432223 | treasuryonly | D | May 21, 2019, 1:11 a.m. | OK | Mono C# | TESTS | 21 | 77 | 5734400 | 1500 | |
54417617 | azukun | D | May 20, 2019, 1:32 p.m. | OK | Mono C# | TESTS | 21 | 77 | 7782400 | 1500 | |
56299983 | og.kostya | D | June 30, 2019, 8:19 a.m. | OK | Mono C# | TESTS | 21 | 93 | 5836800 | 1500 | |
54817159 | IleksaNott | D | May 29, 2019, 9:05 p.m. | OK | Mono C# | TESTS | 21 | 655 | 7884800 | 1500 | |
55932706 | vjudge4 | D | June 22, 2019, 12:17 p.m. | OK | MS C++ | TESTS | 21 | 30 | 1024000 | 1500 | |
54448694 | vjudge4 | D | May 21, 2019, 12:33 p.m. | OK | MS C++ | TESTS | 21 | 31 | 204800 | 1500 | |
55932776 | vjudge1 | D | June 22, 2019, 12:19 p.m. | OK | MS C++ | TESTS | 21 | 31 | 1024000 | 1500 | |
55932750 | vjudge1 | D | June 22, 2019, 12:18 p.m. | OK | MS C++ | TESTS | 21 | 31 | 1024000 | 1500 | |
54850608 | scorpiowf | D | May 30, 2019, 4:23 p.m. | OK | MS C++ | TESTS | 21 | 31 | 1228800 | 1500 | |
54447887 | vjudge2 | D | May 21, 2019, 12:13 p.m. | OK | MS C++ | TESTS | 21 | 46 | 204800 | 1500 | |
54452333 | vjudge3 | D | May 21, 2019, 2:09 p.m. | OK | MS C++ | TESTS | 21 | 46 | 1024000 | 1500 | |
68455736 | tarattata1 | D | Jan. 9, 2020, 4:08 p.m. | OK | MS C++ | TESTS | 21 | 46 | 1843200 | 1500 | |
54452401 | rst1111 | D | May 21, 2019, 2:11 p.m. | OK | MS C++ | TESTS | 21 | 61 | 1024000 | 1500 | |
54448672 | vjudge4 | D | May 21, 2019, 12:33 p.m. | OK | MS C++ | TESTS | 21 | 61 | 1024000 | 1500 | |
54224010 | easyeasyeasy | D | May 16, 2019, 5:20 a.m. | OK | MS C++ 2017 | TESTS | 21 | 30 | 204800 | 1500 | |
54269594 | 0-jij-0 | D | May 17, 2019, 8:05 a.m. | OK | MS C++ 2017 | TESTS | 21 | 30 | 819200 | 1500 | |
54411269 | R99 | D | May 20, 2019, 9:52 a.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 409600 | 1500 | |
54324015 | erickjohnross | D | May 18, 2019, 12:50 a.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 819200 | 1500 | |
54449833 | Ancient_mage | D | May 21, 2019, 1:03 p.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 819200 | 1500 | |
54299981 | valerikk | D | May 17, 2019, 4:06 p.m. | OK | MS C++ 2017 | TESTS | 21 | 46 | 614400 | 1500 | |
54299721 | valerikk | D | May 17, 2019, 4:04 p.m. | OK | MS C++ 2017 | TESTS | 21 | 46 | 819200 | 1500 | |
56543710 | petko_mitkov | D | July 5, 2019, 6:39 a.m. | OK | MS C++ 2017 | TESTS | 21 | 61 | 2560000 | 1500 | |
64236304 | ainch96 | D | Nov. 4, 2019, 2:12 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 11366400 | 1500 | |
58702715 | EverRest | D | Aug. 13, 2019, 8:23 a.m. | OK | MS C++ 2017 | TESTS | 21 | 77 | 204800 | 1500 | |
67643946 | aaa_bbb_ccc | D | Dec. 26, 2019, 9:19 a.m. | OK | PyPy 2 | TESTS | 21 | 140 | 6144000 | 1500 | |
54352450 | kbagoli1999 | D | May 18, 2019, 3:38 p.m. | OK | PyPy 2 | TESTS | 21 | 156 | 13312000 | 1500 | |
54283020 | raj1307 | D | May 17, 2019, 2:24 p.m. | OK | PyPy 2 | TESTS | 21 | 202 | 2560000 | 1500 | |
54217024 | aeternalis1 | D | May 15, 2019, 10:38 p.m. | OK | PyPy 2 | TESTS | 21 | 217 | 11366400 | 1500 | |
54226856 | supersangjin | D | May 16, 2019, 6:46 a.m. | OK | PyPy 2 | TESTS | 21 | 248 | 9318400 | 1500 | |
55548935 | Aidos | D | June 14, 2019, 5:42 a.m. | OK | PyPy 3 | TESTS | 21 | 155 | 6758400 | 1500 | |
55280632 | yumtam | D | June 8, 2019, 12:25 a.m. | OK | PyPy 3 | TESTS | 21 | 170 | 9625600 | 1500 | |
55514417 | nik-in-au | D | June 13, 2019, 3:49 a.m. | OK | PyPy 3 | TESTS | 21 | 171 | 10854400 | 1500 | |
55410129 | Pedantic | D | June 10, 2019, 7:07 p.m. | OK | PyPy 3 | TESTS | 21 | 186 | 16076800 | 1500 | |
54640152 | Mark_tven | D | May 25, 2019, 7:03 p.m. | OK | PyPy 3 | TESTS | 21 | 202 | 11366400 | 1500 | |
54214686 | H4Wk3ye | D | May 15, 2019, 7:31 p.m. | OK | PyPy 3 | TESTS | 21 | 217 | 11980800 | 1500 | |
57275097 | brosucks | D | July 18, 2019, 10:31 a.m. | OK | PyPy 3 | TESTS | 21 | 218 | 13619200 | 1500 | |
54248634 | sanvi_kiit | D | May 16, 2019, 4:03 p.m. | OK | PyPy 3 | TESTS | 21 | 233 | 8601600 | 1500 | |
55646850 | sdhd | D | June 16, 2019, 12:38 p.m. | OK | PyPy 3 | TESTS | 21 | 280 | 8908800 | 1500 | |
56459817 | keroru | D | July 3, 2019, 6:17 a.m. | OK | PyPy 3 | TESTS | 21 | 280 | 10035200 | 1500 | |
54536513 | dbthaker | D | May 23, 2019, 8:36 p.m. | OK | Python 2 | TESTS | 21 | 218 | 512000 | 1500 | |
58522012 | soumyasarkar1998 | D | Aug. 10, 2019, 5:21 a.m. | OK | Python 2 | TESTS | 21 | 234 | 614400 | 1500 | |
54250773 | lonerz | D | May 16, 2019, 5:06 p.m. | OK | Python 2 | TESTS | 21 | 265 | 4096000 | 1500 | |
54915517 | kpiiitb | D | June 1, 2019, 1:33 p.m. | OK | Python 2 | TESTS | 21 | 280 | 614400 | 1500 | |
55545403 | ps2pspgood | D | June 14, 2019, 1:44 a.m. | OK | Python 2 | TESTS | 21 | 280 | 3481600 | 1500 | |
54214665 | FlyingBag65 | D | May 15, 2019, 7:30 p.m. | OK | Python 3 | TESTS | 21 | 155 | 921600 | 1500 | |
54216228 | Black_Fregat | D | May 15, 2019, 9:45 p.m. | OK | Python 3 | TESTS | 21 | 155 | 2560000 | 1500 | |
54527306 | Lilstorm | D | May 23, 2019, 3:08 p.m. | OK | Python 3 | TESTS | 21 | 155 | 3072000 | 1500 | |
54642295 | mauricioaniche | D | May 25, 2019, 8:21 p.m. | OK | Python 3 | TESTS | 21 | 170 | 921600 | 1500 | |
54562850 | Billyshuai | D | May 24, 2019, 2:48 p.m. | OK | Python 3 | TESTS | 21 | 171 | 921600 | 1500 | |
54535624 | whatshisbucket | D | May 23, 2019, 7:54 p.m. | OK | Python 3 | TESTS | 21 | 171 | 921600 | 1500 | |
54734680 | tagun1202 | D | May 28, 2019, 3:59 a.m. | OK | Python 3 | TESTS | 21 | 171 | 3072000 | 1500 | |
54747804 | peter6q | D | May 28, 2019, 11:26 a.m. | OK | Python 3 | TESTS | 21 | 186 | 716800 | 1500 | |
54385846 | vemula.sai8 | D | May 19, 2019, 1:20 p.m. | OK | Python 3 | TESTS | 21 | 186 | 1126400 | 1500 | |
54847663 | artisan_ | D | May 30, 2019, 2:51 p.m. | OK | Python 3 | TESTS | 21 | 187 | 1740800 | 1500 | |
55673624 | clrcldy | D | June 17, 2019, 9:08 a.m. | OK | Rust | TESTS | 21 | 46 | 1331200 | 1500 |
Back to search problems