Educational Codeforces Round 172 (Rated for 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
2042 Educational Codeforces Round 172 (Rated for Div. 2) FINISHED False 7200 43255523 Dec. 2, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 19441 ) B Game with Colored Marbles PROGRAMMING games greedy

Alice and Bob play a game. There are (n) marbles, the (i)-th of them has color (c_i). The players take turns; Alice goes first, then Bob, then Alice again, then Bob again, and so on. During their turn, a player must take one of the remaining marbles and remove it from the game. If there are no marbles left (all (n) marbles have been taken), the game ends. Alice's score at the end of the game is calculated as follows: she receives (1) point for every color (x) such that she has taken at least one marble of that color; additionally, she receives (1) point for every color (x) such that she has taken all marbles of that color (of course, only colors present in the game are considered). For example, suppose there are (5) marbles, their colors are (1, 3, 1, 3, 4), and the game goes as follows: Alice takes the (1)-st marble, then Bob takes the (3)-rd marble, then Alice takes the (5)-th marble, then Bob takes the (2)-nd marble, and finally, Alice takes the (4)-th marble. Then, Alice receives (4) points: (3) points for having at least one marble for colors (1), (3) and (4), and (1) point for having all marbles of color (4). Note that this strategy is not necessarily optimal for both players . Alice wants to maximize her score at the end of the game. Bob wants to minimize it. Both players play optimally (i. e. Alice chooses a strategy which allows her to get as many points as possible, and Bob chooses a strategy which minimizes the amount of points Alice can get). Calculate Alice's score at the end of the game. The first line contains one integer (t) ((1 \le t \le 1000)) — the number of test cases. Each test case consists of two lines: the first line contains one integer (n) ((1 \le n \le 1000)) — the number of marbles; the second line contains (n) integers (c_1, c_2, \dots, c_n) ((1 \le c_i \le n)) — the colors of the marbles. Additional constraint

Tutorials

