Codeforces Round 1098 (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
2228 Codeforces Round 1098 (Div. 2) FINISHED False 8100 1437887 May 16, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 19067 ) A Marisa Steals Reimu's Takeout PROGRAMMING greedy implementation

Marisa is a girl of integrity who always helps others safeguard their belongings. Over a period of (n) days, she comes each day to take one of Reimu's takeouts. The (i)-th takeout is described by its deliciousness value — an integer (w_i) ((0\le w_i\le 2)), forming a sequence (w) of length (n). Marisa has a special fondness for the number (3). She can perform the following operation zero or more times: Select a non-empty subsequence(^{\text{∗}}) of (w) whose sum is divisible by (3), and remove the elements of the subsequence from (w). Determine the maximum number of operations Marisa can perform. (^{\text{∗}})A sequence (a) is a subsequence of a sequence (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) element from arbitrary positions. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1\le n \le 100)). The second line contains (n) integers (w_1, w_2, \ldots, w_n) ((0\leq w_i \leq 2)), denoting the deliciousness values of the takeouts. For each test case, output the maximum number of operations Marisa can perform. In the first test case, Marisa can perform four operations: ()\underline{0},0,0,0\to\underline{0},0,0\to\underline{0},0\to\underline{0}\to [].() In the second test case, Marisa can perform two operations: ()\underline{1},\underline{2},0- \gt \underline{0}- \gt [].() In the third test case, Marisa can perform two operations: ()\underline{1},2,1,\underline{2},1- \gt \underline{2},1,\underline{1}- \gt 1.()

Tutorials

