Codeforces Round 584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2)

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
1209 Codeforces Round 584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2) FINISHED False 9000 168972887 Sept. 14, 2019, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7599 ) C Paint the Digits PROGRAMMING constructive algorithms greedy implementation 1600

B"You are given a sequence of n digits d_1d_2 ... d_{n} . You need to paint all the digits in two colors so that: For example, for the sequence d=914 the only valid coloring is 211 (paint in the color 1 two last digits, paint in the color 2 the first digit). But 122 is not a valid coloring ( 9 concatenated with 14 is not a non-decreasing sequence). It is allowed that either of the two colors is not used at all. Digits painted in the same color are not required to have consecutive positions. Find any of the valid ways to paint the given sequence of digits or determine that it is impossible to do. The first line contains a single integer t ( 1 <= t <= 10000 ) -- the number of test cases in the input. The first line of each test case contains an integer n ( 1 <= n <= 2 cdot10^5 ) -- the length of a given sequence of digits. The next line contains a sequence of n digits d_1d_2 ... d_{n} ( 0 <= d_i <= 9 ). The digits are written in a row without spaces or any other separators. The sequence can start with 0. It is guaranteed that the sum of the values xe2 x80 x8b xe2 x80 x8bof n for all test cases in the input does not exceed 2 cdot10^5 . Print t lines -- the answers to each of the test cases in the input. If there is a solution for a test case, the corresponding output line should contain any of the valid colorings written as a string of n digits t_1t_2 ... t_n ( 1 <= t_i <= 2 ), where t_i is the color the i -th digit is painted in. If there are several feasible solutions, print any of them. If there is no solution, then the corresponding output line should contain a single character '-' (the minus sign). In the first test case, d=040425524644 . The output t=121212211211 is correct because 0022444 (painted in 1 ) concatenated with 44556 (painted in 2 ) is 002244444556 which is a sorted sequence "...

Tutorials

