Codeforces Round 912 (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
1903 Codeforces Round 912 (Div. 2) FINISHED False 8100 30461099 Nov. 30, 2023, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 33775 ) A Halloumi Boxes PROGRAMMING brute force greedy

B"Theofanis is busy after his last contest, as now, he has to deliver many halloumis all over the world. He stored them inside n boxes and each of which has some number a_i written on it. He wants to sort them in non-decreasing order based on their number, however, his machine works in a strange way. It can only reverse any subarray ^{ dagger} of boxes with length at most k . Find if it's possible to sort the boxes using any number of reverses. ^{ dagger} Reversing a subarray means choosing two indices i and j (where 1 <= i <= j <= n ) and changing the array a_1, a_2, ldots, a_n to a_1, a_2, ldots, a_{i-1}, ; a_j, a_{j-1}, ldots, a_i, ; a_{j+1}, ldots, a_{n-1}, a_n . The length of the subarray is then j - i + 1 . The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. Each test case consists of two lines. The first line of each test case contains two integers n and k ( 1 <= k <= n <= 100 ) -- the number of boxes and the length of the maximum reverse that Theofanis can make. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^{9} ) -- the number written on each box. For each test case, print YES (case-insensitive), if the array can be sorted in non-decreasing order, or NO (case-insensitive) otherwise. In the first two test cases, the boxes are already sorted in non-decreasing order. In the third test case, we can reverse the whole array. In the fourth test case, we can reverse the first two boxes and the last two boxes. In the fifth test case, it can be shown that it's impossible to sort the boxes. "...

Tutorials

