Codeforces Round 764 (Div. 3)

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
1624 Codeforces Round 764 (Div. 3) FINISHED False 8100 95441063 Jan. 10, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17409 ) D Palindromes Coloring PROGRAMMING binary search greedy sortings strings

B'You have a string s consisting of lowercase Latin alphabet letters. You can color some letters in colors from 1 to k . It is not necessary to paint all the letters. But for each color, there must be a letter painted in that color. Then you can swap any two symbols painted in the same color as many times as you want. After that, k strings will be created, i -th of them will contain all the characters colored in the color i , written in the order of their sequence in the string s . Your task is to color the characters of the string so that all the resulting k strings are palindromes, and the length of the shortest of these k strings is as large as possible. Read the note for the first test case of the example if you need a clarification. Recall that a string is a palindrome if it reads the same way both from left to right and from right to left. For example, the strings abacaba, cccc, z and dxd are palindromes, but the strings abab and aaabaa -- are not. The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of input data sets in the test. The descriptions of the input data sets follow. The first line of the description of each input data set contains two integers n and k ( 1 <= k <= n <= 2 cdot 10^5 ) -- the length of the string and the number of colors in which its letters can be painted. The second line of the description of each input data set contains a string s of length n consisting of lowercase letters of the Latin alphabet. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each set of input data, output a single integer -- the maximum length of the shortest palindrome string that can be obtained. Now, for each of the two colors we write out the corresponding characters from left to right, we get two strings mathtt{ mathbf{ color{red}{aba}}} and mathtt{ mat'...

Tutorials