69791

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
60618826 chibaheit C Sept. 15, 2019, 11:14 a.m. OK Clang++17 Diagnostics TESTS 97 483 16384000 1600
62593794 7oda_coder C Oct. 14, 2019, 11:39 p.m. OK Clang++17 Diagnostics TESTS 97 639 15360000 1600
60557148 daut-dlang C Sept. 14, 2019, 2:26 p.m. OK D TESTS 97 78 11878400 1600
60557454 Craspedacusta C Sept. 14, 2019, 2:27 p.m. OK FPC TESTS 97 93 2560000 1600
60593093 hengxin11111jy C Sept. 15, 2019, 3:38 a.m. OK FPC TESTS 97 638 409600 1600
60555056 hkwalker C Sept. 14, 2019, 2:17 p.m. OK FPC TESTS 97 639 614400 1600
62403650 LaSWeeG C Oct. 12, 2019, 8:15 a.m. OK FPC TESTS 97 655 3174400 1600
60595293 SangTin C Sept. 15, 2019, 5:12 a.m. OK FPC TESTS 97 811 8806400 1600
61054278 yltx C Sept. 22, 2019, 7:33 a.m. OK GNU C11 TESTS 97 46 2048000 1600
60603018 tiger0132 C Sept. 15, 2019, 8:28 a.m. OK GNU C11 TESTS 97 46 2048000 1600
60560062 york135 C Sept. 14, 2019, 2:39 p.m. OK GNU C11 TESTS 97 62 1843200 1600
60587191 k_ayushh C Sept. 14, 2019, 10:16 p.m. OK GNU C11 TESTS 97 124 10137600 1600
60601086 rackeh C Sept. 15, 2019, 7:55 a.m. OK GNU C11 TESTS 97 624 1126400 1600
60567368 YOK C Sept. 14, 2019, 3:12 p.m. OK GNU C11 TESTS 97 639 409600 1600
60582929 akash19jain C Sept. 14, 2019, 7:22 p.m. OK GNU C11 TESTS 97 655 1024000 1600
60601184 rackeh C Sept. 15, 2019, 7:57 a.m. OK GNU C11 TESTS 97 670 1024000 1600
60555734 pengin_2000 C Sept. 14, 2019, 2:20 p.m. OK GNU C11 TESTS 97 685 1024000 1600
60585306 You_Know_Who C Sept. 14, 2019, 8:46 p.m. OK GNU C11 TESTS 97 685 1228800 1600
60590514 oh_yes C Sept. 15, 2019, 1:48 a.m. OK GNU C++11 TESTS 97 31 409600 1600
60735667 chrischris5855 C Sept. 17, 2019, 5:23 p.m. OK GNU C++11 TESTS 97 31 409600 1600
64628389 ren_jian_cheng C Nov. 10, 2019, 9:18 a.m. OK GNU C++11 TESTS 97 31 614400 1600
60709159 vjudge3 C Sept. 17, 2019, 7:12 a.m. OK GNU C++11 TESTS 97 31 614400 1600
60779665 Nary C Sept. 18, 2019, 3:48 p.m. OK GNU C++11 TESTS 97 31 716800 1600
60634487 luogu_bot2 C Sept. 15, 2019, 12:55 p.m. OK GNU C++11 TESTS 97 31 819200 1600
60555122 Terrasse C Sept. 14, 2019, 2:18 p.m. OK GNU C++11 TESTS 97 31 819200 1600
60666431 Hacheylight C Sept. 16, 2019, 8:19 a.m. OK GNU C++11 TESTS 97 31 1024000 1600
60594439 Pelom777 C Sept. 15, 2019, 4:35 a.m. OK GNU C++11 TESTS 97 31 1024000 1600
68329716 luogu_bot2 C Jan. 6, 2020, 6:15 p.m. OK GNU C++11 TESTS 97 31 1228800 1600
60578722 ydk1104 C Sept. 14, 2019, 5:34 p.m. OK GNU C++14 TESTS 97 31 409600 1600
60663773 izat C Sept. 16, 2019, 6:44 a.m. OK GNU C++14 TESTS 97 31 512000 1600
60557806 Daria_Kulikova C Sept. 14, 2019, 2:29 p.m. OK GNU C++14 TESTS 97 31 512000 1600
60577022 bluesquanium C Sept. 14, 2019, 4:59 p.m. OK GNU C++14 TESTS 97 31 614400 1600
60597231 jell C Sept. 15, 2019, 6:26 a.m. OK GNU C++14 TESTS 97 31 614400 1600
60581299 Sparta_KP C Sept. 14, 2019, 6:36 p.m. OK GNU C++14 TESTS 97 31 716800 1600
60596896 ciutanp C Sept. 15, 2019, 6:14 a.m. OK GNU C++14 TESTS 97 31 716800 1600
60550298 tob123 C Sept. 14, 2019, 1:58 p.m. OK GNU C++14 TESTS 97 31 819200 1600
60595299 jell C Sept. 15, 2019, 5:13 a.m. OK GNU C++14 TESTS 97 31 1024000 1600
60674776 qingyv C Sept. 16, 2019, 12:03 p.m. OK GNU C++14 TESTS 97 31 1228800 1600
65164974 TooYoungTooSimp C Nov. 16, 2019, 12:56 p.m. OK GNU C++17 TESTS 97 31 409600 1600
60724148 CMXRYNP C Sept. 17, 2019, 1:20 p.m. OK GNU C++17 TESTS 97 31 409600 1600
60829328 Euphonium C Sept. 19, 2019, 6:09 a.m. OK GNU C++17 TESTS 97 31 409600 1600
62328843 KrK C Oct. 10, 2019, 7:40 p.m. OK GNU C++17 TESTS 97 31 409600 1600
60635577 Cozma_Tudor C Sept. 15, 2019, 1:40 p.m. OK GNU C++17 TESTS 97 31 512000 1600
60685275 oskarfiuk1 C Sept. 16, 2019, 3:12 p.m. OK GNU C++17 TESTS 97 31 512000 1600
61077259 amr962 C Sept. 22, 2019, 2:58 p.m. OK GNU C++17 TESTS 97 31 512000 1600
62202890 jainsiddhartha C Oct. 9, 2019, 12:32 p.m. OK GNU C++17 TESTS 97 31 512000 1600
60593835 Mmasker C Sept. 15, 2019, 4:07 a.m. OK GNU C++17 TESTS 97 31 614400 1600
68055826 Marckess C Jan. 1, 2020, 10:30 p.m. OK GNU C++17 TESTS 97 31 716800 1600
60588676 jegfault C Sept. 14, 2019, 11:52 p.m. OK Haskell TESTS 97 109 23244800 1600
60622967 jegfault C Sept. 15, 2019, 11:33 a.m. OK Haskell TESTS 97 124 23244800 1600
60588393 jegfault C Sept. 14, 2019, 11:31 p.m. OK Haskell TESTS 97 139 24268800 1600
60586589 jegfault C Sept. 14, 2019, 9:44 p.m. OK Haskell TESTS 97 358 18944000 1600
66979307 machhra C Dec. 15, 2019, 3:47 p.m. OK Java 11 TESTS 97 326 3072000 1600
61282822 di_halt C Sept. 25, 2019, 5:26 p.m. OK Java 8 TESTS 97 124 0 1600
60607014 chojh1222 C Sept. 15, 2019, 9:50 a.m. OK Java 8 TESTS 97 124 0 1600
60598664 SrapZark C Sept. 15, 2019, 7:09 a.m. OK Java 8 TESTS 97 124 0 1600
60583501 TheSawan C Sept. 14, 2019, 7:40 p.m. OK Java 8 TESTS 97 124 0 1600
63059708 ktvktv C Oct. 21, 2019, 8:07 a.m. OK Java 8 TESTS 97 140 0 1600
60677466 ashcodish C Sept. 16, 2019, 12:54 p.m. OK Java 8 TESTS 97 140 0 1600
60595221 alibaba C Sept. 15, 2019, 5:10 a.m. OK Java 8 TESTS 97 140 0 1600
60585870 ijxjdjd C Sept. 14, 2019, 9:10 p.m. OK Java 8 TESTS 97 140 0 1600
60563855 PizzaLovers007 C Sept. 14, 2019, 2:56 p.m. OK Java 8 TESTS 97 140 0 1600
60557540 BerserkVl C Sept. 14, 2019, 2:28 p.m. OK Java 8 TESTS 97 140 0 1600
60558005 mongolrgata C Sept. 14, 2019, 2:30 p.m. OK JavaScript TESTS 97 233 22630400 1600
60651565 Taybor C Sept. 15, 2019, 7:39 p.m. OK JavaScript TESTS 97 249 26521600 1600
60641451 Spheniscine C Sept. 15, 2019, 3:34 p.m. OK Kotlin TESTS 97 139 0 1600
60641262 Spheniscine C Sept. 15, 2019, 3:30 p.m. OK Kotlin TESTS 97 155 0 1600
60591361 Black_Fregat C Sept. 15, 2019, 2:27 a.m. OK Kotlin TESTS 97 264 204800 1600
60552855 Denzed C Sept. 14, 2019, 2:09 p.m. OK Kotlin TESTS 97 280 921600 1600
62739133 darnley C Oct. 16, 2019, 7:12 p.m. OK Kotlin TESTS 97 389 1228800 1600
62739543 darnley C Oct. 16, 2019, 7:19 p.m. OK Kotlin TESTS 97 623 6963200 1600
60744370 ruxbit C Sept. 17, 2019, 11:35 p.m. OK Kotlin TESTS 97 889 0 1600
60586016 enslinmike C Sept. 14, 2019, 9:17 p.m. OK Kotlin TESTS 97 919 7168000 1600
60715130 artworks C Sept. 17, 2019, 10:17 a.m. OK Mono C# TESTS 97 78 9420800 1600
60552815 eulerscheZahl C Sept. 14, 2019, 2:08 p.m. OK Mono C# TESTS 97 92 2150400 1600
60549169 hibatibati C Sept. 14, 2019, 1:54 p.m. OK Mono C# TESTS 97 93 9830400 1600
61793760 og.kostya C Oct. 3, 2019, 4:38 p.m. OK Mono C# TESTS 97 93 10752000 1600
66889087 gorgchap C Dec. 14, 2019, 7:32 p.m. OK Mono C# TESTS 97 124 2150400 1600
60717664 nadilk C Sept. 17, 2019, 11:19 a.m. OK Mono C# TESTS 97 733 21606400 1600
60577450 eki C Sept. 14, 2019, 5:08 p.m. OK Mono C# TESTS 97 748 6246400 1600
61472746 vjudge5 C Sept. 29, 2019, 1:02 p.m. OK MS C++ TESTS 97 46 409600 1600
60590950 vjudge3 C Sept. 15, 2019, 2:10 a.m. OK MS C++ TESTS 97 46 409600 1600
61072923 sunnyorrainy C Sept. 22, 2019, 1:20 p.m. OK MS C++ TESTS 97 46 1843200 1600
60593022 kevin19984 C Sept. 15, 2019, 3:34 a.m. OK MS C++ TESTS 97 46 2560000 1600
60554588 grey C Sept. 14, 2019, 2:16 p.m. OK MS C++ TESTS 97 62 1126400 1600
60590968 vjudge3 C Sept. 15, 2019, 2:11 a.m. OK MS C++ TESTS 97 62 2048000 1600
60597729 vjudge2 C Sept. 15, 2019, 6:41 a.m. OK MS C++ TESTS 97 62 2457600 1600
60597707 vjudge5 C Sept. 15, 2019, 6:41 a.m. OK MS C++ TESTS 97 62 2457600 1600
60605131 vjudge4 C Sept. 15, 2019, 9:12 a.m. OK MS C++ TESTS 97 62 2662400 1600
60551311 tarattata1 C Sept. 14, 2019, 2:02 p.m. OK MS C++ TESTS 97 62 2662400 1600
60557498 PanZverski C Sept. 14, 2019, 2:28 p.m. OK MS C++ 2017 TESTS 97 46 409600 1600
60560402 areo C Sept. 14, 2019, 2:40 p.m. OK MS C++ 2017 TESTS 97 46 921600 1600
60560360 Simon_Chen C Sept. 14, 2019, 2:40 p.m. OK MS C++ 2017 TESTS 97 46 1433600 1600
60582937 vpike C Sept. 14, 2019, 7:22 p.m. OK MS C++ 2017 TESTS 97 62 614400 1600
61766583 vjudge3 C Oct. 3, 2019, 8:49 a.m. OK MS C++ 2017 TESTS 97 62 1843200 1600
61472703 liuhb C Sept. 29, 2019, 1:01 p.m. OK MS C++ 2017 TESTS 97 77 409600 1600
60577003 parfe211 C Sept. 14, 2019, 4:59 p.m. OK MS C++ 2017 TESTS 97 77 819200 1600
61268466 vjudge4 C Sept. 25, 2019, 1:24 p.m. OK MS C++ 2017 TESTS 97 77 1024000 1600
60548778 siwei C Sept. 14, 2019, 1:53 p.m. OK MS C++ 2017 TESTS 97 77 2560000 1600
60564364 ouyeye C Sept. 14, 2019, 2:58 p.m. OK MS C++ 2017 TESTS 97 77 4198400 1600
61293564 mm944 C Sept. 25, 2019, 10:42 p.m. OK PascalABC.NET TESTS 97 920 2252800 1600
60554050 iamprayush C Sept. 14, 2019, 2:13 p.m. OK PyPy 2 TESTS 97 249 17305600 1600
60764672 yumtam C Sept. 18, 2019, 10:28 a.m. OK PyPy 2 TESTS 97 326 8089600 1600
60553002 Pyar.Mahobat.Dhoka.Hai C Sept. 14, 2019, 2:09 p.m. OK PyPy 2 TESTS 97 343 16998400 1600
60561995 ambling C Sept. 14, 2019, 2:47 p.m. OK PyPy 2 TESTS 97 639 14950400 1600
60564097 anshuman16423 C Sept. 14, 2019, 2:57 p.m. OK PyPy 2 TESTS 97 982 14233600 1600
60561530 Yocho C Sept. 14, 2019, 2:45 p.m. OK PyPy 2 TESTS 97 1544 8396800 1600
60575787 FireBird23 C Sept. 14, 2019, 4:39 p.m. OK PyPy 3 TESTS 97 265 22835200 1600
60575616 FireBird23 C Sept. 14, 2019, 4:36 p.m. OK PyPy 3 TESTS 97 280 24883200 1600
60550791 asvasil C Sept. 14, 2019, 2 p.m. OK PyPy 3 TESTS 97 296 18534400 1600
60548598 titia C Sept. 14, 2019, 1:52 p.m. OK PyPy 3 TESTS 97 327 17817600 1600
60574820 meet29 C Sept. 14, 2019, 4:25 p.m. OK PyPy 3 TESTS 97 343 14233600 1600
60552456 erickjohnross C Sept. 14, 2019, 2:07 p.m. OK PyPy 3 TESTS 97 343 15974400 1600
60599434 H4Wk3ye C Sept. 15, 2019, 7:29 a.m. OK PyPy 3 TESTS 97 389 16486400 1600
60560216 Pedantic C Sept. 14, 2019, 2:39 p.m. OK PyPy 3 TESTS 97 389 19660800 1600
60562346 Akash_123 C Sept. 14, 2019, 2:49 p.m. OK PyPy 3 TESTS 97 405 21913600 1600
60679494 thanhnam1998 C Sept. 16, 2019, 1:28 p.m. OK PyPy 3 TESTS 97 436 10137600 1600
60567192 Carmine C Sept. 14, 2019, 3:11 p.m. OK Python 2 TESTS 97 342 7782400 1600
60609356 groupbuilder C Sept. 15, 2019, 10:37 a.m. OK Python 2 TESTS 97 374 6553600 1600
60649341 orailly C Sept. 15, 2019, 6:28 p.m. OK Python 3 TESTS 97 234 2764800 1600
60734108 Tejs C Sept. 17, 2019, 4:49 p.m. OK Python 3 TESTS 97 296 3788800 1600
60553286 raj1307 C Sept. 14, 2019, 2:10 p.m. OK Python 3 TESTS 97 343 3788800 1600
60562376 Arhimason C Sept. 14, 2019, 2:49 p.m. OK Python 3 TESTS 97 343 14540800 1600
60557848 hanka C Sept. 14, 2019, 2:29 p.m. OK Python 3 TESTS 97 389 10752000 1600
60580899 mitribunskiy C Sept. 14, 2019, 6:26 p.m. OK Python 3 TESTS 97 389 23142400 1600
60665392 ZenithINA C Sept. 16, 2019, 7:43 a.m. OK Python 3 TESTS 97 405 5324800 1600
60572500 hsgser C Sept. 14, 2019, 3:32 p.m. OK Python 3 TESTS 97 421 17612800 1600
60899249 fire_alchemist C Sept. 19, 2019, 8:16 p.m. OK Python 3 TESTS 97 421 25292800 1600
60902408 aBoyWantsToCode C Sept. 19, 2019, 11:08 p.m. OK Python 3 TESTS 97 436 19968000 1600
60589035 sansen C Sept. 15, 2019, 12:15 a.m. OK Rust TESTS 97 46 2969600 1600
60675947 aeiou1 C Sept. 16, 2019, 12:25 p.m. OK Rust TESTS 97 46 3276800 1600
60550594 sansen C Sept. 14, 2019, 2 p.m. OK Rust TESTS 97 61 2150400 1600
60571650 laralex C Sept. 14, 2019, 3:29 p.m. OK Rust TESTS 97 61 2969600 1600
60668607 ikazuya0201 C Sept. 16, 2019, 9:30 a.m. OK Rust TESTS 97 186 4812800 1600
60572483 yakamoto C Sept. 14, 2019, 3:32 p.m. OK Scala TESTS 97 701 2355200 1600

remove filters

Back to search problems