Codeforces Round #912 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
235173129 Graf_Rav A Dec. 1, 2023, 5:57 a.m. OK C# 10 TESTS 9 46 921600
235154939 sh_arman A Dec. 1, 2023, 1:30 a.m. OK C# 10 TESTS 9 77 1433600
235147517 bluemegane A Nov. 30, 2023, 10:26 p.m. OK C# 8 TESTS 9 77 716800
235166391 Shaharuk2210 A Dec. 1, 2023, 4:43 a.m. OK Clang++17 Diagnostics TESTS 9 61 0
235140894 Hakari_Kenji A Nov. 30, 2023, 8:35 p.m. OK Clang++17 Diagnostics TESTS 9 77 0
235156332 Pili_02 A Dec. 1, 2023, 2 a.m. OK Clang++17 Diagnostics TESTS 9 77 0
235154986 mailinh070205 A Dec. 1, 2023, 1:32 a.m. OK Clang++17 Diagnostics TESTS 9 78 0
235135412 NenadDapic A Nov. 30, 2023, 7:41 p.m. OK FPC TESTS 9 31 0
235142866 jhahidulzahid A Nov. 30, 2023, 8:59 p.m. OK GNU C11 TESTS 9 15 0
235167778 jyothi_2006 A Dec. 1, 2023, 5:02 a.m. OK GNU C11 TESTS 9 15 0
235142976 jhahidulzahid A Nov. 30, 2023, 9 p.m. OK GNU C11 TESTS 9 15 0
235119235 Garvit_Khedar A Nov. 30, 2023, 6:08 p.m. OK GNU C11 TESTS 9 15 0
235119934 YosephKarl A Nov. 30, 2023, 6:10 p.m. OK GNU C11 TESTS 9 15 0
235120722 21b01a05d0 A Nov. 30, 2023, 6:13 p.m. OK GNU C11 TESTS 9 15 0
235121020 Sohamgk A Nov. 30, 2023, 6:14 p.m. OK GNU C11 TESTS 9 15 0
235122223 The_Variant A Nov. 30, 2023, 6:19 p.m. OK GNU C11 TESTS 9 15 0
235124327 JANNAT2022331063 A Nov. 30, 2023, 6:27 p.m. OK GNU C11 TESTS 9 15 0
235136020 Sultan_Borhan A Nov. 30, 2023, 7:46 p.m. OK GNU C11 TESTS 9 15 0
235167404 Atomic_Zuuccini A Dec. 1, 2023, 4:58 a.m. OK GNU C++14 TESTS 9 0 0
235172835 AparnaDubey A Dec. 1, 2023, 5:55 a.m. OK GNU C++14 TESTS 9 15 0
235154531 zltzlt A Dec. 1, 2023, 1:22 a.m. OK GNU C++14 TESTS 9 15 0
235156556 Mhn_Neek A Dec. 1, 2023, 2:06 a.m. OK GNU C++14 TESTS 9 15 0
235160187 songziyan A Dec. 1, 2023, 3:10 a.m. OK GNU C++14 TESTS 9 15 0
235162012 RAW007 A Dec. 1, 2023, 3:36 a.m. OK GNU C++14 TESTS 9 15 0
235164166 alaylm A Dec. 1, 2023, 4:09 a.m. OK GNU C++14 TESTS 9 15 0
235164221 Hydrogenabc A Dec. 1, 2023, 4:10 a.m. OK GNU C++14 TESTS 9 15 0
235167052 gates_orz A Dec. 1, 2023, 4:53 a.m. OK GNU C++14 TESTS 9 15 0
235171109 leonardo_lunatic A Dec. 1, 2023, 5:39 a.m. OK GNU C++14 TESTS 9 15 0
235154800 ist.lynx A Dec. 1, 2023, 1:27 a.m. OK GNU C++17 TESTS 9 0 0
235173466 ankit1373 A Dec. 1, 2023, 6 a.m. OK GNU C++17 TESTS 9 15 0
235173278 096Puneet007 A Dec. 1, 2023, 5:58 a.m. OK GNU C++17 TESTS 9 15 0
235172863 Attack_on_ICPC_2023 A Dec. 1, 2023, 5:55 a.m. OK GNU C++17 TESTS 9 15 0
235172856 AdiK10 A Dec. 1, 2023, 5:55 a.m. OK GNU C++17 TESTS 9 15 0
235171853 bhaskar_op A Dec. 1, 2023, 5:46 a.m. OK GNU C++17 TESTS 9 15 0
235171808 Shuvo. A Dec. 1, 2023, 5:45 a.m. OK GNU C++17 TESTS 9 15 0
235170879 Bhanu0p A Dec. 1, 2023, 5:37 a.m. OK GNU C++17 TESTS 9 15 0
235170805 blow_your_mind A Dec. 1, 2023, 5:36 a.m. OK GNU C++17 TESTS 9 15 0
235169530 220229_Nahid_Hasan A Dec. 1, 2023, 5:23 a.m. OK GNU C++17 TESTS 9 15 0
235170326 nava_ma07 A Dec. 1, 2023, 5:31 a.m. OK GNU C++17 (64) TESTS 9 0 0
235165924 prithvijitbasak A Dec. 1, 2023, 4:36 a.m. OK GNU C++17 (64) TESTS 9 0 0
235164635 megalodon_hunter A Dec. 1, 2023, 4:17 a.m. OK GNU C++17 (64) TESTS 9 0 0
235159339 xingliu A Dec. 1, 2023, 2:56 a.m. OK GNU C++17 (64) TESTS 9 0 0
235156203 Cosysl A Dec. 1, 2023, 1:57 a.m. OK GNU C++17 (64) TESTS 9 0 0
235153809 Imran435 A Dec. 1, 2023, 1:06 a.m. OK GNU C++17 (64) TESTS 9 0 0
235152523 xioachou A Dec. 1, 2023, 12:36 a.m. OK GNU C++17 (64) TESTS 9 0 0
235152281 edisnimorF A Dec. 1, 2023, 12:31 a.m. OK GNU C++17 (64) TESTS 9 0 0
235152027 RockyLII A Dec. 1, 2023, 12:24 a.m. OK GNU C++17 (64) TESTS 9 0 0
235151611 huangbq198 A Dec. 1, 2023, 12:14 a.m. OK GNU C++17 (64) TESTS 9 0 0
235168044 _d.c.___ A Dec. 1, 2023, 5:06 a.m. OK GNU C++20 (64) TESTS 9 0 0
235172150 krishna.soni A Dec. 1, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 9 0 0
235171835 asr_003 A Dec. 1, 2023, 5:46 a.m. OK GNU C++20 (64) TESTS 9 0 0
235169855 Der_Vlapos A Dec. 1, 2023, 5:26 a.m. OK GNU C++20 (64) TESTS 9 0 0
235169611 agpratham7 A Dec. 1, 2023, 5:23 a.m. OK GNU C++20 (64) TESTS 9 0 0
235169375 Garretthh07 A Dec. 1, 2023, 5:21 a.m. OK GNU C++20 (64) TESTS 9 0 0
235168737 matthewrintel5 A Dec. 1, 2023, 5:13 a.m. OK GNU C++20 (64) TESTS 9 0 0
235168593 tj.taj A Dec. 1, 2023, 5:12 a.m. OK GNU C++20 (64) TESTS 9 0 0
235168182 abu_sayeed_2.0 A Dec. 1, 2023, 5:07 a.m. OK GNU C++20 (64) TESTS 9 0 0
235168157 65_67_77 A Dec. 1, 2023, 5:07 a.m. OK GNU C++20 (64) TESTS 9 0 0
235169443 Perseverance_Mukit102 A Dec. 1, 2023, 5:22 a.m. OK Java 11 TESTS 9 202 0
235163068 MariamWaelHegazy A Dec. 1, 2023, 3:52 a.m. OK Java 11 TESTS 9 202 0
235157655 ranapravesh206 A Dec. 1, 2023, 2:27 a.m. OK Java 11 TESTS 9 202 0
235161306 _not_found A Dec. 1, 2023, 3:26 a.m. OK Java 11 TESTS 9 217 0
235171791 bhargavputti A Dec. 1, 2023, 5:45 a.m. OK Java 11 TESTS 9 218 0
235166552 sparsheatu A Dec. 1, 2023, 4:45 a.m. OK Java 11 TESTS 9 218 0
235137379 nizamdheeraj A Nov. 30, 2023, 7:58 p.m. OK Java 11 TESTS 9 218 0
235124816 secret_name A Nov. 30, 2023, 6:28 p.m. OK Java 11 TESTS 9 233 0
235122083 rajat6726 A Nov. 30, 2023, 6:18 p.m. OK Java 11 TESTS 9 249 0
235117283 Sumith_17 A Nov. 30, 2023, 6:01 p.m. OK Java 11 TESTS 9 295 0
235133590 Nagendravarma A Nov. 30, 2023, 7:31 p.m. OK Java 17 TESTS 9 156 307200
235144712 aishwarykesarwani A Nov. 30, 2023, 9:27 p.m. OK Java 17 TESTS 9 171 512000
235155175 dilshar23 A Dec. 1, 2023, 1:35 a.m. OK Java 17 TESTS 9 187 409600
235146600 CutSandstone A Nov. 30, 2023, 10:04 p.m. OK Java 17 TESTS 9 187 4608000
235162278 Shinomiya21 A Dec. 1, 2023, 3:40 a.m. OK Java 17 TESTS 9 202 614400
235167321 TopCloser A Dec. 1, 2023, 4:57 a.m. OK Java 17 TESTS 9 217 204800
235115155 ganesh1a0576 A Nov. 30, 2023, 5:53 p.m. OK Java 17 TESTS 9 218 512000
235114560 21r21a05n1 A Nov. 30, 2023, 5:51 p.m. OK Java 17 TESTS 9 218 512000
235117015 protagonist74 A Nov. 30, 2023, 6 p.m. OK Java 17 TESTS 9 218 819200
235165108 prateeksama2003 A Dec. 1, 2023, 4:24 a.m. OK Java 17 TESTS 9 218 1024000
235143593 Jiraiya_Kun A Nov. 30, 2023, 9:09 p.m. OK Java 21 TESTS 9 218 102400
235122403 AyaanKhan A Nov. 30, 2023, 6:19 p.m. OK Java 21 TESTS 9 280 614400
235116359 Sravya03 A Nov. 30, 2023, 5:57 p.m. OK Java 21 TESTS 9 311 0
235136485 DBD_2003 A Nov. 30, 2023, 7:50 p.m. OK Java 21 TESTS 9 311 614400
235114615 cvk27 A Nov. 30, 2023, 5:51 p.m. OK Java 21 TESTS 9 312 204800
235117715 vindhya_01 A Nov. 30, 2023, 6:02 p.m. OK Java 21 TESTS 9 327 0
235116796 afroz_2363 A Nov. 30, 2023, 5:59 p.m. OK Java 21 TESTS 9 327 0
235150544 sary-bala A Nov. 30, 2023, 11:44 p.m. OK Java 8 TESTS 9 93 0
235165767 Sumitsingh7 A Dec. 1, 2023, 4:34 a.m. OK Java 8 TESTS 9 108 0
235121656 AhmedADly710 A Nov. 30, 2023, 6:17 p.m. OK Java 8 TESTS 9 139 0
235165177 priyaroy3370 A Dec. 1, 2023, 4:25 a.m. OK Java 8 TESTS 9 140 0
235159433 Akmaljon.08 A Dec. 1, 2023, 2:58 a.m. OK Java 8 TESTS 9 140 0
235153472 chengzijun_de_xiatian A Dec. 1, 2023, 12:59 a.m. OK Java 8 TESTS 9 140 0
235134105 Ahmedgad998 A Nov. 30, 2023, 7:33 p.m. OK Java 8 TESTS 9 140 0
235114963 Shiladitya2003 A Nov. 30, 2023, 5:53 p.m. OK Java 8 TESTS 9 155 0
235115921 Ahmad_Arjah2013 A Nov. 30, 2023, 5:56 p.m. OK Java 8 TESTS 9 171 0
235171408 Lu_Kai A Dec. 1, 2023, 5:41 a.m. OK MS C++ 2017 TESTS 9 15 0
235119459 tytsmile A Nov. 30, 2023, 6:08 p.m. OK MS C++ 2017 TESTS 9 15 0
235157654 magician_Y A Dec. 1, 2023, 2:27 a.m. OK MS C++ 2017 TESTS 9 30 0
235139629 ElBarbados A Nov. 30, 2023, 8:21 p.m. OK MS C++ 2017 TESTS 9 30 0
235170197 0606osh A Dec. 1, 2023, 5:29 a.m. OK MS C++ 2017 TESTS 9 31 0
235155221 Aneeba A Dec. 1, 2023, 1:36 a.m. OK MS C++ 2017 TESTS 9 31 0
235146481 zxcuser1 A Nov. 30, 2023, 10:01 p.m. OK MS C++ 2017 TESTS 9 31 0
235128615 DalDal A Nov. 30, 2023, 6:43 p.m. OK MS C++ 2017 TESTS 9 31 0
235120444 bhuvanvithanala A Nov. 30, 2023, 6:12 p.m. OK MS C++ 2017 TESTS 9 31 0
235114304 sid_gts A Nov. 30, 2023, 5:50 p.m. OK MS C++ 2017 TESTS 9 31 0
235145019 lebron87 A Nov. 30, 2023, 9:33 p.m. OK PyPy 3 TESTS 9 108 2355200
235120543 moshchniy558 A Nov. 30, 2023, 6:12 p.m. OK PyPy 3 TESTS 9 124 1638400
235165358 N1664 A Dec. 1, 2023, 4:28 a.m. OK PyPy 3-64 TESTS 9 61 1536000
235143195 kibr A Nov. 30, 2023, 9:03 p.m. OK PyPy 3-64 TESTS 9 61 1536000
235136398 samliu12 A Nov. 30, 2023, 7:50 p.m. OK PyPy 3-64 TESTS 9 61 1638400
235172458 nazmulasha A Dec. 1, 2023, 5:51 a.m. OK PyPy 3-64 TESTS 9 62 1638400
235172205 maitony A Dec. 1, 2023, 5:49 a.m. OK PyPy 3-64 TESTS 9 62 1638400
235137572 sadikalhanssah A Nov. 30, 2023, 8 p.m. OK PyPy 3-64 TESTS 9 62 1638400
235114743 Yeaish_Turj A Nov. 30, 2023, 5:52 p.m. OK PyPy 3-64 TESTS 9 62 1638400
235130389 sailaja99 A Nov. 30, 2023, 6:48 p.m. OK PyPy 3-64 TESTS 9 62 1740800
235157711 udayan8 A Dec. 1, 2023, 2:28 a.m. OK PyPy 3-64 TESTS 9 62 2457600
235135142 DRDIV A Nov. 30, 2023, 7:39 p.m. OK PyPy 3-64 TESTS 9 77 1536000
235118736 JAY___2 A Nov. 30, 2023, 6:06 p.m. OK Python 3 TESTS 9 31 102400
235159531 tejaspb8 A Dec. 1, 2023, 3 a.m. OK Python 3 TESTS 9 31 204800
235156071 AnOldMan A Dec. 1, 2023, 1:54 a.m. OK Python 3 TESTS 9 31 204800
235135929 EvGen1u5 A Nov. 30, 2023, 7:45 p.m. OK Python 3 TESTS 9 31 204800
235123936 hemasowmyagajula A Nov. 30, 2023, 6:25 p.m. OK Python 3 TESTS 9 31 204800
235121194 s2110676154 A Nov. 30, 2023, 6:15 p.m. OK Python 3 TESTS 9 31 204800
235119811 rahuldrp A Nov. 30, 2023, 6:10 p.m. OK Python 3 TESTS 9 31 204800
235118930 rudrasravan A Nov. 30, 2023, 6:06 p.m. OK Python 3 TESTS 9 31 204800
235118183 21b01a0519 A Nov. 30, 2023, 6:04 p.m. OK Python 3 TESTS 9 31 204800
235117257 Eren_410 A Nov. 30, 2023, 6 p.m. OK Python 3 TESTS 9 31 204800
235148422 chromate00 A Nov. 30, 2023, 10:46 p.m. OK Ruby 3 TESTS 9 389 204800
235120700 sabbirahmeds877 A Nov. 30, 2023, 6:13 p.m. OK Ruby 3 TESTS 9 389 307200
235134252 0x81 A Nov. 30, 2023, 7:34 p.m. OK Ruby 3 TESTS 9 514 819200
235137238 vstiff A Nov. 30, 2023, 7:57 p.m. OK Rust 2021 TESTS 9 15 0
235128754 _a253 A Nov. 30, 2023, 6:43 p.m. OK Rust 2021 TESTS 9 15 0

remove filters

Back to search problems