Codeforces Round 1098 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
374904847 motto44 A May 17, 2026, 6:06 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374902409 onearth A May 17, 2026, 5:43 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374901995 voidblade A May 17, 2026, 5:39 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374901936 Kashyap_Saniyara_33 A May 17, 2026, 5:39 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374899168 _Yeagerists_ A May 17, 2026, 5:10 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374898052 Kingas6 A May 17, 2026, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374895936 lakshya072008 A May 17, 2026, 4:33 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374882064 Dwz123456789 A May 17, 2026, 12:39 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374877204 TheStubborn A May 16, 2026, 10:04 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374875690 fsenekal A May 16, 2026, 9:30 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
374897388 GreedySuhan11 A May 17, 2026, 4:50 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374896474 ompol23 A May 17, 2026, 4:40 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374888457 Alaa_M_G habibag478 A May 17, 2026, 3:18 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374875498 Pastori A May 16, 2026, 9:26 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374873046 shivamrana0309 A May 16, 2026, 8:41 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374873000 Shoyo_7681 A May 16, 2026, 8:40 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374865937 Lily_ A May 16, 2026, 7:14 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374864889 Karthikeyab07 A May 16, 2026, 7:05 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374849284 parveenohlanjaat A May 16, 2026, 4:39 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
374870900 iashraful A May 16, 2026, 8:09 p.m. OK C++20 (GCC 13-64) TESTS 4 15 102400
374880243 Sandra A May 16, 2026, 11:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 0 0
374903953 ujjawal_11 A May 17, 2026, 5:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374902253 sarlevoyy506 A May 17, 2026, 5:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374902093 ExitCode1337 A May 17, 2026, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374900236 pushkarparakh A May 17, 2026, 5:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374899720 giabao8a70409042008 A May 17, 2026, 5:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374899050 haleholipruthvi A May 17, 2026, 5:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374898645 hyieman_ A May 17, 2026, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374898379 M_41_M A May 17, 2026, 5:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374894380 n.sharma05 A May 17, 2026, 4:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
374882148 HongTuiQingQian A May 17, 2026, 12:43 a.m. OK GNU C11 TESTS 4 15 0
374870082 Xenos_Ahnaf A May 16, 2026, 7:57 p.m. OK GNU C11 TESTS 4 15 0
374889719 ShlokHShah A May 17, 2026, 3:38 a.m. OK GNU C11 TESTS 4 31 0
374902530 anasmita A May 17, 2026, 5:45 a.m. OK GNU C11 TESTS 4 31 102400
374904095 pracLog A May 17, 2026, 5:59 a.m. OK Go TESTS 4 31 1433600
374867089 tilak.raj94 A May 16, 2026, 7:23 p.m. OK Go TESTS 4 46 1638400
374865671 madhu.korada131 A May 16, 2026, 7:11 p.m. OK Java 21 TESTS 4 140 614400
374900651 Ayush_Chauhan025 A May 17, 2026, 5:25 a.m. OK Java 21 TESTS 4 171 716800
374894983 Aswin_V A May 17, 2026, 4:20 a.m. OK Java 21 TESTS 4 171 1126400
374878638 wg2401 A May 16, 2026, 10:46 p.m. OK Java 21 TESTS 4 187 0
374883129 AruneswarReddy A May 17, 2026, 1:30 a.m. OK Java 21 TESTS 4 187 1126400
374889523 OR-222 A May 17, 2026, 3:35 a.m. OK Java 21 TESTS 4 187 1433600
374868439 liomsv A May 16, 2026, 7:37 p.m. OK Java 21 TESTS 4 203 204800
374849413 Nandhana_23 A May 16, 2026, 4:39 p.m. OK Java 21 TESTS 4 203 204800
374901684 anasamgireesh A May 17, 2026, 5:36 a.m. OK Java 21 TESTS 4 203 1331200
374897651 sitaramSahu A May 17, 2026, 4:53 a.m. OK Java 21 TESTS 4 203 1331200
374868078 Jawdat8 A May 16, 2026, 7:32 p.m. OK Java 8 TESTS 4 93 0
374890112 ajinkya222 A May 17, 2026, 3:44 a.m. OK Java 8 TESTS 4 140 0
374895403 chaitudec2005 A May 17, 2026, 4:26 a.m. OK Java 8 TESTS 4 156 0
374870644 harsh08 A May 16, 2026, 8:05 p.m. OK Java 8 TESTS 4 156 0
374870929 Rovsen A May 16, 2026, 8:09 p.m. OK Java 8 TESTS 4 171 0
374899344 eigen_loop A May 17, 2026, 5:12 a.m. OK PyPy 3 TESTS 4 78 1536000
374902746 itscris7777777 A May 17, 2026, 5:47 a.m. OK PyPy 3 TESTS 4 109 2457600
374868757 MadhavK2007 A May 16, 2026, 7:41 p.m. OK PyPy 3 TESTS 4 109 2457600
374900472 char_zero A May 17, 2026, 5:23 a.m. OK PyPy 3-64 TESTS 4 46 2150400
374872350 OAY71011 A May 16, 2026, 8:30 p.m. OK PyPy 3-64 TESTS 4 46 2252800
374895229 practiceady A May 17, 2026, 4:23 a.m. OK PyPy 3-64 TESTS 4 62 1536000
374883713 s-ahmad461 A May 17, 2026, 1:44 a.m. OK PyPy 3-64 TESTS 4 62 1536000
374873135 mawo78 A May 16, 2026, 8:42 p.m. OK PyPy 3-64 TESTS 4 62 1536000
374865618 sathyamk A May 16, 2026, 7:11 p.m. OK PyPy 3-64 TESTS 4 62 1536000
374852046 user1223644 A May 16, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 4 62 1536000
374867933 AAE A May 16, 2026, 7:31 p.m. OK PyPy 3-64 TESTS 4 62 2150400
374894404 opankit A May 17, 2026, 4:12 a.m. OK PyPy 3-64 TESTS 4 62 2252800
374879818 shivangkeshri3 A May 16, 2026, 11:23 p.m. OK PyPy 3-64 TESTS 4 62 2969600
374899234 gooonn A May 17, 2026, 5:10 a.m. OK Python 3 TESTS 4 31 0
374900972 samarth.23bai11074 A May 17, 2026, 5:29 a.m. OK Python 3 TESTS 4 46 0
374900257 kushaln3 A May 17, 2026, 5:21 a.m. OK Python 3 TESTS 4 46 0
374888323 ToxicRabbittt A May 17, 2026, 3:16 a.m. OK Python 3 TESTS 4 46 0
374887853 lohi_06 A May 17, 2026, 3:08 a.m. OK Python 3 TESTS 4 46 0
374879357 chmpro A May 16, 2026, 11:09 p.m. OK Python 3 TESTS 4 46 0
374873670 DarkNight47Rises A May 16, 2026, 8:51 p.m. OK Python 3 TESTS 4 46 0
374872379 alphabetical A May 16, 2026, 8:31 p.m. OK Python 3 TESTS 4 46 0
374850020 BERCAT A May 16, 2026, 4:41 p.m. OK Python 3 TESTS 4 46 0
374894300 Shresth5 A May 17, 2026, 4:10 a.m. OK Python 3 TESTS 4 46 102400
374847692 CoHHa9_MyXa A May 16, 2026, 4:36 p.m. OK Rust 2024 TESTS 4 46 0

remove filters

Back to search problems