Codeforces Round 638 (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
1348 Codeforces Round 638 (Div. 2) FINISHED False 9000 143479499 May 1, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14679 ) C Phoenix and Distribution PROGRAMMING constructive algorithms greedy strings 1600

B'Phoenix has a string s consisting of lowercase Latin letters. He wants to distribute all the letters of his string into k non-empty strings a_1, a_2, ... , a_k such that every letter of s goes to exactly one of the strings a_i . The strings a_i do not need to be substrings of s . Phoenix can distribute letters of s and rearrange the letters within each string a_i however he wants. For example, if s = baba and k=2 , Phoenix may distribute the letters of his string in many ways, such as: But these ways are invalid: Phoenix wants to distribute the letters of his string s into k strings a_1, a_2, ... , a_k to minimize the lexicographically maximum string among them, i. e. minimize max(a_1, a_2, ... , a_k) . Help him find the optimal distribution and print the minimal possible value of max(a_1, a_2, ... , a_k) . String x is lexicographically less than string y if either x is a prefix of y and x ne y , or there exists an index i ( 1 <= i <= min(|x|, |y|)) such that x_i < y_i and for every j (1 <= j < i) x_j = y_j . Here |x| denotes the length of the string x . The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases. Each test case consists of two lines. The first line of each test case consists of two integers n and k ( 1 <= k <= n <= 10^5 ) -- the length of string s and the number of non-empty strings, into which Phoenix wants to distribute letters of s , respectively. The second line of each test case contains a string s of length n consisting only of lowercase Latin letters. It is guaranteed that the sum of n over all test cases is <= 10^5 . Print t answers -- one per test case. The i -th answer should be the minimal possible va'...

Tutorials