Codeforces Round #764 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
142318062 ssvb D Jan. 11, 2022, 2:45 a.m. OK D TESTS 21 30 4198400
142314013 ruban D Jan. 11, 2022, 12:26 a.m. OK Delphi TESTS 21 92 34304000
142311228 caravan02 D Jan. 10, 2022, 10:08 p.m. OK GNU C11 TESTS 21 31 0
142296485 LJY--2002 D Jan. 10, 2022, 5:47 p.m. OK GNU C++14 TESTS 21 15 204800
142295049 forlight D Jan. 10, 2022, 5:33 p.m. OK GNU C++14 TESTS 20 15 204800
142292679 kdszyubin D Jan. 10, 2022, 5:13 p.m. OK GNU C++14 TESTS 20 15 204800
142286628 lx_xl D Jan. 10, 2022, 4:47 p.m. OK GNU C++14 TESTS 20 15 204800
142320598 1353055672 D Jan. 11, 2022, 3:40 a.m. OK GNU C++14 TESTS 21 15 204800
142315572 duoluoluo D Jan. 11, 2022, 1:33 a.m. OK GNU C++14 TESTS 21 15 204800
142327193 broly_1033 D Jan. 11, 2022, 5:26 a.m. OK GNU C++14 TESTS 21 15 512000
142329165 AbhinavBisht D Jan. 11, 2022, 5:49 a.m. OK GNU C++14 TESTS 21 15 512000
142328675 03pawan D Jan. 11, 2022, 5:43 a.m. OK GNU C++14 TESTS 21 15 512000
142328239 parth83 D Jan. 11, 2022, 5:38 a.m. OK GNU C++14 TESTS 21 15 512000
142319702 julic20s D Jan. 11, 2022, 3:22 a.m. OK GNU C++17 TESTS 21 15 0
142306494 MojoLake D Jan. 10, 2022, 8:01 p.m. OK GNU C++17 TESTS 21 15 0
142300738 Pramod.Kumar D Jan. 10, 2022, 6:36 p.m. OK GNU C++17 TESTS 21 15 0
142298851 Brownbear2710 D Jan. 10, 2022, 6:13 p.m. OK GNU C++17 TESTS 21 15 0
142294379 coris D Jan. 10, 2022, 5:26 p.m. OK GNU C++17 TESTS 20 15 0
142328364 SOWFELICITY D Jan. 11, 2022, 5:40 a.m. OK GNU C++17 TESTS 21 15 204800
142320153 gn_wz D Jan. 11, 2022, 3:31 a.m. OK GNU C++17 TESTS 21 15 204800
142316460 cdjx D Jan. 11, 2022, 2:01 a.m. OK GNU C++17 TESTS 21 15 204800
142299007 Cristian_C D Jan. 10, 2022, 6:15 p.m. OK GNU C++17 TESTS 21 15 204800
142293075 Leonard D Jan. 10, 2022, 5:16 p.m. OK GNU C++17 TESTS 20 15 204800
142307844 Mostafa_Moharram D Jan. 10, 2022, 8:30 p.m. OK GNU C++17 (64) TESTS 21 15 0
142297019 ball_of_wool D Jan. 10, 2022, 5:53 p.m. OK GNU C++17 (64) TESTS 21 15 0
142323311 JEE_MAIN_LOOSER D Jan. 11, 2022, 4:30 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142330143 Porag_2742 D Jan. 11, 2022, 5:58 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142328388 saravananjs3 D Jan. 11, 2022, 5:40 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142328250 endless_summer D Jan. 11, 2022, 5:38 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142327084 sahilgo D Jan. 11, 2022, 5:25 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142326728 sahilgo D Jan. 11, 2022, 5:21 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142325264 Rajdep_Roy D Jan. 11, 2022, 5:02 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142323721 YoungChigga D Jan. 11, 2022, 4:37 a.m. OK GNU C++17 (64) TESTS 21 15 512000
142305393 Sobzi D Jan. 10, 2022, 7:43 p.m. OK GNU C++20 (64) TESTS 21 15 0
142305833 Sobzi D Jan. 10, 2022, 7:50 p.m. OK GNU C++20 (64) TESTS 21 15 0
142290465 lowkey_yay D Jan. 10, 2022, 4:58 p.m. OK GNU C++20 (64) TESTS 20 15 102400
142321145 sanjayprajapati D Jan. 11, 2022, 3:51 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142320224 ZENGJIE D Jan. 11, 2022, 3:32 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142318711 Glydon D Jan. 11, 2022, 3 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142318306 icyPie2 D Jan. 11, 2022, 2:51 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142323926 ishwarendra D Jan. 11, 2022, 4:40 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142324871 xyz_kr D Jan. 11, 2022, 4:55 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142324676 imalok10 D Jan. 11, 2022, 4:52 a.m. OK GNU C++20 (64) TESTS 21 15 512000
142293282 1e9y D Jan. 10, 2022, 5:18 p.m. OK Go TESTS 20 61 1536000
142294881 SaberXpro D Jan. 10, 2022, 5:31 p.m. OK Java 11 TESTS 20 171 0
142286653 MubtasimShahriar D Jan. 10, 2022, 4:47 p.m. OK Java 11 TESTS 20 171 0
142293380 henrychenOutlook D Jan. 10, 2022, 5:18 p.m. OK Java 11 TESTS 20 186 0
142317750 Sandy_coder2001 D Jan. 11, 2022, 2:36 a.m. OK Java 11 TESTS 21 186 0
142291872 sauravmandal D Jan. 10, 2022, 5:07 p.m. OK Java 11 TESTS 20 186 0
142295217 LongWalk D Jan. 10, 2022, 5:35 p.m. OK Java 11 TESTS 20 187 0
142289026 singhshivsm20001 D Jan. 10, 2022, 4:51 p.m. OK Java 11 TESTS 20 187 0
142315522 ning1ing D Jan. 11, 2022, 1:31 a.m. OK Java 11 TESTS 21 187 0
142307100 MrOtter D Jan. 10, 2022, 8:14 p.m. OK Java 11 TESTS 21 187 0
142322178 yogii_123 D Jan. 11, 2022, 4:10 a.m. OK Java 11 TESTS 21 202 0
142304272 Sjoa D Jan. 10, 2022, 7:25 p.m. OK Java 8 TESTS 21 108 0
142298030 dev_14 D Jan. 10, 2022, 6:04 p.m. OK Java 8 TESTS 21 108 0
142292443 Dhruv_Gheewala D Jan. 10, 2022, 5:11 p.m. OK Java 8 TESTS 20 109 0
142322862 kasyu D Jan. 11, 2022, 4:23 a.m. OK Java 8 TESTS 21 109 0
142299395 tarun_sm D Jan. 10, 2022, 6:19 p.m. OK Java 8 TESTS 21 109 0
142295684 invincible777 D Jan. 10, 2022, 5:39 p.m. OK Java 8 TESTS 20 109 0
142286542 Gurtej D Jan. 10, 2022, 4:47 p.m. OK Java 8 TESTS 20 124 0
142321061 zxz_xmx D Jan. 11, 2022, 3:49 a.m. OK Java 8 TESTS 21 124 0
142320902 tarun_sm D Jan. 11, 2022, 3:46 a.m. OK Java 8 TESTS 21 124 0
142324227 kishan963 D Jan. 11, 2022, 4:45 a.m. OK Java 8 TESTS 21 124 5222400
142300362 MOVSES1 D Jan. 10, 2022, 6:31 p.m. OK MS C++ 2017 TESTS 21 15 204800
142329357 AmalSN D Jan. 11, 2022, 5:50 a.m. OK MS C++ 2017 TESTS 21 30 512000
142309062 MOVSES1 D Jan. 10, 2022, 8:59 p.m. OK MS C++ 2017 TESTS 21 31 204800
142300458 MOVSES1 D Jan. 10, 2022, 6:32 p.m. OK MS C++ 2017 TESTS 21 31 204800
142288216 psn2706 D Jan. 10, 2022, 4:49 p.m. OK MS C++ 2017 TESTS 20 31 716800
142288955 meowstar D Jan. 10, 2022, 4:51 p.m. OK MS C++ 2017 TESTS 20 46 409600
142324590 cmj0922 D Jan. 11, 2022, 4:51 a.m. OK MS C++ 2017 TESTS 21 46 512000
142293473 ycy0731 D Jan. 10, 2022, 5:19 p.m. OK MS C++ 2017 TESTS 20 62 204800
142292603 Nidz05 D Jan. 10, 2022, 5:12 p.m. OK .NET Core C# TESTS 20 170 3379200
142289947 1_2_3_4_5_9 D Jan. 10, 2022, 4:55 p.m. OK PyPy 2 TESTS 20 109 2048000
142302467 lemiao12 D Jan. 10, 2022, 6:58 p.m. OK PyPy 3 TESTS 21 109 3481600
142324569 DarkSparkle D Jan. 11, 2022, 4:51 a.m. OK PyPy 3 TESTS 21 109 4300800
142293417 renatxat D Jan. 10, 2022, 5:19 p.m. OK PyPy 3 TESTS 20 140 3276800
142324603 DarkSparkle D Jan. 11, 2022, 4:51 a.m. OK PyPy 3 TESTS 21 140 4300800
142318349 ambs_ D Jan. 11, 2022, 2:51 a.m. OK PyPy 3 TESTS 21 140 4915200
142301626 Malek_souissi D Jan. 10, 2022, 6:47 p.m. OK PyPy 3 TESTS 21 140 5939200
142305004 _aadiupadhyay_ D Jan. 10, 2022, 7:36 p.m. OK PyPy 3 TESTS 21 155 7475200
142318710 behindyou D Jan. 11, 2022, 3 a.m. OK PyPy 3 TESTS 21 170 8089600
142306267 vale46 D Jan. 10, 2022, 7:57 p.m. OK PyPy 3 TESTS 21 171 6553600
142318614 behindyou D Jan. 11, 2022, 2:58 a.m. OK PyPy 3 TESTS 21 171 10854400
142326647 brthyyjp D Jan. 11, 2022, 5:20 a.m. OK PyPy 3-64 TESTS 21 124 7065600
142324581 Code_Breaker101 D Jan. 11, 2022, 4:51 a.m. OK PyPy 3-64 TESTS 21 124 7987200
142318020 rivnam D Jan. 11, 2022, 2:44 a.m. OK PyPy 3-64 TESTS 21 140 7372800
142306869 fire_fist D Jan. 10, 2022, 8:09 p.m. OK PyPy 3-64 TESTS 21 155 9830400
142293330 hash1023 D Jan. 10, 2022, 5:18 p.m. OK PyPy 3-64 TESTS 20 171 4096000
142287632 VarAmu D Jan. 10, 2022, 4:48 p.m. OK PyPy 3-64 TESTS 20 186 4710400
142294578 chetanpatel003 D Jan. 10, 2022, 5:28 p.m. OK PyPy 3-64 TESTS 20 186 9318400
142291162 titan23 D Jan. 10, 2022, 5:03 p.m. OK PyPy 3-64 TESTS 20 187 5324800
142298243 aman_m42 D Jan. 10, 2022, 6:06 p.m. OK PyPy 3-64 TESTS 21 187 8294400
142286968 titan23 D Jan. 10, 2022, 4:47 p.m. OK PyPy 3-64 TESTS 20 202 5017600
142290318 OLOGY D Jan. 10, 2022, 4:57 p.m. OK Python 2 TESTS 20 109 1331200
142311138 OLOGY D Jan. 10, 2022, 10:05 p.m. OK Python 2 TESTS 21 529 22016000
142311647 OLOGY D Jan. 10, 2022, 10:25 p.m. OK Python 2 TESTS 21 529 22220800
142311376 OLOGY D Jan. 10, 2022, 10:14 p.m. OK Python 2 TESTS 21 545 22016000
142310932 OLOGY D Jan. 10, 2022, 9:57 p.m. OK Python 2 TESTS 21 560 22016000
142299494 NS3081992 D Jan. 10, 2022, 6:20 p.m. OK Python 3 TESTS 21 77 819200
142329261 aniket_03 D Jan. 11, 2022, 5:49 a.m. OK Python 3 TESTS 21 124 307200
142296124 NS3081992 D Jan. 10, 2022, 5:44 p.m. OK Python 3 TESTS 21 139 819200
142299813 ghannu D Jan. 10, 2022, 6:24 p.m. OK Python 3 TESTS 21 155 307200
142308546 kunal_135 D Jan. 10, 2022, 8:46 p.m. OK Python 3 TESTS 21 155 409600
142319880 david.alexander01 D Jan. 11, 2022, 3:25 a.m. OK Python 3 TESTS 21 155 1126400
142290530 vadlamani19100 D Jan. 10, 2022, 4:59 p.m. OK Python 3 TESTS 20 156 409600
142307601 kunal_135 D Jan. 10, 2022, 8:24 p.m. OK Python 3 TESTS 21 170 307200
142289337 AshrafSustS19 D Jan. 10, 2022, 4:53 p.m. OK Python 3 TESTS 20 171 307200
142289187 zzzzsust19 D Jan. 10, 2022, 4:52 p.m. OK Python 3 TESTS 20 171 307200

remove filters

Back to search problems