Codeforces Global Round 15

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
1552 Codeforces Global Round 15 FINISHED False 9900 110129111 July 25, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 24056 ) A Subsequence Permutation PROGRAMMING sortings strings

B'A string s of length n , consisting of lowercase letters of the English alphabet, is given. You must choose some number k between 0 and n . Then, you select k characters of s and permute them however you want. In this process, the positions of the other n-k characters remain unchanged. You have to perform this operation exactly once. For example, if s= texttt{"andrea"} , you can choose the k=4 characters texttt{"a_d_ea"} and permute them into texttt{"d_e_aa"} so that after the operation the string becomes texttt{"dneraa"} . Determine the minimum k so that it is possible to sort s alphabetically (that is, after the operation its characters appear in alphabetical order). The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains one integer n ( 1 <= n <= 40 ) -- the length of the string. The second line of each test case contains the string s . It is guaranteed that s contains only lowercase letters of the English alphabet. For each test case, output the minimum k that allows you to obtain a string sorted alphabetically, through the operation described above. In the first test case, we can choose the k=2 characters texttt{"_ol"} and rearrange them as texttt{"_lo"} (so the resulting string is texttt{"llo"} ). It is not possible to sort the string choosing strictly less than 2 characters. In the second test case, one possible way to sort s is to consider the k=6 characters texttt{"_o__force_"} and rearrange them as texttt{"_c__efoor_"} (so the resulting string is texttt{"ccdeefoors"} ). One can show that it is not possible to sort the string choosing strictly less than 6 characters. In the third test case, string s is already sorted (so we can choose $'...

Tutorials

