Codeforces Round 1101 (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
2232 Codeforces Round 1101 (Div. 2) FINISHED False 7200 2129131 May 30, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 7915 ) C2 Seating Arrangement (Hard Version) PROGRAMMING binary search greedy ternary search two pointers

This is the Hard version of the problem. The difference between the versions is that in this version, the constraints on (n), (x), (s), (t) are larger. You can hack only if you solved all versions of this problem. Alice's friends have come to the party, and now they are lining up to enter the party. There are (x) tables at the party with (s) seats each. Each seat can only hold one person. Each friend has one of these three following personalities: Introverts ( I ) who have to sit at an empty table Extroverts ( E ) who have to sit at a non-empty table Ambiverts ( A ) who can sit at any table. Initially, every seat is empty. However, because Alice was eating cakes, her friends had already formed a line, which Alice cannot change their order. For each person in the line, Alice has to assign them a table or kick them out of the party. Each person is seated before the next person is assigned a table. Wanting to have a lot of fun at the party, Alice needs to seat as many people as she can at the party. Help her find the maximum number of friends she can have at the party. Note that once a friend is seated, they are not allowed to move even if they are not seated according to their personality anymore. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains three integers (n), (x), and (s) ((1 \le n,x,s \le 2\cdot 10^5)) – the number of Alice's friends, the number of tables, and the number of seats per table. The second line contains a string (u) of length (n) consisting only of the letters A , E , and I , representing an ambivert, extrovert, and introvert respectively. It is guaranteed that the sum of (n) for all test cases is at most (2 \cdot 10^5). For each test case, output an integer: the maximum number of people seated. In the first test case, there are

Tutorials

