Codeforces Round 519 by Botan Investments

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
1043 Codeforces Round 519 by Botan Investments FINISHED False 7200 196784723 Oct. 28, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6963 ) C Smallest Word PROGRAMMING constructive algorithms greedy implementation 1500

B'IA has so many colorful magnets on her fridge! Exactly one letter is written on each magnet, 'a ' or 'b '. She loves to play with them, placing all magnets in a row. However, the girl is quickly bored and usually thinks how to make her entertainment more interesting. Today, when IA looked at the fridge, she noticed that the word formed by magnets is really messy. "It would look much better when I 'll swap some of them!" -- thought the girl -- "but how to do it?". After a while, she got an idea. IA will look at all prefixes with lengths from 1 to the length of the word and for each prefix she will either reverse this prefix or leave it as it is. She will consider the prefixes in the fixed order: from the shortest to the largest. She wants to get the lexicographically smallest possible word after she considers all prefixes. Can you help her, telling which prefixes should be chosen for reversing? A string a is lexicographically smaller than a string b if and only if one of the following holds: The first and the only line contains a string s ( 1 <= |s| <= 1000 ), describing the initial string formed by magnets. The string s consists only of characters 'a ' and 'b '. Output exactly |s| integers. If IA should reverse the i -th prefix (that is, the substring from 1 to i ), the i -th integer should be equal to 1 , and it should be equal to 0 otherwise. If there are multiple possible sequences leading to the optimal answer, print any of them. In the first example, IA can reverse the second and the third prefix and get a string "abbb". She cannot get better result, since it is also lexicographically smallest string obtainable by permuting characters of the initial string. In the second example, she can reverse any subset of prefixes -- all letters are 'a '. '...

Tutorials

