Codeforces Round 1070 (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
2176 Codeforces Round 1070 (Div. 2) FINISHED False 7200 10941923 Dec. 11, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 28855 ) A Operations with Inversions PROGRAMMING data structures greedy implementation

Given an array (a_1, a_2, \ldots, a_n). In one operation, you can choose a pair of indices (i, j) such that (1 \le i < j \le n), (a_i > a_j), and remove the element at index (j) from the array. After that, the size of the array will decrease by (1), and the relative order of the elements will not change. Determine the maximum number of operations that can be performed on the array if they are applied optimally. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 50)). The description of the test cases follows. The first line of each test case contains an integer (n) ((1 \le n \le 100)) — the size of the initial array. The second line of each test case contains (n) natural numbers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le n)). For each test case, output the maximum number of operations that you can perform on the given array. In the first example, we can first choose the pair (i = 2), (j = 3) with values (a_2 = 2), (a_3 = 1) and remove (a_3). The resulting array will be (a = 3, 2). After that, we can remove the second element by choosing the pair (i = 1), (j = 2). The total number of operations is (2). In the second, third, and fifth examples, no operations can be performed since there are no suitable pairs. In the fourth example, we can remove the second and fifth elements. It can be shown that this is the optimal answer and there is no solution that removes more elements.

Tutorials