136886

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
294469167 tahtarovserver B Dec. 2, 2024, 4:41 p.m. OK C# 10 TESTS 5 109 307200
294503612 dweepmodi2311 B Dec. 2, 2024, 9:57 p.m. OK C++17 (GCC 7-32) TESTS 5 30 0
294455238 Swastik1729 B Dec. 2, 2024, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 5 30 0
294520994 datelong B Dec. 3, 2024, 3:57 a.m. OK C++17 (GCC 7-32) TESTS 5 30 102400
294511041 VERITVS B Dec. 3, 2024, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 5 30 102400
294499115 Ayush_soni B Dec. 2, 2024, 8:49 p.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294501721 shaan2003kapoor B Dec. 2, 2024, 9:24 p.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294525063 inst-veplsnx B Dec. 3, 2024, 5 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294521228 cant_beat B Dec. 3, 2024, 4:01 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294514676 SF-Manman B Dec. 3, 2024, 2:10 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294511553 mursalinabu89 B Dec. 3, 2024, 1:07 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
294479005 Uchiha_Itachi__ B Dec. 2, 2024, 5:44 p.m. OK C++20 (GCC 13-64) TESTS 5 30 0
294527146 alphagomaster B Dec. 3, 2024, 5:28 a.m. OK C++20 (GCC 13-64) TESTS 5 30 0
294518502 lazy_wallflower B Dec. 3, 2024, 3:23 a.m. OK C++20 (GCC 13-64) TESTS 5 30 0
294486910 mohmednasser011 B Dec. 2, 2024, 6:41 p.m. OK C++20 (GCC 13-64) TESTS 5 30 0
294470212 OatTheSigma B Dec. 2, 2024, 4:46 p.m. OK C++20 (GCC 13-64) TESTS 5 30 102400
294520069 DarkChemist B Dec. 3, 2024, 3:49 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
294527389 Dr.KeK B Dec. 3, 2024, 5:31 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
294523181 Mr_Gajera112 B Dec. 3, 2024, 4:33 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
294523160 ACE_DX3906 B Dec. 3, 2024, 4:33 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
294519914 Mysteri0 B Dec. 3, 2024, 3:46 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
294455256 LostDecimal_093 B Dec. 2, 2024, 4:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
294527709 SOUMYA_RJ B Dec. 3, 2024, 5:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
294493515 SahilH B Dec. 2, 2024, 7:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
294446859 ANKITKUMAR198 B Dec. 2, 2024, 4:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
294490757 sumitbarua3112 B Dec. 2, 2024, 7:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 102400
294526290 Sandy_malz B Dec. 3, 2024, 5:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
294518755 0xscifi B Dec. 3, 2024, 3:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
294516062 poplpr B Dec. 3, 2024, 2:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
294495646 sobhit_raghav B Dec. 2, 2024, 8:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
294486388 anirudhdhage72 B Dec. 2, 2024, 6:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
294438032 date_masamune B Dec. 2, 2024, 4:10 p.m. OK C# 8 TESTS 5 124 614400
294489244 hello_world_1729 B Dec. 2, 2024, 7:01 p.m. OK GNU C11 TESTS 5 31 0
294481414 saaad B Dec. 2, 2024, 6:01 p.m. OK GNU C11 TESTS 5 31 102400
294504307 haveOlogntime B Dec. 2, 2024, 10:11 p.m. OK GNU C11 TESTS 5 31 102400
294497403 gagansiddartha2007 B Dec. 2, 2024, 8:27 p.m. OK GNU C11 TESTS 5 31 102400
294490137 hello_world_1729 B Dec. 2, 2024, 7:10 p.m. OK GNU C11 TESTS 5 31 102400
294455925 ColdestKyurem B Dec. 2, 2024, 4:32 p.m. OK GNU C11 TESTS 5 31 102400
294454479 Aryan_Sandal2517 B Dec. 2, 2024, 4:28 p.m. OK GNU C11 TESTS 5 31 102400
294446887 ryanultasnia098 B Dec. 2, 2024, 4:21 p.m. OK GNU C11 TESTS 5 31 102400
294433245 uditgarg007 B Dec. 2, 2024, 3:57 p.m. OK GNU C11 TESTS 5 46 0
294522266 farhan_s_a B Dec. 3, 2024, 4:19 a.m. OK GNU C11 TESTS 5 46 102400
294519238 botayhard B Dec. 3, 2024, 3:35 a.m. OK Go TESTS 5 62 4403200
294432677 EproFymed B Dec. 2, 2024, 3:56 p.m. OK Go TESTS 5 77 204800
294503135 xorfftdp B Dec. 2, 2024, 9:48 p.m. OK Java 21 TESTS 5 202 307200
294490301 minimoh B Dec. 2, 2024, 7:12 p.m. OK Java 21 TESTS 5 202 409600
294445972 krikera B Dec. 2, 2024, 4:19 p.m. OK Java 21 TESTS 5 202 614400
294502276 grtcoder B Dec. 2, 2024, 9:34 p.m. OK Java 21 TESTS 5 217 1024000
294519942 akshay23codes B Dec. 3, 2024, 3:47 a.m. OK Java 21 TESTS 5 217 1331200
294480800 kevinliu__ B Dec. 2, 2024, 5:57 p.m. OK Java 21 TESTS 5 218 0
294510618 changhj B Dec. 3, 2024, 12:41 a.m. OK Java 21 TESTS 5 218 409600
294481959 gvk424 B Dec. 2, 2024, 6:05 p.m. OK Java 21 TESTS 5 218 819200
294436044 Abdelatef01025 B Dec. 2, 2024, 4:04 p.m. OK Java 21 TESTS 5 233 102400
294484892 PurvaS15 B Dec. 2, 2024, 6:27 p.m. OK Java 21 TESTS 5 233 614400
294436927 faresbadr316 B Dec. 2, 2024, 4:07 p.m. OK Java 8 TESTS 5 140 0
294504140 NerfThis B Dec. 2, 2024, 10:08 p.m. OK Java 8 TESTS 5 155 0
294475633 Akshat_Gupta._ B Dec. 2, 2024, 5:22 p.m. OK Java 8 TESTS 5 155 0
294465024 shubham73 B Dec. 2, 2024, 4:37 p.m. OK Java 8 TESTS 5 155 0
294455803 shuklavinayak1 B Dec. 2, 2024, 4:32 p.m. OK Java 8 TESTS 5 171 0
294454893 Akshatj557 B Dec. 2, 2024, 4:29 p.m. OK Java 8 TESTS 5 171 0
294453140 krishna612 B Dec. 2, 2024, 4:24 p.m. OK Java 8 TESTS 5 171 0
294445813 AchalVishnoi B Dec. 2, 2024, 4:18 p.m. OK Java 8 TESTS 5 171 0
294436832 NethiAravindkumar B Dec. 2, 2024, 4:07 p.m. OK Java 8 TESTS 5 171 0
294432339 Harsha_49149 B Dec. 2, 2024, 3:55 p.m. OK Java 8 TESTS 5 171 0
294473967 vuong123478 B Dec. 2, 2024, 5:10 p.m. OK Kotlin 1.9 TESTS 5 187 204800
294435585 mithu000 B Dec. 2, 2024, 4:03 p.m. OK Node.js TESTS 5 93 921600
294529185 debanjanmaity2018 B Dec. 3, 2024, 5:50 a.m. OK PyPy 2 TESTS 5 92 204800
294436285 batman-TDK B Dec. 2, 2024, 4:05 p.m. OK PyPy 3 TESTS 5 92 1331200
294522732 nurasylb005 B Dec. 3, 2024, 4:26 a.m. OK PyPy 3 TESTS 5 93 1331200
294526030 SParshR B Dec. 3, 2024, 5:13 a.m. OK PyPy 3 TESTS 5 108 102400
294437015 benz_19 B Dec. 2, 2024, 4:07 p.m. OK PyPy 3 TESTS 5 108 1228800
294434197 santhoshsparky B Dec. 2, 2024, 3:59 p.m. OK PyPy 3 TESTS 5 109 1740800
294469114 seeeeoh B Dec. 2, 2024, 4:41 p.m. OK PyPy 3 TESTS 5 124 1843200
294498211 bufferacct B Dec. 2, 2024, 8:36 p.m. OK PyPy 3-64 TESTS 5 77 0
294497953 bufferacct B Dec. 2, 2024, 8:33 p.m. OK PyPy 3-64 TESTS 5 77 0
294494125 _BLACK__MAMBA_ B Dec. 2, 2024, 7:50 p.m. OK PyPy 3-64 TESTS 5 77 0
294484721 mawo78 B Dec. 2, 2024, 6:26 p.m. OK PyPy 3-64 TESTS 5 77 0
294471919 autobot_prime B Dec. 2, 2024, 4:56 p.m. OK PyPy 3-64 TESTS 5 77 0
294456672 xezz B Dec. 2, 2024, 4:34 p.m. OK PyPy 3-64 TESTS 5 77 0
294452487 o--ayanokoji--x B Dec. 2, 2024, 4:22 p.m. OK PyPy 3-64 TESTS 5 77 0
294445586 gabriel.gom.cat B Dec. 2, 2024, 4:17 p.m. OK PyPy 3-64 TESTS 5 77 0
294433908 pleaseusecodew2s B Dec. 2, 2024, 3:59 p.m. OK PyPy 3-64 TESTS 5 77 0
294468266 Sarvesssssssh B Dec. 2, 2024, 4:38 p.m. OK PyPy 3-64 TESTS 5 77 102400
294471474 deepak_pandey1011 B Dec. 2, 2024, 4:54 p.m. OK Python 3 TESTS 5 46 0
294526230 s.arjun1482 B Dec. 3, 2024, 5:16 a.m. OK Python 3 TESTS 5 61 0
294525323 CODEBREAKER_Reii B Dec. 3, 2024, 5:03 a.m. OK Python 3 TESTS 5 61 0
294525027 Divya_Reddy78094 B Dec. 3, 2024, 4:59 a.m. OK Python 3 TESTS 5 61 0
294454058 CheatPlusPlus14 B Dec. 2, 2024, 4:27 p.m. OK Python 3 TESTS 5 61 0
294445835 sanvi.bhowmick2006 B Dec. 2, 2024, 4:18 p.m. OK Python 3 TESTS 5 61 0
294526732 What_is_this B Dec. 3, 2024, 5:23 a.m. OK Python 3 TESTS 5 62 0
294521304 codeway3 B Dec. 3, 2024, 4:03 a.m. OK Python 3 TESTS 5 62 0
294520815 clifong2002 B Dec. 3, 2024, 3:54 a.m. OK Python 3 TESTS 5 62 0
294514443 Akin2010 B Dec. 3, 2024, 2:05 a.m. OK Python 3 TESTS 5 62 0
294501279 matheusdacach B Dec. 2, 2024, 9:16 p.m. OK Rust 2021 TESTS 5 46 0
294495645 0x81 B Dec. 2, 2024, 8:07 p.m. OK Rust 2021 TESTS 5 46 0
294436305 null_lambda B Dec. 2, 2024, 4:05 p.m. OK Rust 2021 TESTS 5 62 0

remove filters

Back to search problems