Codeforces Round #519 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
45074197 ACtrain C Oct. 29, 2018, 10:06 p.m. OK Clang++17 Diagnostics TESTS 49 46 5529600 1500
45239452 ichi233 C Nov. 3, 2018, 10:57 a.m. OK Clang++17 Diagnostics TESTS 49 46 6553600 1500
45236782 ichi233 C Nov. 3, 2018, 9:40 a.m. OK Clang++17 Diagnostics TESTS 49 46 6553600 1500
45144934 Gassa C Oct. 31, 2018, 4:21 p.m. OK D TESTS 49 31 4198400 1500
45009136 Gassa C Oct. 28, 2018, 4:27 p.m. OK D TESTS 49 46 4198400 1500
56503476 LaSWeeG C July 4, 2019, 7:23 a.m. OK Delphi TESTS 49 31 0 1500
45012407 ruban C Oct. 28, 2018, 4:47 p.m. OK Delphi TESTS 49 31 109670400 1500
45471154 Khanh_Moriaty C Nov. 9, 2018, 9:44 a.m. OK FPC TESTS 49 31 307200 1500
45007983 AHTOH._. C Oct. 28, 2018, 4:20 p.m. OK FPC TESTS 49 31 307200 1500
45018448 grifguitar C Oct. 28, 2018, 5:29 p.m. OK FPC TESTS 49 31 409600 1500
45061203 luogu_bot2 C Oct. 29, 2018, 2:55 p.m. OK FPC TESTS 49 46 307200 1500
45011916 hua_xzx C Oct. 28, 2018, 4:44 p.m. OK FPC TESTS 49 46 307200 1500
46001503 neo11235 C Nov. 20, 2018, 2:43 p.m. OK GNU C11 TESTS 49 31 0 1500
66213607 abcd227 C Dec. 3, 2019, 7:57 a.m. OK GNU C11 TESTS 49 31 0 1500
57813144 ash070397 C July 26, 2019, 6:21 p.m. OK GNU C11 TESTS 49 31 0 1500
57813135 ash123456 C July 26, 2019, 6:21 p.m. OK GNU C11 TESTS 49 31 0 1500
48902529 preet_02 C Jan. 24, 2019, 6:40 p.m. OK GNU C11 TESTS 49 31 0 1500
69162550 mth1908 C Jan. 20, 2020, 1:20 a.m. OK GNU C11 TESTS 49 31 0 1500
45008913 DanielixS C Oct. 28, 2018, 4:25 p.m. OK GNU C11 TESTS 49 31 0 1500
45015551 dexter729 C Oct. 28, 2018, 5:08 p.m. OK GNU C11 TESTS 49 31 0 1500
45027424 santiago_acevedo C Oct. 28, 2018, 11:31 p.m. OK GNU C11 TESTS 49 31 0 1500
45035003 razor_fox C Oct. 29, 2018, 7:07 a.m. OK GNU C11 TESTS 49 31 0 1500
45008743 nurlitadf C Oct. 28, 2018, 4:24 p.m. OK GNU C++11 TESTS 49 30 0 1500
45052058 gentlelin C Oct. 29, 2018, 11:11 a.m. OK GNU C++11 TESTS 49 30 0 1500
45078709 Merodach C Oct. 30, 2018, 4:11 a.m. OK GNU C++11 TESTS 49 30 0 1500
45117666 DafuqO_o C Oct. 30, 2018, 11:29 p.m. OK GNU C++11 TESTS 49 30 0 1500
45122158 vjudge3 C Oct. 31, 2018, 5:30 a.m. OK GNU C++11 TESTS 49 30 0 1500
45169161 vjudge2 C Nov. 1, 2018, 12:11 p.m. OK GNU C++11 TESTS 49 30 0 1500
45283437 wh_ZH C Nov. 4, 2018, 3:06 p.m. OK GNU C++11 TESTS 49 30 0 1500
45038273 igorshepsh C Oct. 29, 2018, 8:55 a.m. OK GNU C++11 TESTS 49 30 0 1500
45031235 Hono C Oct. 29, 2018, 4:10 a.m. OK GNU C++11 TESTS 49 30 0 1500
45026318 ReallyNewBie C Oct. 28, 2018, 10:11 p.m. OK GNU C++11 TESTS 49 30 0 1500
56140521 fanzhang C June 27, 2019, 2:58 a.m. OK GNU C++14 TESTS 49 15 0 1500
52820891 bojverdict2 C April 16, 2019, 11:55 a.m. OK GNU C++14 TESTS 49 15 0 1500
48432208 ankusht C Jan. 15, 2019, 6:04 p.m. OK GNU C++14 TESTS 49 15 0 1500
47880876 kaplanyb C Jan. 3, 2019, 6:16 p.m. OK GNU C++14 TESTS 49 15 0 1500
46147622 WarBoy C Nov. 24, 2018, 7:43 a.m. OK GNU C++14 TESTS 49 15 0 1500
45274779 K_K C Nov. 4, 2018, 10:28 a.m. OK GNU C++14 TESTS 49 15 0 1500
45085952 Angry_penguin C Oct. 30, 2018, 7:23 a.m. OK GNU C++14 TESTS 49 15 0 1500
45082759 farhanshahoriar C Oct. 30, 2018, 4:47 a.m. OK GNU C++14 TESTS 49 15 0 1500
45040674 puru98 C Oct. 29, 2018, 10:06 a.m. OK GNU C++14 TESTS 49 15 0 1500
45035773 Joker_11 C Oct. 29, 2018, 7:37 a.m. OK GNU C++14 TESTS 49 15 0 1500
61003588 naimishsingh C Sept. 21, 2019, 10:28 a.m. OK GNU C++17 TESTS 49 15 0 1500
53013792 ravindra_kumawat C April 19, 2019, 1:16 p.m. OK GNU C++17 TESTS 49 15 0 1500
50804529 AW_Flister C March 5, 2019, 4:01 a.m. OK GNU C++17 TESTS 49 15 0 1500
47598139 I.L.L C Dec. 27, 2018, 7:53 p.m. OK GNU C++17 TESTS 49 15 0 1500
46996116 mohmahkho C Dec. 14, 2018, 8:36 a.m. OK GNU C++17 TESTS 49 15 0 1500
45037732 joker70 C Oct. 29, 2018, 8:39 a.m. OK GNU C++17 TESTS 49 15 0 1500
45288363 KlzX C Nov. 4, 2018, 6:08 p.m. OK GNU C++17 TESTS 49 15 307200 1500
48065119 harshhx17 C Jan. 7, 2019, 5:39 p.m. OK GNU C++17 TESTS 49 15 307200 1500
49639707 abozzorov C Feb. 8, 2019, 8:48 p.m. OK GNU C++17 TESTS 49 15 307200 1500
45161834 xuzijian629 C Nov. 1, 2018, 9:29 a.m. OK GNU C++17 TESTS 49 15 307200 1500
45024125 vector9x C Oct. 28, 2018, 8:27 p.m. OK Go TESTS 49 31 0 1500
45004428 Martynas C Oct. 28, 2018, 4:03 p.m. OK Go TESTS 49 31 0 1500
45160224 itytwt C Nov. 1, 2018, 8:37 a.m. OK Go TESTS 49 46 0 1500
45014603 megaspazz C Oct. 28, 2018, 5:01 p.m. OK Go TESTS 49 46 0 1500
45011467 life_is_not_bed_of_roses C Oct. 28, 2018, 4:41 p.m. OK Go TESTS 49 46 0 1500
45011048 peter_jerry_ye C Oct. 28, 2018, 4:38 p.m. OK Haskell TESTS 49 31 8499200 1500
68315709 cribabby C Jan. 6, 2020, 1:07 p.m. OK Java 11 TESTS 49 202 0 1500
68462834 -f00- C Jan. 9, 2020, 6:48 p.m. OK Java 8 TESTS 49 108 0 1500
45148319 sarahfarag125 C Oct. 31, 2018, 6:10 p.m. OK Java 8 TESTS 49 108 0 1500
45491334 maciej7777 C Nov. 9, 2018, 7:16 p.m. OK Java 8 TESTS 49 109 0 1500
47443708 Tarun C Dec. 24, 2018, 4:29 a.m. OK Java 8 TESTS 49 109 0 1500
47268548 kocko C Dec. 19, 2018, 3:29 p.m. OK Java 8 TESTS 49 109 0 1500
47248167 donli C Dec. 19, 2018, 6:56 a.m. OK Java 8 TESTS 49 109 0 1500
46993363 donli C Dec. 14, 2018, 6:35 a.m. OK Java 8 TESTS 49 109 0 1500
46047661 happybelly C Nov. 22, 2018, 4:13 a.m. OK Java 8 TESTS 49 109 0 1500
45411386 Psp_98 C Nov. 7, 2018, 12:13 p.m. OK Java 8 TESTS 49 109 0 1500
45266820 tri C Nov. 4, 2018, 6:23 a.m. OK Java 8 TESTS 49 109 0 1500
45220393 Livace C Nov. 2, 2018, 8:36 p.m. OK JavaScript TESTS 49 46 0 1500
45113638 SlavaG C Oct. 30, 2018, 7:56 p.m. OK Kotlin TESTS 49 155 102400 1500
45114067 SlavaG C Oct. 30, 2018, 8:11 p.m. OK Kotlin TESTS 49 155 512000 1500
69226233 mban259 C Jan. 21, 2020, 7:21 a.m. OK Mono C# TESTS 49 46 0 1500
47498114 danik114162 C Dec. 25, 2018, 4:09 p.m. OK Mono C# TESTS 49 46 0 1500
45005987 awesomeday C Oct. 28, 2018, 4:10 p.m. OK Mono C# TESTS 49 61 0 1500
45009141 thetansquared C Oct. 28, 2018, 4:27 p.m. OK Mono C# TESTS 49 61 0 1500
45011298 Lyova C Oct. 28, 2018, 4:40 p.m. OK Mono C# TESTS 49 61 0 1500
56067271 og.kostya C June 26, 2019, 8:36 a.m. OK Mono C# TESTS 49 61 0 1500
45015018 gonchenko C Oct. 28, 2018, 5:04 p.m. OK Mono C# TESTS 49 62 0 1500
45018710 vivek17geek C Oct. 28, 2018, 5:30 p.m. OK Mono C# TESTS 49 62 0 1500
45231692 nastya1199 C Nov. 3, 2018, 7:22 a.m. OK Mono C# TESTS 49 62 0 1500
45204193 Mem C Nov. 2, 2018, 11:48 a.m. OK Mono C# TESTS 49 62 0 1500
45399370 huge_kuriboh C Nov. 7, 2018, 7:23 a.m. OK MS C++ TESTS 49 30 0 1500
68349409 vjudge1 C Jan. 7, 2020, 9:04 a.m. OK MS C++ TESTS 49 30 102400 1500
68386438 vjudge2 C Jan. 8, 2020, 6:11 a.m. OK MS C++ TESTS 49 31 0 1500
68423512 vjudge2 C Jan. 9, 2020, 1:05 a.m. OK MS C++ TESTS 49 31 0 1500
68390764 vjudge5 C Jan. 8, 2020, 8:31 a.m. OK MS C++ TESTS 49 31 0 1500
68382645 vjudge4 C Jan. 8, 2020, 3:03 a.m. OK MS C++ TESTS 49 31 0 1500
68381032 vjudge1 C Jan. 8, 2020, 1:07 a.m. OK MS C++ TESTS 49 31 0 1500
68350304 vjudge3 C Jan. 7, 2020, 9:29 a.m. OK MS C++ TESTS 49 31 0 1500
68349368 vjudge3 C Jan. 7, 2020, 9:03 a.m. OK MS C++ TESTS 49 31 0 1500
68348060 vjudge1 C Jan. 7, 2020, 8:23 a.m. OK MS C++ TESTS 49 31 0 1500
55019536 dragonliulong C June 3, 2019, 2:04 p.m. OK MS C++ 2017 TESTS 49 31 0 1500
55019356 dragonliulong C June 3, 2019, 1:58 p.m. OK MS C++ 2017 TESTS 49 31 0 1500
67762530 OneBit74 C Dec. 28, 2019, 12:09 a.m. OK MS C++ 2017 TESTS 49 31 307200 1500
46283622 Netherfield C Nov. 27, 2018, 2:44 p.m. OK Node.js TESTS 49 217 3174400 1500
45013056 lokehoke C Oct. 28, 2018, 4:51 p.m. OK Node.js TESTS 49 217 4608000 1500
45872631 KGYYT C Nov. 17, 2018, 10:40 a.m. OK PascalABC.NET TESTS 49 46 0 1500
45281978 Phloyd C Nov. 4, 2018, 2:18 p.m. OK PascalABC.NET TESTS 49 46 0 1500
45007134 Arcadii C Oct. 28, 2018, 4:16 p.m. OK PascalABC.NET TESTS 49 46 0 1500
45007620 bsgnl952 C Oct. 28, 2018, 4:19 p.m. OK PascalABC.NET TESTS 49 62 102400 1500
45058519 rsFalse C Oct. 29, 2018, 1:46 p.m. OK Perl TESTS 49 46 0 1500
45056981 rsFalse C Oct. 29, 2018, 1:09 p.m. OK Perl TESTS 49 46 0 1500
45017768 rsFalse C Oct. 28, 2018, 5:24 p.m. OK Perl TESTS 49 46 204800 1500
45011481 mayakin C Oct. 28, 2018, 4:41 p.m. OK PHP TESTS 49 62 409600 1500
45023069 aeternalis1 C Oct. 28, 2018, 7:56 p.m. OK PyPy 2 TESTS 49 124 0 1500
65600921 Zeyu C Nov. 23, 2019, 6:01 p.m. OK PyPy 2 TESTS 49 124 0 1500
45015314 potpath C Oct. 28, 2018, 5:06 p.m. OK PyPy 2 TESTS 49 124 0 1500
45011844 _kawaii_neko_ C Oct. 28, 2018, 4:43 p.m. OK PyPy 2 TESTS 49 124 0 1500
45010945 Mukundan314 C Oct. 28, 2018, 4:38 p.m. OK PyPy 2 TESTS 49 124 0 1500
45002499 dukati8 C Oct. 28, 2018, 3:55 p.m. OK PyPy 2 TESTS 49 124 0 1500
45001698 pajenegod C Oct. 28, 2018, 3:52 p.m. OK PyPy 2 TESTS 49 124 0 1500
45007038 LaiMeiyun C Oct. 28, 2018, 4:15 p.m. OK PyPy 2 TESTS 49 124 204800 1500
45009152 c1729 C Oct. 28, 2018, 4:27 p.m. OK PyPy 2 TESTS 49 139 0 1500
65600783 Zeyu C Nov. 23, 2019, 5:56 p.m. OK PyPy 2 TESTS 49 139 204800 1500
45431880 vjudge4 C Nov. 8, 2018, 4:35 a.m. OK PyPy 3 TESTS 49 124 0 1500
45017501 shortmund09 C Oct. 28, 2018, 5:23 p.m. OK PyPy 3 TESTS 49 124 0 1500
45441531 bycore C Nov. 8, 2018, 11:24 a.m. OK PyPy 3 TESTS 49 139 0 1500
45016555 sound_of_silence C Oct. 28, 2018, 5:16 p.m. OK PyPy 3 TESTS 49 139 0 1500
45067631 whatshisbucket C Oct. 29, 2018, 5:56 p.m. OK PyPy 3 TESTS 49 139 1024000 1500
45031574 bergus C Oct. 29, 2018, 4:32 a.m. OK PyPy 3 TESTS 49 140 0 1500
46237272 bandi.enkh C Nov. 26, 2018, 4:31 a.m. OK PyPy 3 TESTS 49 140 0 1500
45218122 ulyabelyaeva C Nov. 2, 2018, 7:09 p.m. OK PyPy 3 TESTS 49 140 0 1500
45013787 tsapelman C Oct. 28, 2018, 4:56 p.m. OK PyPy 3 TESTS 49 140 0 1500
45011839 max_hha C Oct. 28, 2018, 4:43 p.m. OK PyPy 3 TESTS 49 140 0 1500
45077265 gengiskhan C Oct. 30, 2018, 2:19 a.m. OK Python 2 TESTS 49 171 0 1500
45012382 fatpuffer C Oct. 28, 2018, 4:47 p.m. OK Python 2 TESTS 49 171 0 1500
45002966 Neil C Oct. 28, 2018, 3:57 p.m. OK Python 2 TESTS 49 171 0 1500
45059421 wangkan2001 C Oct. 29, 2018, 2:08 p.m. OK Python 2 TESTS 49 171 102400 1500
45083706 thuglife69 C Oct. 30, 2018, 5:40 a.m. OK Python 2 TESTS 49 171 307200 1500
45012636 radhikapillai25 C Oct. 28, 2018, 4:48 p.m. OK Python 2 TESTS 49 171 307200 1500
45007411 Cifko C Oct. 28, 2018, 4:17 p.m. OK Python 2 TESTS 49 186 0 1500
45013951 abhishekm71 C Oct. 28, 2018, 4:57 p.m. OK Python 2 TESTS 49 186 307200 1500
45006418 jasonliang C Oct. 28, 2018, 4:12 p.m. OK Python 2 TESTS 49 187 0 1500
45002512 cjoa C Oct. 28, 2018, 3:55 p.m. OK Python 2 TESTS 49 187 0 1500
68608985 sherlock8696 C Jan. 11, 2020, 3:01 p.m. OK Python 3 TESTS 49 108 307200 1500
47676572 nowyyz C Dec. 29, 2018, 9:29 a.m. OK Python 3 TESTS 49 109 0 1500
45427594 Pnikolay C Nov. 7, 2018, 10:57 p.m. OK Python 3 TESTS 49 109 0 1500
45287298 abhishek_a C Nov. 4, 2018, 5:30 p.m. OK Python 3 TESTS 49 109 0 1500
45170842 andyy143 C Nov. 1, 2018, 12:49 p.m. OK Python 3 TESTS 49 109 0 1500
45169658 mashot228 C Nov. 1, 2018, 12:23 p.m. OK Python 3 TESTS 49 109 0 1500
45116255 almasip C Oct. 30, 2018, 9:42 p.m. OK Python 3 TESTS 49 109 0 1500
45059313 ashok123 C Oct. 29, 2018, 2:05 p.m. OK Python 3 TESTS 49 109 0 1500
45040746 Alex_Shir C Oct. 29, 2018, 10:09 a.m. OK Python 3 TESTS 49 109 0 1500
45016794 artifexbm C Oct. 28, 2018, 5:18 p.m. OK Python 3 TESTS 49 109 0 1500
45010862 AnandVeeramani C Oct. 28, 2018, 4:37 p.m. OK Ruby TESTS 49 62 0 1500
45111103 flygrounder C Oct. 30, 2018, 6:33 p.m. OK Rust TESTS 49 31 0 1500
45083854 Dx18 C Oct. 30, 2018, 5:48 a.m. OK Rust TESTS 49 31 0 1500
45038366 xaep C Oct. 29, 2018, 8:58 a.m. OK Rust TESTS 49 31 0 1500
46114472 gazaan C Nov. 23, 2018, 1:19 p.m. OK Scala TESTS 49 436 0 1500
45008738 yakamoto C Oct. 28, 2018, 4:24 p.m. OK Scala TESTS 49 452 0 1500
45016623 amirrr C Oct. 28, 2018, 5:16 p.m. OK Scala TESTS 49 467 0 1500

remove filters

Back to search problems