Codeforces Round 1070 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
353115803 Abdalhade A Dec. 11, 2025, 7:55 p.m. OK C++17 (GCC 7-32) TESTS 4 0 0
353148835 zxzsbd A Dec. 12, 2025, 6:11 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353148764 Deepak8_08 A Dec. 12, 2025, 6:10 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353148722 R_08_1 A Dec. 12, 2025, 6:10 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353148082 vasireddyvenu A Dec. 12, 2025, 6:03 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353147989 amansinghrawat12 A Dec. 12, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353146789 Gautam.27 A Dec. 12, 2025, 5:49 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353145994 AkshatRaj1707 A Dec. 12, 2025, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353145837 abhishek9670 A Dec. 12, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353144866 utk_09 A Dec. 12, 2025, 5:27 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
353147595 kil_ogram A Dec. 12, 2025, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353145863 ps0111 A Dec. 12, 2025, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353145717 jppatel_2005 A Dec. 12, 2025, 5:37 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353144956 Murthy_Manideep A Dec. 12, 2025, 5:29 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353144681 Ovi_07 A Dec. 12, 2025, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353143592 emanuel.dismasi A Dec. 12, 2025, 5:23 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353142531 samyukta A Dec. 12, 2025, 5:12 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353142485 Varshith_reddy A Dec. 12, 2025, 5:11 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353141055 Tangentchess_22 A Dec. 12, 2025, 4:54 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353138772 nateshpict A Dec. 12, 2025, 4:25 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
353134745 Animesh08 A Dec. 12, 2025, 3:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 0 0
353098532 darkDeveloper_228 A Dec. 11, 2025, 5:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 0 0
353148660 KitsiosEv A Dec. 12, 2025, 6:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353148624 sahil_beck A Dec. 12, 2025, 6:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353147996 bitset A Dec. 12, 2025, 6:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353147888 Feliks_Zem A Dec. 12, 2025, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353146210 kar_theeke A Dec. 12, 2025, 5:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353145201 F112 A Dec. 12, 2025, 5:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353145096 vs358 A Dec. 12, 2025, 5:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353144997 bera_474 A Dec. 12, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
353111441 zerojanuary A Dec. 11, 2025, 7:09 p.m. OK GNU C11 TESTS 4 0 0
353093075 yuvraj99989 A Dec. 11, 2025, 4:34 p.m. OK GNU C11 TESTS 4 0 0
353091609 cpr_123 A Dec. 11, 2025, 4:32 p.m. OK GNU C11 TESTS 4 0 819200
353148681 Fardinkhanfahmi A Dec. 12, 2025, 6:09 a.m. OK GNU C11 TESTS 4 15 0
353147087 Sakib65 A Dec. 12, 2025, 5:52 a.m. OK GNU C11 TESTS 4 15 0
353147029 Saicharan_1234 A Dec. 12, 2025, 5:51 a.m. OK GNU C11 TESTS 4 15 0
353136801 tharun.rm25 A Dec. 12, 2025, 3:55 a.m. OK GNU C11 TESTS 4 15 0
353136689 Krishiv23 A Dec. 12, 2025, 3:53 a.m. OK GNU C11 TESTS 4 15 0
353129608 MPatil A Dec. 12, 2025, 1:08 a.m. OK GNU C11 TESTS 4 15 0
353128216 apazv A Dec. 12, 2025, 12:19 a.m. OK GNU C11 TESTS 4 15 0
353120596 dellmonitor A Dec. 11, 2025, 9 p.m. OK Go TESTS 4 31 204800
353119454 bailimice A Dec. 11, 2025, 8:42 p.m. OK Go TESTS 4 46 0
353138649 shanmukhanaadh A Dec. 12, 2025, 4:23 a.m. OK Java 21 TESTS 4 140 921600
353109136 Ayushman01 A Dec. 11, 2025, 6:48 p.m. OK Java 21 TESTS 4 156 0
353088067 yashhkadam A Dec. 11, 2025, 4:24 p.m. OK Java 21 TESTS 4 156 409600
353131989 Sagar_TH_81 A Dec. 12, 2025, 2:17 a.m. OK Java 21 TESTS 4 156 716800
353138446 prajinkumar2020 A Dec. 12, 2025, 4:20 a.m. OK Java 21 TESTS 4 171 512000
353143003 ...uni A Dec. 12, 2025, 5:17 a.m. OK Java 21 TESTS 4 187 0
353108337 Ayushman01 A Dec. 11, 2025, 6:42 p.m. OK Java 21 TESTS 4 187 0
353101356 rahulraman2603 A Dec. 11, 2025, 5:53 p.m. OK Java 21 TESTS 4 187 0
353085246 techrishabhgaur007 A Dec. 11, 2025, 4:18 p.m. OK Java 21 TESTS 4 187 102400
353119607 Avid.Angler A Dec. 11, 2025, 8:44 p.m. OK Java 21 TESTS 4 187 204800
353146263 code2code A Dec. 12, 2025, 5:43 a.m. OK Java 8 TESTS 4 78 0
353119871 akki_code A Dec. 11, 2025, 8:48 p.m. OK Java 8 TESTS 4 78 0
353118478 prottoy701 A Dec. 11, 2025, 8:28 p.m. OK Java 8 TESTS 4 93 0
353102480 yashbansal99 A Dec. 11, 2025, 6 p.m. OK Java 8 TESTS 4 93 0
353088059 AnkushSil A Dec. 11, 2025, 4:24 p.m. OK Java 8 TESTS 4 93 0
353098643 Abhinav1232 A Dec. 11, 2025, 5:38 p.m. OK Java 8 TESTS 4 109 0
353082922 prayukthikaprasadsatla A Dec. 11, 2025, 4:13 p.m. OK Java 8 TESTS 4 109 0
353114873 srikanthk A Dec. 11, 2025, 7:44 p.m. OK Java 8 TESTS 4 125 0
353111444 Ishaan__23 A Dec. 11, 2025, 7:09 p.m. OK Java 8 TESTS 4 125 0
353091604 jms_luck A Dec. 11, 2025, 4:32 p.m. OK Java 8 TESTS 4 140 0
353127944 hungchi17 A Dec. 12, 2025, 12:08 a.m. OK Kotlin 2.2 TESTS 4 78 0
353124942 ToYoNiX A Dec. 11, 2025, 10:28 p.m. OK Node.js TESTS 4 62 1331200
353125418 ToYoNiX A Dec. 11, 2025, 10:42 p.m. OK Node.js TESTS 4 78 0
353117151 krxshh A Dec. 11, 2025, 8:11 p.m. OK PyPy 3 TESTS 4 78 1433600
353086202 SalicylicAcid A Dec. 11, 2025, 4:20 p.m. OK PyPy 3 TESTS 4 93 1843200
353113325 tekka_ity A Dec. 11, 2025, 7:27 p.m. OK PyPy 3 TESTS 4 93 2048000
353110225 shivangkeshri3 A Dec. 11, 2025, 6:58 p.m. OK PyPy 3 TESTS 4 109 1536000
353148710 GatikSolanki13 A Dec. 12, 2025, 6:10 a.m. OK PyPy 3-64 TESTS 4 46 1433600
353142448 isanz A Dec. 12, 2025, 5:11 a.m. OK PyPy 3-64 TESTS 4 46 1433600
353137791 SirMrGuy A Dec. 12, 2025, 4:11 a.m. OK PyPy 3-64 TESTS 4 46 1433600
353135070 tsonic A Dec. 12, 2025, 3:23 a.m. OK PyPy 3-64 TESTS 4 46 1433600
353129998 SsyHow A Dec. 12, 2025, 1:21 a.m. OK PyPy 3-64 TESTS 4 46 1433600
353110012 learnerdaily5 A Dec. 11, 2025, 6:56 p.m. OK PyPy 3-64 TESTS 4 46 1433600
353106073 Jai_singh_2004 A Dec. 11, 2025, 6:24 p.m. OK PyPy 3-64 TESTS 4 46 1433600
353104043 aryanbedwal07 A Dec. 11, 2025, 6:10 p.m. OK PyPy 3-64 TESTS 4 46 1433600
353099053 ritammishra2007 A Dec. 11, 2025, 5:40 p.m. OK PyPy 3-64 TESTS 4 46 1433600
353092250 RRR7 A Dec. 11, 2025, 4:33 p.m. OK PyPy 3-64 TESTS 4 46 1433600
353110882 vedjaw A Dec. 11, 2025, 7:04 p.m. OK Python 2 TESTS 4 46 0
353135946 _rishitraj A Dec. 12, 2025, 3:40 a.m. OK Python 3 TESTS 4 31 0
353132870 Sin_R0str0 A Dec. 12, 2025, 2:38 a.m. OK Python 3 TESTS 4 31 0
353118535 aazimjonov569 A Dec. 11, 2025, 8:29 p.m. OK Python 3 TESTS 4 31 0
353090333 celestial_ash A Dec. 11, 2025, 4:29 p.m. OK Python 3 TESTS 4 31 0
353085938 ninzasoni A Dec. 11, 2025, 4:20 p.m. OK Python 3 TESTS 4 31 0
353082958 klu_2300031957 A Dec. 11, 2025, 4:13 p.m. OK Python 3 TESTS 4 31 102400
353146441 palak1904 A Dec. 12, 2025, 5:45 a.m. OK Python 3 TESTS 4 46 0
353136066 WickedCipher A Dec. 12, 2025, 3:42 a.m. OK Python 3 TESTS 4 46 0
353124584 abobibius6 A Dec. 11, 2025, 10:17 p.m. OK Python 3 TESTS 4 46 0
353120436 neelkamalkumar230 A Dec. 11, 2025, 8:58 p.m. OK Python 3 TESTS 4 46 0
353122891 djangoC A Dec. 11, 2025, 9:40 p.m. OK Rust 2024 TESTS 4 15 0

remove filters

Back to search problems