CodeCraft-20 (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
1316 CodeCraft-20 (Div. 2) FINISHED False 7200 154020311 March 4, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11348 ) B String Modification PROGRAMMING brute force constructive algorithms implementation sortings strings 1400

B"Vasya has a string s of length n . He decides to make the following modification to the string: Vasya wants to choose a k such that the string obtained after the above-mentioned modification is lexicographically smallest possible among all choices of k . Among all such k , he wants to choose the smallest one. Since he is busy attending Felicity 2020, he asks for your help. A string a is lexicographically smaller than a string b if and only if one of the following holds: Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 5000 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 5000 ) -- the length of the string s . The second line of each test case contains the string s of n lowercase latin letters. It is guaranteed that the sum of n over all test cases does not exceed 5000 . For each testcase output two lines: In the first line output the lexicographically smallest string s' achievable after the above-mentioned modification. In the second line output the appropriate value of k ( 1 <= q k <= q n ) that you chose for performing the modification. If there are multiple values of k that give the lexicographically smallest string, output the smallest value of k among them. In the first testcase of the first sample, the string modification results for the sample abab are as follows : The lexicographically smallest string achievable through modification is abab for k = 1 and 3 . Smallest value of k needed to achieve is hence 1 . "...

Tutorials

Codecraft-20 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
72447109 avm B March 4, 2020, 3:46 p.m. OK D TESTS 151 249 4198400 1400
72435106 iica B March 4, 2020, 3:05 p.m. OK D TESTS 151 701 4300800 1400
72433068 daut-dlang B March 4, 2020, 2:58 p.m. OK D TESTS 151 732 151552000 1400
72441113 ruban B March 4, 2020, 3:24 p.m. OK Delphi TESTS 151 46 102400 1400
72445186 Lycfucking. B March 4, 2020, 3:39 p.m. OK FPC TESTS 151 61 1024000 1400
72445768 thegreatkwanghyeon B March 4, 2020, 3:41 p.m. OK GNU C11 TESTS 151 31 0 1400
72434798 pengin_2000 B March 4, 2020, 3:04 p.m. OK GNU C11 TESTS 151 46 0 1400
72545161 Dorothy_ B March 6, 2020, 12:54 a.m. OK GNU C11 TESTS 154 46 0 1400
72479719 hnust_tanzhongsheng B March 5, 2020, 1:09 a.m. OK GNU C11 TESTS 154 61 0 1400
72446034 kaiboy B March 4, 2020, 3:42 p.m. OK GNU C11 TESTS 151 62 0 1400
72439276 _Rebellion B March 4, 2020, 3:18 p.m. OK GNU C11 TESTS 151 62 0 1400
72584826 SpaceX3 B March 6, 2020, 3:41 p.m. OK GNU C++11 TESTS 154 31 0 1400
72552015 vectorwyx B March 6, 2020, 5:12 a.m. OK GNU C++11 TESTS 154 31 0 1400
72480589 WZYYN B March 5, 2020, 1:41 a.m. OK GNU C++11 TESTS 154 31 0 1400
72480416 albertxwz B March 5, 2020, 1:35 a.m. OK GNU C++11 TESTS 154 31 0 1400
72478691 WZDSLZT B March 5, 2020, 12:27 a.m. OK GNU C++11 TESTS 154 31 0 1400
72437679 fnoigsh B March 4, 2020, 3:13 p.m. OK GNU C++11 TESTS 151 31 0 1400
72437143 winter2121 B March 4, 2020, 3:11 p.m. OK GNU C++11 TESTS 151 31 0 1400
72429519 zhouzhuan233 B March 4, 2020, 2:48 p.m. OK GNU C++11 TESTS 151 31 0 1400
72589319 cugel B March 6, 2020, 4:55 p.m. OK GNU C++11 TESTS 154 31 0 1400
72429764 Suika_predictor B March 4, 2020, 2:49 p.m. OK GNU C++11 TESTS 151 31 102400 1400
72452169 bhubam B March 4, 2020, 4:05 p.m. OK GNU C++14 TESTS 151 31 0 1400
72480582 Alan_zhou B March 5, 2020, 1:41 a.m. OK GNU C++14 TESTS 154 31 0 1400
72482459 stonemasons B March 5, 2020, 2:47 a.m. OK GNU C++14 TESTS 154 31 0 1400
72484308 sunghyen B March 5, 2020, 3:45 a.m. OK GNU C++14 TESTS 154 31 0 1400
72436212 _dipu B March 4, 2020, 3:08 p.m. OK GNU C++14 TESTS 151 31 0 1400
72475611 OTTFF B March 4, 2020, 10:18 p.m. OK GNU C++14 TESTS 154 31 0 1400
72437477 kobebryan9 B March 4, 2020, 3:12 p.m. OK GNU C++14 TESTS 151 31 102400 1400
72441639 scribblr B March 4, 2020, 3:26 p.m. OK GNU C++14 TESTS 151 31 102400 1400
72610137 DanielVillota16 B March 7, 2020, 2:17 a.m. OK GNU C++14 TESTS 154 31 307200 1400
72580462 siddhant1 B March 6, 2020, 2:31 p.m. OK GNU C++14 TESTS 154 31 307200 1400
72447534 a_newbie B March 4, 2020, 3:47 p.m. OK GNU C++17 TESTS 151 31 0 1400
72482115 autoint B March 5, 2020, 2:35 a.m. OK GNU C++17 TESTS 154 31 0 1400
72459600 panghengze B March 4, 2020, 4:31 p.m. OK GNU C++17 TESTS 151 31 0 1400
72450945 fur_ B March 4, 2020, 4 p.m. OK GNU C++17 TESTS 151 31 0 1400
72443163 cpz2000 B March 4, 2020, 3:31 p.m. OK GNU C++17 TESTS 151 31 0 1400
72441214 gs15120 B March 4, 2020, 3:25 p.m. OK GNU C++17 TESTS 151 31 0 1400
72435451 cx991011 B March 4, 2020, 3:06 p.m. OK GNU C++17 TESTS 151 31 0 1400
72431385 dmkozyrev B March 4, 2020, 2:53 p.m. OK GNU C++17 TESTS 151 31 0 1400
72430768 ouqingliang B March 4, 2020, 2:52 p.m. OK GNU C++17 TESTS 151 31 0 1400
72445859 Abhijeet8901 B March 4, 2020, 3:41 p.m. OK GNU C++17 TESTS 151 31 102400 1400
72610736 iHackSubhodip B March 7, 2020, 2:46 a.m. OK Go TESTS 154 62 5324800 1400
72610675 iHackSubhodip B March 7, 2020, 2:43 a.m. OK Go TESTS 154 62 5324800 1400
72491290 synapse B March 5, 2020, 6:48 a.m. OK Go TESTS 154 62 5427200 1400
72610370 iHackSubhodip B March 7, 2020, 2:29 a.m. OK Go TESTS 154 77 5324800 1400
72436867 Jughead B March 4, 2020, 3:10 p.m. OK Go TESTS 151 78 0 1400
72449843 snow_bear_328 B March 4, 2020, 3:56 p.m. OK Go TESTS 151 78 5324800 1400
72435263 u1s1reallycai B March 4, 2020, 3:05 p.m. OK Go TESTS 151 93 5427200 1400
72609966 amarjeetanand B March 7, 2020, 2:08 a.m. OK Go TESTS 154 93 36556800 1400
72610596 iHackSubhodip B March 7, 2020, 2:40 a.m. OK Go TESTS 154 108 5324800 1400
72485483 wzazzy B March 5, 2020, 4:22 a.m. OK Go TESTS 154 108 5324800 1400
72591590 Russell_Emerine B March 6, 2020, 5:27 p.m. OK Haskell TESTS 154 421 102400 1400
72456804 DreamInfinite B March 4, 2020, 4:22 p.m. OK Java 11 TESTS 151 233 0 1400
72568878 dash2199 B March 6, 2020, 11:27 a.m. OK Java 11 TESTS 154 249 0 1400
72471038 lightseba B March 4, 2020, 8:14 p.m. OK Java 11 TESTS 154 249 0 1400
72431073 Hemose B March 4, 2020, 2:52 p.m. OK Java 11 TESTS 151 249 0 1400
72597409 jaynils B March 6, 2020, 6:52 p.m. OK Java 11 TESTS 154 249 33689600 1400
72440685 Ti4oVolchara B March 4, 2020, 3:23 p.m. OK Java 11 TESTS 151 264 0 1400
72430831 nick_301 B March 4, 2020, 2:52 p.m. OK Java 11 TESTS 151 264 0 1400
72430016 uwi B March 4, 2020, 2:49 p.m. OK Java 11 TESTS 151 280 0 1400
72436648 hakr_2104 B March 4, 2020, 3:09 p.m. OK Java 11 TESTS 151 280 204800 1400
72431534 ZeyadKhattab B March 4, 2020, 2:54 p.m. OK Java 11 TESTS 151 280 34918400 1400
72531720 ankyy_0103 B March 5, 2020, 6:04 p.m. OK Java 8 TESTS 154 155 0 1400
72451871 aston_martin B March 4, 2020, 4:04 p.m. OK Java 8 TESTS 151 155 0 1400
72585242 Noureldin_Khaled B March 6, 2020, 3:47 p.m. OK Java 8 TESTS 154 156 0 1400
72441327 Optimist_Code B March 4, 2020, 3:25 p.m. OK Java 8 TESTS 151 156 0 1400
72431188 cwise B March 4, 2020, 2:53 p.m. OK Java 8 TESTS 151 156 20172800 1400
72522337 sunnycarlos B March 5, 2020, 3:24 p.m. OK Java 8 TESTS 154 171 0 1400
72519181 SpargelTarzan B March 5, 2020, 2:33 p.m. OK Java 8 TESTS 154 171 0 1400
72490582 yuruiyin B March 5, 2020, 6:32 a.m. OK Java 8 TESTS 154 171 0 1400
72483581 zekigurbuz B March 5, 2020, 3:24 a.m. OK Java 8 TESTS 154 171 0 1400
72476124 briank621 B March 4, 2020, 10:38 p.m. OK Java 8 TESTS 154 171 0 1400
72445594 walborn B March 4, 2020, 3:40 p.m. OK JavaScript TESTS 151 46 28672000 1400
72431359 SlavaG B March 4, 2020, 2:53 p.m. OK Kotlin TESTS 151 202 0 1400
72497441 Spheniscine B March 5, 2020, 8:51 a.m. OK Kotlin TESTS 154 218 0 1400
72574306 programmerr47 B March 6, 2020, 12:59 p.m. OK Kotlin TESTS 154 218 0 1400
72449236 dkozak94 B March 4, 2020, 3:54 p.m. OK Kotlin TESTS 151 218 0 1400
72433893 Respect2D B March 4, 2020, 3:01 p.m. OK Kotlin TESTS 151 218 0 1400
72438418 wbars B March 4, 2020, 3:15 p.m. OK Kotlin TESTS 151 233 0 1400
72437339 jonas.havelka.42 B March 4, 2020, 3:12 p.m. OK Kotlin TESTS 151 233 0 1400
72475322 sylvyrfysh B March 4, 2020, 10:08 p.m. OK Kotlin TESTS 154 233 819200 1400
72435268 koboshi B March 4, 2020, 3:05 p.m. OK Kotlin TESTS 151 327 63795200 1400
72466589 PeinAgail B March 4, 2020, 7:06 p.m. OK Kotlin TESTS 151 436 1433600 1400
72432145 mban259 B March 4, 2020, 2:55 p.m. OK Mono C# TESTS 151 93 3174400 1400
72450946 hyzhyzhy B March 4, 2020, 4 p.m. OK Mono C# TESTS 151 93 6963200 1400
72444932 eki B March 4, 2020, 3:38 p.m. OK Mono C# TESTS 151 124 409600 1400
72430547 hibatibati B March 4, 2020, 2:51 p.m. OK Mono C# TESTS 151 249 61440000 1400
72430292 Yupiteru B March 4, 2020, 2:50 p.m. OK Mono C# TESTS 151 327 141516800 1400
72514674 vjudge5 B March 5, 2020, 1:26 p.m. OK MS C++ TESTS 154 31 204800 1400
72569091 vjudge5 B March 6, 2020, 11:31 a.m. OK MS C++ TESTS 154 46 0 1400
72569190 vjudge1 B March 6, 2020, 11:33 a.m. OK MS C++ TESTS 154 46 204800 1400
72515354 vjudge5 B March 5, 2020, 1:36 p.m. OK MS C++ TESTS 154 46 204800 1400
72514059 vjudge1 B March 5, 2020, 1:18 p.m. OK MS C++ TESTS 154 46 204800 1400
72510933 vjudge4 B March 5, 2020, 12:34 p.m. OK MS C++ TESTS 154 61 102400 1400
72506792 vjudge3 B March 5, 2020, 11:30 a.m. OK MS C++ TESTS 154 62 102400 1400
72456876 ltnotfty B March 4, 2020, 4:22 p.m. OK MS C++ TESTS 151 124 204800 1400
72434249 Denx24x B March 4, 2020, 3:02 p.m. OK MS C++ TESTS 151 124 409600 1400
72483243 vjudge1 B March 5, 2020, 3:13 a.m. OK MS C++ TESTS 154 124 512000 1400
72441831 s1mp1e B March 4, 2020, 3:27 p.m. OK MS C++ 2017 TESTS 151 46 0 1400
72442009 kim_young_hyun B March 4, 2020, 3:27 p.m. OK MS C++ 2017 TESTS 151 46 0 1400
72442461 tahtarovserver B March 4, 2020, 3:29 p.m. OK MS C++ 2017 TESTS 151 46 102400 1400
72605405 Hura007 B March 6, 2020, 10 p.m. OK MS C++ 2017 TESTS 154 46 307200 1400
72503104 salehsargolzaee B March 5, 2020, 10:25 a.m. OK MS C++ 2017 TESTS 154 46 307200 1400
72480110 GomBu B March 5, 2020, 1:23 a.m. OK MS C++ 2017 TESTS 154 46 307200 1400
72468912 openingsound B March 4, 2020, 7:36 p.m. OK MS C++ 2017 TESTS 151 46 307200 1400
72452552 i3Cheese B March 4, 2020, 4:06 p.m. OK MS C++ 2017 TESTS 151 46 307200 1400
72446972 catplatypus B March 4, 2020, 3:45 p.m. OK MS C++ 2017 TESTS 151 46 307200 1400
72446371 PrideBlack B March 4, 2020, 3:43 p.m. OK MS C++ 2017 TESTS 151 46 307200 1400
72487942 shivam1420 B March 5, 2020, 5:29 a.m. OK Node.js TESTS 154 390 5734400 1400
72449077 denchik007orel57 B March 4, 2020, 3:53 p.m. OK PascalABC.NET TESTS 151 530 34918400 1400
72542603 mayakin B March 5, 2020, 10:41 p.m. OK PHP TESTS 154 998 89907200 1400
72522388 satyamcse B March 5, 2020, 3:25 p.m. OK PyPy 2 TESTS 154 155 1433600 1400
72522727 satyamcse B March 5, 2020, 3:31 p.m. OK PyPy 2 TESTS 154 156 1433600 1400
72437169 snape_here B March 4, 2020, 3:11 p.m. OK PyPy 2 TESTS 151 156 1433600 1400
72474314 raj1307 B March 4, 2020, 9:33 p.m. OK PyPy 2 TESTS 154 171 1536000 1400
72432411 Mukundan314 B March 4, 2020, 2:56 p.m. OK PyPy 2 TESTS 151 187 1126400 1400
72522234 satyamcse B March 5, 2020, 3:23 p.m. OK PyPy 2 TESTS 154 187 1433600 1400
72435908 love_wjn B March 4, 2020, 3:07 p.m. OK PyPy 2 TESTS 151 202 26521600 1400
72431297 Gaurav1 B March 4, 2020, 2:53 p.m. OK PyPy 2 TESTS 151 218 27136000 1400
72431200 astrom.lars B March 4, 2020, 2:53 p.m. OK PyPy 2 TESTS 151 326 3993600 1400
72453689 w4sp B March 4, 2020, 4:11 p.m. OK PyPy 2 TESTS 151 342 3891200 1400
72522422 satyamcse B March 5, 2020, 3:26 p.m. OK PyPy 3 TESTS 154 187 4505600 1400
72522197 satyamcse B March 5, 2020, 3:22 p.m. OK PyPy 3 TESTS 154 187 4505600 1400
72514457 sureshsinghspd B March 5, 2020, 1:23 p.m. OK PyPy 3 TESTS 154 187 4608000 1400
72437720 Morfeo B March 4, 2020, 3:13 p.m. OK PyPy 3 TESTS 151 202 2969600 1400
72466434 dqoder B March 4, 2020, 7:05 p.m. OK PyPy 3 TESTS 151 202 3686400 1400
72436320 jakethekoenig B March 4, 2020, 3:08 p.m. OK PyPy 3 TESTS 151 202 4403200 1400
72517810 satyamcse B March 5, 2020, 2:12 p.m. OK PyPy 3 TESTS 154 202 4505600 1400
72529752 aberent B March 5, 2020, 5:29 p.m. OK PyPy 3 TESTS 154 202 4608000 1400
72488584 m.ni B March 5, 2020, 5:46 a.m. OK PyPy 3 TESTS 154 202 4710400 1400
72444903 Tao-Cheng B March 4, 2020, 3:38 p.m. OK PyPy 3 TESTS 151 202 4710400 1400
72499076 GTrigger B March 5, 2020, 9:20 a.m. OK Python 2 TESTS 154 202 28467200 1400
72474308 raj1307 B March 4, 2020, 9:33 p.m. OK Python 2 TESTS 154 218 1740800 1400
72474888 snape_here B March 4, 2020, 9:54 p.m. OK Python 2 TESTS 154 233 2560000 1400
72468097 ComptineDunAutreEte B March 4, 2020, 7:24 p.m. OK Python 2 TESTS 151 233 28876800 1400
72468978 bertrandovide B March 4, 2020, 7:37 p.m. OK Python 2 TESTS 151 343 614400 1400
72468370 bertrandovide B March 4, 2020, 7:28 p.m. OK Python 2 TESTS 151 374 2560000 1400
72524510 prsb0824 B March 5, 2020, 3:59 p.m. OK Python 3 TESTS 154 139 921600 1400
72484606 Kiran342 B March 5, 2020, 3:55 a.m. OK Python 3 TESTS 154 139 2355200 1400
72440456 gjdms611 B March 4, 2020, 3:22 p.m. OK Python 3 TESTS 151 140 2457600 1400
72532737 atlas22 B March 5, 2020, 6:23 p.m. OK Python 3 TESTS 154 140 2560000 1400
72434288 BratAhmet B March 4, 2020, 3:02 p.m. OK Python 3 TESTS 151 140 2560000 1400
72545516 fatalisPM B March 6, 2020, 1:12 a.m. OK Python 3 TESTS 154 140 2662400 1400
72537928 LintuStorm B March 5, 2020, 8:12 p.m. OK Python 3 TESTS 154 140 2764800 1400
72534156 SinKing B March 5, 2020, 6:48 p.m. OK Python 3 TESTS 154 140 28569600 1400
72563946 1704011_Rifat B March 6, 2020, 9:47 a.m. OK Python 3 TESTS 154 155 921600 1400
72490949 safal.gupta001 B March 5, 2020, 6:40 a.m. OK Python 3 TESTS 154 155 921600 1400
72430571 sansen B March 4, 2020, 2:51 p.m. OK Rust TESTS 151 46 307200 1400
72444071 akiradeveloper B March 4, 2020, 3:35 p.m. OK Rust TESTS 151 124 819200 1400
72442747 rustafarian B March 4, 2020, 3:30 p.m. OK Rust TESTS 151 139 102400 1400
72536347 WillToPower B March 5, 2020, 7:36 p.m. OK Rust TESTS 154 140 102400 1400

remove filters

Back to search problems