Editorial of Global Round 15

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
123772839 kuba_422 A July 25, 2021, 6:40 p.m. OK GNU C11 TESTS 3 15 3686400
123758041 KCMsaum A July 25, 2021, 4:43 p.m. OK GNU C11 TESTS 3 15 3686400
123769430 nayeemtby A July 25, 2021, 6:01 p.m. OK GNU C11 TESTS 3 15 3686400
123770245 nayeemtby A July 25, 2021, 6:07 p.m. OK GNU C11 TESTS 3 15 3686400
123769115 Anindya0_0 A July 25, 2021, 5:59 p.m. OK GNU C11 TESTS 3 30 3686400
123790886 S.TanK A July 26, 2021, 2:48 a.m. OK GNU C++11 TESTS 3 0 3891200
123790937 alphabe A July 26, 2021, 2:49 a.m. OK GNU C++11 TESTS 3 0 3891200
123786467 AGNING A July 26, 2021, 1:02 a.m. OK GNU C++11 TESTS 3 0 3891200
123785964 zdd123 A July 26, 2021, 12:47 a.m. OK GNU C++11 TESTS 3 0 4096000
123791946 Fresca A July 26, 2021, 3:08 a.m. OK GNU C++11 TESTS 3 15 3686400
123798753 cyrxdzj A July 26, 2021, 5:20 a.m. OK GNU C++11 TESTS 3 15 3686400
123797161 airbust A July 26, 2021, 4:51 a.m. OK GNU C++11 TESTS 3 15 3891200
123796783 Konse A July 26, 2021, 4:44 a.m. OK GNU C++11 TESTS 3 15 3891200
123798947 praps1614 A July 26, 2021, 5:23 a.m. OK GNU C++11 TESTS 3 15 3891200
123798331 vjudge2 A July 26, 2021, 5:12 a.m. OK GNU C++11 TESTS 3 15 3891200
123785973 vs240 A July 26, 2021, 12:47 a.m. OK GNU C++14 TESTS 3 0 3686400
123784412 Potassium_ A July 25, 2021, 11:46 p.m. OK GNU C++14 TESTS 3 0 3686400
123787459 ashu.kum2018 A July 26, 2021, 1:31 a.m. OK GNU C++14 TESTS 3 0 3686400
123760203 Middle-Men A July 25, 2021, 4:52 p.m. OK GNU C++14 TESTS 3 0 3788800
123756724 alokknight A July 25, 2021, 4:37 p.m. OK GNU C++14 TESTS 3 0 3788800
123772269 jkp4 A July 25, 2021, 6:32 p.m. OK GNU C++14 TESTS 3 0 3788800
123788954 anmit007 A July 26, 2021, 2:06 a.m. OK GNU C++14 TESTS 3 0 3788800
123796768 hardy_9795 A July 26, 2021, 4:43 a.m. OK GNU C++14 TESTS 3 0 3891200
123800612 p.ferrari A July 26, 2021, 5:51 a.m. OK GNU C++14 TESTS 3 0 3891200
123798290 Mr_Rex A July 26, 2021, 5:12 a.m. OK GNU C++14 TESTS 3 0 3891200
123795017 adityashah247 A July 26, 2021, 4:09 a.m. OK GNU C++17 TESTS 3 0 3686400
123800145 TheLostStar A July 26, 2021, 5:43 a.m. OK GNU C++17 TESTS 3 0 3686400
123799757 sarveshtiwari24 A July 26, 2021, 5:37 a.m. OK GNU C++17 TESTS 3 0 3686400
123799489 bharath19 A July 26, 2021, 5:33 a.m. OK GNU C++17 TESTS 3 0 3686400
123797005 SajibKC_19 A July 26, 2021, 4:48 a.m. OK GNU C++17 TESTS 3 0 3686400
123795422 brjbibhu10 A July 26, 2021, 4:17 a.m. OK GNU C++17 TESTS 3 0 3686400
123793207 p1yu5h A July 26, 2021, 3:34 a.m. OK GNU C++17 TESTS 3 0 3686400
123784835 ice-code A July 26, 2021, 12:06 a.m. OK GNU C++17 TESTS 3 0 3686400
123776098 Xx__Sparrow__xX A July 25, 2021, 7:37 p.m. OK GNU C++17 TESTS 3 0 3686400
123775857 ujjwalsingh30 A July 25, 2021, 7:32 p.m. OK GNU C++17 TESTS 3 0 3686400
123770511 marksman_ A July 25, 2021, 6:10 p.m. OK GNU C++17 (64) TESTS 3 0 4300800
123769978 Bu1bu1 A July 25, 2021, 6:05 p.m. OK GNU C++17 (64) TESTS 3 0 4300800
123764910 sadman_the_code_hunter A July 25, 2021, 5:12 p.m. OK GNU C++17 (64) TESTS 3 0 4300800
123771087 ScarletS A July 25, 2021, 6:17 p.m. OK GNU C++17 (64) TESTS 3 0 4300800
123788194 bmu A July 26, 2021, 1:49 a.m. OK GNU C++17 (64) TESTS 3 0 4300800
123791255 mayurpokharkar6 A July 26, 2021, 2:55 a.m. OK GNU C++17 (64) TESTS 3 0 4300800
123796241 tush_chen A July 26, 2021, 4:33 a.m. OK GNU C++17 (64) TESTS 3 0 4300800
123799842 Mystery1111 A July 26, 2021, 5:39 a.m. OK GNU C++17 (64) TESTS 3 0 4300800
123799534 AngelP A July 26, 2021, 5:33 a.m. OK GNU C++17 (64) TESTS 3 15 4300800
123801046 arnav2004 A July 26, 2021, 5:57 a.m. OK GNU C++17 (64) TESTS 3 15 4300800
123773635 zed_22 A July 25, 2021, 6:53 p.m. OK Go TESTS 3 15 10649600
123797099 Erasylll A July 26, 2021, 4:50 a.m. OK Java 11 TESTS 3 155 23859200
123779723 FLORINNN A July 25, 2021, 9 p.m. OK Java 11 TESTS 3 171 23859200
123797091 SaberXpro A July 26, 2021, 4:50 a.m. OK Java 11 TESTS 3 171 23859200
123791958 b2jena A July 26, 2021, 3:09 a.m. OK Java 11 TESTS 3 171 43929600
123771116 decoder_1671 A July 25, 2021, 6:17 p.m. OK Java 11 TESTS 3 186 35225600
123794834 Sanju_250406 A July 26, 2021, 4:06 a.m. OK Java 11 TESTS 3 187 23756800
123770606 eyangch A July 25, 2021, 6:11 p.m. OK Java 11 TESTS 3 187 23756800
123799781 krishnam_omar A July 26, 2021, 5:38 a.m. OK Java 11 TESTS 3 202 23859200
123775511 KK201431873 A July 25, 2021, 7:26 p.m. OK Java 11 TESTS 3 202 23859200
123795253 deepu1877 A July 26, 2021, 4:14 a.m. OK Java 11 TESTS 3 202 24576000
123799958 SurpriseMe A July 26, 2021, 5:40 a.m. OK Java 8 TESTS 3 92 32460800
123796872 manan29 A July 26, 2021, 4:46 a.m. OK Java 8 TESTS 3 93 20480000
123799251 harsh_03_m A July 26, 2021, 5:29 a.m. OK Java 8 TESTS 3 108 20684800
123778637 tishrah_ A July 25, 2021, 8:32 p.m. OK Java 8 TESTS 3 108 20684800
123787875 edenSpace A July 26, 2021, 1:41 a.m. OK Java 8 TESTS 3 108 20787200
123771608 abhinavTalesra A July 25, 2021, 6:23 p.m. OK Java 8 TESTS 3 108 20787200
123776855 Shemo A July 25, 2021, 7:52 p.m. OK Java 8 TESTS 3 109 20787200
123793908 Dcoder123 A July 26, 2021, 3:48 a.m. OK Java 8 TESTS 3 124 20787200
123784149 bookguy A July 25, 2021, 11:35 p.m. OK Java 8 TESTS 3 124 21196800
123769457 vikash_27 A July 25, 2021, 6:01 p.m. OK Java 8 TESTS 3 139 21196800
123788464 zhiyuna A July 26, 2021, 1:55 a.m. OK MS C++ 2017 TESTS 3 15 3788800
123783039 ColobocCodeforces A July 25, 2021, 10:47 p.m. OK MS C++ 2017 TESTS 3 15 3788800
123762220 codmacian A July 25, 2021, 5:01 p.m. OK MS C++ 2017 TESTS 3 15 3788800
123760792 LampIsVegetable A July 25, 2021, 4:55 p.m. OK MS C++ 2017 TESTS 3 15 3788800
123785700 zhangpangpang A July 26, 2021, 12:38 a.m. OK MS C++ 2017 TESTS 3 15 5734400
123785903 Xiaomostream A July 26, 2021, 12:45 a.m. OK MS C++ 2017 TESTS 3 31 3686400
123786387 202014930113 A July 26, 2021, 1 a.m. OK MS C++ 2017 TESTS 3 31 3788800
123779074 gleb32 A July 25, 2021, 8:43 p.m. OK MS C++ 2017 TESTS 3 31 3788800
123776941 Vitazzz A July 25, 2021, 7:54 p.m. OK MS C++ 2017 TESTS 3 31 3788800
123772749 Tangerine A July 25, 2021, 6:38 p.m. OK MS C++ 2017 TESTS 3 31 3788800
123756050 hhsproclub A July 25, 2021, 4:34 p.m. OK Node.js TESTS 3 78 14131200
123758048 Janer A July 25, 2021, 4:43 p.m. OK PascalABC.NET TESTS 3 171 23552000
123799841 cyberkid05 A July 26, 2021, 5:39 a.m. OK PyPy 2 TESTS 3 62 23756800
123792666 Huntersoulz A July 26, 2021, 3:24 a.m. OK PyPy 3 TESTS 3 92 22528000
123800659 piSquared A July 26, 2021, 5:51 a.m. OK PyPy 3 TESTS 3 109 22528000
123777754 armsusman A July 25, 2021, 8:11 p.m. OK PyPy 3 TESTS 3 109 22528000
123769175 1_2_3_4_5_9 A July 25, 2021, 5:59 p.m. OK PyPy 3 TESTS 3 124 22118400
123794424 Siddharth_Mehta1311 A July 26, 2021, 3:58 a.m. OK PyPy 3 TESTS 3 124 22528000
123780038 thhsu A July 25, 2021, 9:09 p.m. OK PyPy 3 TESTS 3 139 22630400
123797423 jacksparrow_9604 A July 26, 2021, 4:56 a.m. OK PyPy 3 TESTS 3 140 25190400
123785112 Devansh1309 A July 26, 2021, 12:18 a.m. OK PyPy 3 TESTS 3 155 22732800
123779314 Inferno2332 A July 25, 2021, 8:48 p.m. OK PyPy 3 TESTS 3 155 24985600
123759208 poornaTheja A July 25, 2021, 4:48 p.m. OK PyPy 3 TESTS 3 155 24985600
123776828 belkka A July 25, 2021, 7:51 p.m. OK Python 3 TESTS 3 46 6758400
123754893 PratibhaSharma A July 25, 2021, 4:30 p.m. OK Python 3 TESTS 3 46 6758400
123788074 M0u1ea5 A July 26, 2021, 1:46 a.m. OK Python 3 TESTS 3 46 6963200
123778017 radoan.sharkar.richi A July 25, 2021, 8:18 p.m. OK Python 3 TESTS 3 46 7168000
123790072 ravi_RAVI-123 A July 26, 2021, 2:32 a.m. OK Python 3 TESTS 3 61 6656000
123788092 ravi_RAVI-123 A July 26, 2021, 1:46 a.m. OK Python 3 TESTS 3 61 6656000
123753827 Imron A July 25, 2021, 4:25 p.m. OK Python 3 TESTS 3 61 6656000
123775970 andr14142 A July 25, 2021, 7:34 p.m. OK Python 3 TESTS 3 61 6758400
123800389 sergeantsnape A July 26, 2021, 5:47 a.m. OK Python 3 TESTS 3 61 6963200
123778303 arthiccc A July 25, 2021, 8:24 p.m. OK Python 3 TESTS 3 61 6963200
123793215 satylogin A July 26, 2021, 3:34 a.m. OK Rust TESTS 3 15 3788800
123758952 schizoitty A July 25, 2021, 4:47 p.m. OK Rust TESTS 3 30 3788800
123790970 wackloner A July 26, 2021, 2:49 a.m. OK Scala TESTS 3 514 39628800

remove filters

Back to search problems