Codeforces Round #638 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
78712531 Gassa C May 1, 2020, 3:50 p.m. OK D TESTS 34 31 4198400 1600
78707266 cedretaber C May 1, 2020, 3:40 p.m. OK D TESTS 34 46 4198400 1600
78741968 daut-dlang C May 1, 2020, 4:58 p.m. OK D TESTS 34 46 4198400 1600
78754213 rainboy C May 1, 2020, 6:55 p.m. OK GNU C11 TESTS 34 31 102400 1600
78722332 rainboy C May 1, 2020, 4:10 p.m. OK GNU C11 TESTS 34 31 102400 1600
78704844 EatChangmyeong C May 1, 2020, 3:35 p.m. OK GNU C11 TESTS 34 31 204800 1600
78748292 Beku.sh C May 1, 2020, 6:04 p.m. OK GNU C11 TESTS 34 296 307200 1600
78728820 ananaygupta70 C May 1, 2020, 4:25 p.m. OK GNU C11 TESTS 34 311 204800 1600
78764213 JoseTomas01 C May 1, 2020, 9:23 p.m. OK GNU C11 TESTS 34 312 102400 1600
78703967 pengin_2000 C May 1, 2020, 3:34 p.m. OK GNU C11 TESTS 34 327 307200 1600
78729531 milaXD C May 1, 2020, 4:26 p.m. OK GNU C++11 TESTS 34 30 307200 1600
78767320 samer_orfali C May 1, 2020, 10:35 p.m. OK GNU C++11 TESTS 34 30 1331200 1600
78738193 pisceskkkk C May 1, 2020, 4:49 p.m. OK GNU C++11 TESTS 34 31 0 1600
78735807 tia99 C May 1, 2020, 4:42 p.m. OK GNU C++11 TESTS 34 31 0 1600
78719704 cugel C May 1, 2020, 4:04 p.m. OK GNU C++11 TESTS 34 31 0 1600
78702912 Erimalf C May 1, 2020, 3:32 p.m. OK GNU C++11 TESTS 34 31 0 1600
78757798 ydh C May 1, 2020, 7:40 p.m. OK GNU C++11 TESTS 34 31 102400 1600
78756297 ydh C May 1, 2020, 7:20 p.m. OK GNU C++11 TESTS 34 31 102400 1600
78751035 haomie C May 1, 2020, 6:25 p.m. OK GNU C++11 TESTS 34 31 102400 1600
78749984 LKP1111 C May 1, 2020, 6:16 p.m. OK GNU C++11 TESTS 34 31 102400 1600
78719762 higro C May 1, 2020, 4:05 p.m. OK GNU C++14 TESTS 34 30 102400 1600
78719089 fjdksla C May 1, 2020, 4:03 p.m. OK GNU C++14 TESTS 34 30 102400 1600
78715676 Shoom1 C May 1, 2020, 3:56 p.m. OK GNU C++14 TESTS 34 30 204800 1600
78768634 bhubam C May 1, 2020, 11:14 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78763403 zepplin_786 C May 1, 2020, 9:07 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78756494 _hela C May 1, 2020, 7:23 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78743204 shafat_digonta C May 1, 2020, 5 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78727666 avtobus C May 1, 2020, 4:22 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78726355 Isaiasprepa9 C May 1, 2020, 4:19 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78717435 ThankYou C May 1, 2020, 4 p.m. OK GNU C++14 TESTS 34 30 307200 1600
78706182 cuber_coder C May 1, 2020, 3:38 p.m. OK GNU C++17 TESTS 34 15 614400 1600
78739329 skorobog C May 1, 2020, 4:51 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78762032 tihsrah_1177 C May 1, 2020, 8:43 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78764267 marwa_gamal5 C May 1, 2020, 9:24 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78709966 cx991011 C May 1, 2020, 3:45 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78720499 xuyifeng C May 1, 2020, 4:06 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78707473 sherlhangar C May 1, 2020, 3:40 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78754117 BumbleBee C May 1, 2020, 6:54 p.m. OK GNU C++17 TESTS 34 30 102400 1600
78720433 WO_OD C May 1, 2020, 4:06 p.m. OK GNU C++17 TESTS 34 30 204800 1600
78736718 Yousry C May 1, 2020, 4:45 p.m. OK GNU C++17 TESTS 34 30 204800 1600
78740847 Xetnys_Rorre C May 1, 2020, 4:55 p.m. OK GNU C++17 (64) TESTS 34 15 409600 1600
78708670 Bakry_ C May 1, 2020, 3:42 p.m. OK GNU C++17 (64) TESTS 34 30 307200 1600
78712778 coreproject.yaking C May 1, 2020, 3:50 p.m. OK GNU C++17 (64) TESTS 34 30 307200 1600
78714007 mshiladityam C May 1, 2020, 3:52 p.m. OK GNU C++17 (64) TESTS 34 30 307200 1600
78763169 syawl-1017 C May 1, 2020, 9:03 p.m. OK GNU C++17 (64) TESTS 34 30 307200 1600
78768618 princebelkovetz C May 1, 2020, 11:13 p.m. OK GNU C++17 (64) TESTS 34 30 409600 1600
78741446 ondrah C May 1, 2020, 4:56 p.m. OK GNU C++17 (64) TESTS 34 30 409600 1600
78732870 msporyshev C May 1, 2020, 4:35 p.m. OK GNU C++17 (64) TESTS 34 30 409600 1600
78752275 prottoyfuad C May 1, 2020, 6:36 p.m. OK GNU C++17 (64) TESTS 34 30 409600 1600
78758812 raushan303 C May 1, 2020, 7:54 p.m. OK GNU C++17 (64) TESTS 34 30 409600 1600
78714347 Jughead C May 1, 2020, 3:53 p.m. OK Go TESTS 34 46 102400 1600
78735442 pohzipohzi C May 1, 2020, 4:41 p.m. OK Go TESTS 34 61 5632000 1600
78710745 Russell_Emerine C May 1, 2020, 3:46 p.m. OK Haskell TESTS 34 93 4300800 1600
78740457 anuragshirolkar C May 1, 2020, 4:54 p.m. OK Haskell TESTS 34 93 5324800 1600
78760503 devesh08 C May 1, 2020, 8:20 p.m. OK Java 11 TESTS 34 186 0 1600
78736111 avijit_agarwal C May 1, 2020, 4:43 p.m. OK Java 11 TESTS 34 187 0 1600
78732958 idk321 C May 1, 2020, 4:35 p.m. OK Java 11 TESTS 34 187 0 1600
78737577 sudhanshu_lucky C May 1, 2020, 4:47 p.m. OK Java 11 TESTS 34 202 0 1600
78735748 egaeus.code C May 1, 2020, 4:42 p.m. OK Java 11 TESTS 34 202 0 1600
78702683 its_aks_ulure C May 1, 2020, 3:31 p.m. OK Java 11 TESTS 34 202 0 1600
78702302 sarthakmanna C May 1, 2020, 3:31 p.m. OK Java 11 TESTS 34 202 204800 1600
78759676 Dukkha C May 1, 2020, 8:07 p.m. OK Java 11 TESTS 34 217 0 1600
78731711 atfiona C May 1, 2020, 4:32 p.m. OK Java 11 TESTS 34 217 0 1600
78713611 nthistle C May 1, 2020, 3:52 p.m. OK Java 11 TESTS 34 217 0 1600
78764408 ravi_dtu C May 1, 2020, 9:27 p.m. OK Java 8 TESTS 34 109 0 1600
78762731 manish_98 C May 1, 2020, 8:55 p.m. OK Java 8 TESTS 34 109 0 1600
78759719 prem_cse C May 1, 2020, 8:07 p.m. OK Java 8 TESTS 34 124 0 1600
78765325 IBatJ C May 1, 2020, 9:46 p.m. OK Java 8 TESTS 34 124 0 1600
78764531 Nirav412000 C May 1, 2020, 9:29 p.m. OK Java 8 TESTS 34 124 0 1600
78764449 priyesh001 C May 1, 2020, 9:28 p.m. OK Java 8 TESTS 34 124 0 1600
78759695 an09mous C May 1, 2020, 8:07 p.m. OK Java 8 TESTS 34 124 0 1600
78759529 bhavyseth C May 1, 2020, 8:05 p.m. OK Java 8 TESTS 34 124 0 1600
78759327 B___S C May 1, 2020, 8:01 p.m. OK Java 8 TESTS 34 124 0 1600
78757627 Whiplash99 C May 1, 2020, 7:38 p.m. OK Java 8 TESTS 34 124 0 1600
78709802 old_boo C May 1, 2020, 3:45 p.m. OK Kotlin TESTS 34 186 1331200 1600
78736141 OLS C May 1, 2020, 4:43 p.m. OK Kotlin TESTS 34 187 102400 1600
78710663 MikasaAckermann C May 1, 2020, 3:46 p.m. OK Kotlin TESTS 34 187 1433600 1600
78739350 abdukodir C May 1, 2020, 4:51 p.m. OK Kotlin TESTS 34 202 1331200 1600
78705893 koboshi C May 1, 2020, 3:37 p.m. OK Kotlin TESTS 34 202 1331200 1600
78762495 bohuss C May 1, 2020, 8:50 p.m. OK Kotlin TESTS 34 202 1331200 1600
78740781 mban259 C May 1, 2020, 4:55 p.m. OK Mono C# TESTS 34 62 1740800 1600
78714388 kuuso C May 1, 2020, 3:53 p.m. OK Mono C# TESTS 34 62 1843200 1600
78707130 hibatibati C May 1, 2020, 3:39 p.m. OK Mono C# TESTS 34 77 3276800 1600
78737039 avtoruxadze C May 1, 2020, 4:46 p.m. OK Mono C# TESTS 34 77 7680000 1600
78738023 tvvister C May 1, 2020, 4:48 p.m. OK Mono C# TESTS 34 78 7372800 1600
78754871 hloya C May 1, 2020, 7:02 p.m. OK Mono C# TESTS 34 78 12185600 1600
78710876 Yupiteru C May 1, 2020, 3:46 p.m. OK Mono C# TESTS 34 93 141312000 1600
78728924 DaniilPanasenko C May 1, 2020, 4:25 p.m. OK Mono C# TESTS 34 967 7168000 1600
78727652 Volja C May 1, 2020, 4:22 p.m. OK MS C++ TESTS 34 31 102400 1600
78731055 r57shell C May 1, 2020, 4:30 p.m. OK MS C++ TESTS 34 31 409600 1600
78718481 anylonger C May 1, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 34 31 102400 1600
78745111 Myao C May 1, 2020, 5:04 p.m. OK MS C++ 2017 TESTS 34 31 204800 1600
78703467 ningBr C May 1, 2020, 3:33 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78765981 alyona_k C May 1, 2020, 10:01 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78729322 rhksdn6227 C May 1, 2020, 4:26 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78718688 zkq609 C May 1, 2020, 4:02 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78717910 ndhp2000 C May 1, 2020, 4 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78714684 P___ C May 1, 2020, 3:54 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78710884 BpeMeHHa91_TryDHocTb C May 1, 2020, 3:46 p.m. OK MS C++ 2017 TESTS 34 31 307200 1600
78744559 mpoleg C May 1, 2020, 5:03 p.m. OK MS C++ 2017 TESTS 34 31 409600 1600
78718774 rsFalse C May 1, 2020, 4:02 p.m. OK Perl TESTS 34 109 11161600 1600
78733311 anshuman16423 C May 1, 2020, 4:36 p.m. OK PyPy 2 TESTS 34 156 4915200 1600
78722169 Pyar.Mahobat.Dhoka.Hai C May 1, 2020, 4:10 p.m. OK PyPy 2 TESTS 34 171 5222400 1600
78717868 rkstalker C May 1, 2020, 4 p.m. OK PyPy 2 TESTS 34 186 3481600 1600
78710665 pajenegod C May 1, 2020, 3:46 p.m. OK PyPy 2 TESTS 34 186 3891200 1600
78724582 Bluefish2 C May 1, 2020, 4:15 p.m. OK PyPy 2 TESTS 34 187 3686400 1600
78744490 wolffd C May 1, 2020, 5:03 p.m. OK PyPy 2 TESTS 34 202 3379200 1600
78725756 Gaurav1 C May 1, 2020, 4:18 p.m. OK PyPy 2 TESTS 34 202 8704000 1600
78721431 satyamcse C May 1, 2020, 4:08 p.m. OK PyPy 2 TESTS 34 202 11059200 1600
78736952 ap1008 C May 1, 2020, 4:45 p.m. OK PyPy 2 TESTS 34 234 3276800 1600
78725335 jolt.tks C May 1, 2020, 4:17 p.m. OK PyPy 2 TESTS 34 343 8499200 1600
78716383 cgfs10000 C May 1, 2020, 3:57 p.m. OK PyPy 3 TESTS 34 171 5529600 1600
78748114 zayaz777 C May 1, 2020, 6:02 p.m. OK PyPy 3 TESTS 34 171 7577600 1600
78707386 addammy C May 1, 2020, 3:40 p.m. OK PyPy 3 TESTS 34 186 3891200 1600
78705022 cftt C May 1, 2020, 3:36 p.m. OK PyPy 3 TESTS 34 186 5529600 1600
78740838 romanovma C May 1, 2020, 4:55 p.m. OK PyPy 3 TESTS 34 186 5939200 1600
78713017 docardoso C May 1, 2020, 3:51 p.m. OK PyPy 3 TESTS 34 186 6041600 1600
78707477 julianferres C May 1, 2020, 3:40 p.m. OK PyPy 3 TESTS 34 186 8601600 1600
78740403 nikeshthapa255 C May 1, 2020, 4:54 p.m. OK PyPy 3 TESTS 34 187 4096000 1600
78707534 marcus.aure C May 1, 2020, 3:40 p.m. OK PyPy 3 TESTS 34 187 9216000 1600
78738972 Coki628 C May 1, 2020, 4:50 p.m. OK PyPy 3 TESTS 34 187 10035200 1600
78733858 shubhankarsharma00 C May 1, 2020, 4:37 p.m. OK Python 2 TESTS 34 218 1126400 1600
78743821 Hitikkumar C May 1, 2020, 5:02 p.m. OK Python 2 TESTS 34 249 307200 1600
78743571 Daniil_Gorohov C May 1, 2020, 5:01 p.m. OK Python 3 TESTS 34 109 1740800 1600
78716358 changz C May 1, 2020, 3:57 p.m. OK Python 3 TESTS 34 124 512000 1600
78761596 Nanored C May 1, 2020, 8:36 p.m. OK Python 3 TESTS 34 124 921600 1600
78723837 BlackBear C May 1, 2020, 4:13 p.m. OK Python 3 TESTS 34 124 1126400 1600
78743684 KA_Rma C May 1, 2020, 5:01 p.m. OK Python 3 TESTS 34 124 1331200 1600
78730832 Cipher76 C May 1, 2020, 4:30 p.m. OK Python 3 TESTS 34 124 1331200 1600
78715795 Galkowsky C May 1, 2020, 3:56 p.m. OK Python 3 TESTS 34 124 1433600 1600
78766140 tidu149 C May 1, 2020, 10:04 p.m. OK Python 3 TESTS 34 124 1638400 1600
78735170 Glezok C May 1, 2020, 4:41 p.m. OK Python 3 TESTS 34 124 1638400 1600
78733476 PanZverski C May 1, 2020, 4:36 p.m. OK Python 3 TESTS 34 124 1638400 1600
78767842 sansen C May 1, 2020, 10:50 p.m. OK Rust TESTS 34 31 1024000 1600
78742178 rustafarian C May 1, 2020, 4:58 p.m. OK Rust TESTS 34 31 1024000 1600
78702348 zz_kk C May 1, 2020, 3:31 p.m. OK Rust TESTS 34 46 307200 1600
78742145 cotton100pc C May 1, 2020, 4:58 p.m. OK Rust TESTS 34 46 614400 1600
78721864 fatemender C May 1, 2020, 4:09 p.m. OK Rust TESTS 34 46 3276800 1600
78745416 hir12111 C May 1, 2020, 5:04 p.m. OK Rust TESTS 34 46 6144000 1600

remove filters

Back to search problems