Codeforces Round 1101 (Div. 2) — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
376698515 Misha001_10 C2 May 30, 2026, 4:27 p.m. OK C# 13 TESTS 20 78 14745600
376689960 ok12 C2 May 30, 2026, 4:08 p.m. OK C# 13 TESTS 20 93 14540800
376710955 GotuZeno C2 May 30, 2026, 6:29 p.m. OK C# 13 TESTS 20 156 15462400
376739560 Marauder-Sirius-Fox C2 May 31, 2026, 4:50 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376737963 Rishi1240 C2 May 31, 2026, 4:22 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376732740 noob1_01 C2 May 31, 2026, 2:59 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376724845 _fabio C2 May 30, 2026, 10:40 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376706161 AbDhrubo C2 May 30, 2026, 5:41 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376696804 _spider__ C2 May 30, 2026, 4:23 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376696684 Saj17 C2 May 30, 2026, 4:23 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376696320 abhishekver12 C2 May 30, 2026, 4:22 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376693617 The_Parzival C2 May 30, 2026, 4:16 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376693337 snehith_budde C2 May 30, 2026, 4:16 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
376740206 teji_p C2 May 31, 2026, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376735457 Incognian C2 May 31, 2026, 3:54 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376734683 pratyush_9 C2 May 31, 2026, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376732403 Seriously_Its_Sameer C2 May 31, 2026, 2:54 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376731157 Ruizhu C2 May 31, 2026, 2:25 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376730396 lwhNanaya C2 May 31, 2026, 2:08 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376729368 xiachi C2 May 31, 2026, 1:43 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376728770 E49869826 C2 May 31, 2026, 1:23 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376728157 fastsolving C2 May 31, 2026, 12:59 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376728046 ducminh2004pd C2 May 31, 2026, 12:55 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
376742073 puru_2.0 C2 May 31, 2026, 5:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376741169 manoJaat_3003 C2 May 31, 2026, 5:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376740788 4yeo C2 May 31, 2026, 5:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376740541 YoiZ C2 May 31, 2026, 5:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376739947 Abhay_Singh_Rajawat C2 May 31, 2026, 4:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376739882 Arase C2 May 31, 2026, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376739792 Chari0t C2 May 31, 2026, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376739093 6434554613 C2 May 31, 2026, 4:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376738874 HuTao C2 May 31, 2026, 4:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376738363 akshayshekhawat7773 C2 May 31, 2026, 4:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
376699961 nwaliyevwe C2 May 30, 2026, 4:30 p.m. OK GNU C11 TESTS 20 31 102400
376694587 rdcrishiag C2 May 30, 2026, 4:18 p.m. OK GNU C11 TESTS 20 109 14643200
376731571 oishiki22 C2 May 31, 2026, 2:36 a.m. OK Java 21 TESTS 20 203 204800
376725892 CodingLagg C2 May 30, 2026, 11:22 p.m. OK Java 21 TESTS 20 203 614400
376722218 Subham_TLE C2 May 30, 2026, 9:22 p.m. OK Java 21 TESTS 20 203 1126400
376693829 rachamallaadithya C2 May 30, 2026, 4:17 p.m. OK Java 21 TESTS 20 218 512000
376718932 sagbis C2 May 30, 2026, 8:15 p.m. OK Java 21 TESTS 20 218 614400
376698760 DevShrevan7 C2 May 30, 2026, 4:27 p.m. OK Java 21 TESTS 20 234 512000
376691381 sunaj C2 May 30, 2026, 4:11 p.m. OK Java 21 TESTS 20 234 614400
376690641 Vajpayee123 C2 May 30, 2026, 4:09 p.m. OK Java 21 TESTS 20 234 1228800
376735491 sathwikhbhat C2 May 31, 2026, 3:55 a.m. OK Java 21 TESTS 20 234 1536000
376691799 Kh0909 C2 May 30, 2026, 4:12 p.m. OK Java 21 TESTS 20 234 1536000
376731198 sourabhrathore C2 May 31, 2026, 2:26 a.m. OK Java 8 TESTS 20 109 0
376706111 kamranm C2 May 30, 2026, 5:40 p.m. OK Java 8 TESTS 20 140 108748800
376690402 ACE243153 C2 May 30, 2026, 4:09 p.m. OK Java 8 TESTS 20 187 0
376714234 TheJavaGuy C2 May 30, 2026, 7:02 p.m. OK Java 8 TESTS 20 218 0
376698145 SuryaPrakashMC C2 May 30, 2026, 4:26 p.m. OK PyPy 3 TESTS 20 171 7987200
376715832 Akshatgupta069_069 C2 May 30, 2026, 7:25 p.m. OK PyPy 3 TESTS 20 218 7577600
376731723 rafaelguasselli C2 May 31, 2026, 2:39 a.m. OK PyPy 3 TESTS 20 296 7270400
376691047 pradeep_s_28 C2 May 30, 2026, 4:10 p.m. OK PyPy 3 TESTS 20 1875 68403200
376699003 ThePrince2912 C2 May 30, 2026, 4:28 p.m. OK PyPy 3-64 TESTS 20 78 2457600
376745111 dev_roast99 C2 May 31, 2026, 6:06 a.m. OK PyPy 3-64 TESTS 20 78 2560000
376691451 The_Chinese_Guy C2 May 30, 2026, 4:11 p.m. OK PyPy 3-64 TESTS 20 78 2969600
376693813 eggoil166 C2 May 30, 2026, 4:17 p.m. OK PyPy 3-64 TESTS 20 93 2355200
376691540 ABHI070707 C2 May 30, 2026, 4:11 p.m. OK PyPy 3-64 TESTS 20 93 2457600
376697944 kazukun1311 C2 May 30, 2026, 4:25 p.m. OK PyPy 3-64 TESTS 20 93 2662400
376714895 VGCos C2 May 30, 2026, 7:12 p.m. OK PyPy 3-64 TESTS 20 93 2764800
376689634 Theoreticalminima C2 May 30, 2026, 4:07 p.m. OK PyPy 3-64 TESTS 20 93 2764800
376692987 MoltenMan6 C2 May 30, 2026, 4:15 p.m. OK PyPy 3-64 TESTS 20 93 3072000
376744064 TheAppleTree C2 May 31, 2026, 5:53 a.m. OK PyPy 3-64 TESTS 20 93 3379200
376699955 rishi_reddyyy C2 May 30, 2026, 4:30 p.m. OK Python 2 TESTS 20 109 102400
376734912 bdv C2 May 31, 2026, 3:43 a.m. OK Python 3 TESTS 20 78 5836800
376695590 random682 C2 May 30, 2026, 4:21 p.m. OK Python 3 TESTS 20 109 716800
376696366 twngzxc C2 May 30, 2026, 4:22 p.m. OK Python 3 TESTS 20 109 819200
376699987 amod_24 C2 May 30, 2026, 4:30 p.m. OK Python 3 TESTS 20 109 6553600
376718585 ayush_092005 C2 May 30, 2026, 8:09 p.m. OK Python 3 TESTS 20 140 819200
376709813 Midhilesh C2 May 30, 2026, 6:18 p.m. OK Python 3 TESTS 20 140 7987200
376721497 VinitChoubey C2 May 30, 2026, 9:07 p.m. OK Python 3 TESTS 20 156 1945600
376692444 hakansabol C2 May 30, 2026, 4:13 p.m. OK Rust 2024 TESTS 20 31 0
376689938 Arlan007 C2 May 30, 2026, 4:08 p.m. OK Rust 2024 TESTS 20 31 11776000
376730840 Tantellam C2 May 31, 2026, 2:18 a.m. OK Rust 2024 TESTS 20 46 11776000

remove filters

Back to search problems