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
( 8605 ) C Competitive Fishing PROGRAMMING greedy sortings

Alice and Bob participate in a fishing contest! In total, they caught (n) fishes, numbered from (1) to (n) (the bigger the fish, the greater its index). Some of these fishes were caught by Alice, others — by Bob. Their performance will be evaluated as follows. First, an integer (m) will be chosen, and all fish will be split into (m) non-empty groups. The first group should contain several (at least one) smallest fishes, the second group — several (at least one) next smallest fishes, and so on. Each fish should belong to exactly one group, and each group should be a contiguous subsegment of fishes. Note that the groups are numbered in exactly that order; for example, the fishes from the second group cannot be smaller than the fishes from the first group, since the first group contains the smallest fishes. Then, each fish will be assigned a value according to its group index: each fish in the first group gets value equal to (0), each fish in the second group gets value equal to (1), and so on. So, each fish in the (i)-th group gets value equal to ((i-1)). The score of each contestant is simply the total value of all fishes that contestant caught. You want Bob's score to exceed Alice's score by at least (k) points. What is the minimum number of groups ((m)) you have to split the fishes into? If it is impossible, you should report that. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each test case contains two integers (n) and (k) ((2 \le n \le 2 \cdot 10^5); (1 \le k \le 10^9)). The second line contains a string, consisting of exactly (n) characters. The (i)-th character is either 0 (denoting that the (i)-th fish was caught by Alice) or 1 (denoting that the (i)-th fish was caught by Bob). Additional constraint on the input: the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test c

Tutorials

136886

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
294482242 AutumnMist C Dec. 2, 2024, 6:08 p.m. OK C# 10 TESTS 9 109 3072000
294479460 og.kostya C Dec. 2, 2024, 5:47 p.m. OK C# 10 TESTS 9 124 2662400
294529942 KAS26710 C Dec. 3, 2024, 6 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294529892 krutarthpatel929 C Dec. 3, 2024, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294525518 akshit269 C Dec. 3, 2024, 5:06 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294522622 koushikreddyyeredla C Dec. 3, 2024, 4:25 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294517122 loser_233 C Dec. 3, 2024, 2:59 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294515796 linj C Dec. 3, 2024, 2:34 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294515640 satyaprakash75 C Dec. 3, 2024, 2:31 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294515256 woruo27 C Dec. 3, 2024, 2:23 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294513250 nai_he C Dec. 3, 2024, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294512427 cp_first C Dec. 3, 2024, 1:28 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
294527749 chen-xi C Dec. 3, 2024, 5:36 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294527528 greyish C Dec. 3, 2024, 5:33 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294527397 Quake04 C Dec. 3, 2024, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294526597 iamSHIKU C Dec. 3, 2024, 5:21 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294526247 Junhone C Dec. 3, 2024, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294525783 dinosaur7 C Dec. 3, 2024, 5:10 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294525256 dinosaur7 C Dec. 3, 2024, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294522803 2730883287 C Dec. 3, 2024, 4:28 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294521461 ashishc1 C Dec. 3, 2024, 4:05 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294521121 abiramee C Dec. 3, 2024, 4 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
294529931 theflyingdutchman1 C Dec. 3, 2024, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294529466 cankjaca C Dec. 3, 2024, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294529333 jobin491 C Dec. 3, 2024, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294526953 xmx_happy C Dec. 3, 2024, 5:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294523269 nieyigeji C Dec. 3, 2024, 4:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294521365 manishjha91 C Dec. 3, 2024, 4:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294518467 SADMAN C Dec. 3, 2024, 3:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294518158 K-423 C Dec. 3, 2024, 3:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294517987 Netzach999 C Dec. 3, 2024, 3:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294516756 sskumarcp C Dec. 3, 2024, 2:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
294456138 alicia33 C Dec. 2, 2024, 4:33 p.m. OK GNU C11 TESTS 9 77 2764800
294473557 TuanHLH6 C Dec. 2, 2024, 5:07 p.m. OK GNU C11 TESTS 9 92 1331200
294434481 Harshil_6064 C Dec. 2, 2024, 4 p.m. OK GNU C11 TESTS 9 92 1945600
294482116 WIND1028 C Dec. 2, 2024, 6:07 p.m. OK GNU C11 TESTS 9 93 2662400
294473468 Schmoov C Dec. 2, 2024, 5:07 p.m. OK GNU C11 TESTS 9 156 3174400
294477677 dineshchandran311 C Dec. 2, 2024, 5:37 p.m. OK Java 21 TESTS 9 249 409600
294475044 arnabmanna C Dec. 2, 2024, 5:18 p.m. OK Java 21 TESTS 9 249 409600
294454161 arnabmanna C Dec. 2, 2024, 4:27 p.m. OK Java 21 TESTS 9 280 1536000
294476420 ash432 C Dec. 2, 2024, 5:27 p.m. OK Java 21 TESTS 9 281 614400
294517012 lovejsn C Dec. 3, 2024, 2:57 a.m. OK Java 21 TESTS 9 281 819200
294525556 akshay23codes C Dec. 3, 2024, 5:07 a.m. OK Java 21 TESTS 9 281 921600
294468517 prohladenn_vko C Dec. 2, 2024, 4:38 p.m. OK Java 21 TESTS 9 296 409600
294493954 BlizGale C Dec. 2, 2024, 7:48 p.m. OK Java 21 TESTS 9 296 921600
294437725 keshav.sai0311 C Dec. 2, 2024, 4:09 p.m. OK Java 21 TESTS 9 311 819200
294436441 sagar.kapoor.myproject C Dec. 2, 2024, 4:05 p.m. OK Java 21 TESTS 9 311 5734400
294495660 harsh_1806 C Dec. 2, 2024, 8:08 p.m. OK Java 8 TESTS 9 171 0
294500671 leonlian C Dec. 2, 2024, 9:06 p.m. OK Java 8 TESTS 9 171 614400
294462338 pranav_27 C Dec. 2, 2024, 4:34 p.m. OK Java 8 TESTS 9 202 0
294432770 alizaidi_1 C Dec. 2, 2024, 3:56 p.m. OK Java 8 TESTS 9 202 0
294485301 mohit458 C Dec. 2, 2024, 6:30 p.m. OK Java 8 TESTS 9 233 3584000
294472641 kasiru_69 C Dec. 2, 2024, 5:01 p.m. OK Java 8 TESTS 9 234 1843200
294446972 achyut88 C Dec. 2, 2024, 4:22 p.m. OK Java 8 TESTS 9 249 0
294432726 nazmul1010 C Dec. 2, 2024, 3:56 p.m. OK Java 8 TESTS 9 249 0
294456713 sanchitkumarsingh0988 C Dec. 2, 2024, 4:34 p.m. OK Java 8 TESTS 9 265 0
294485742 mohit458 C Dec. 2, 2024, 6:33 p.m. OK Java 8 TESTS 9 265 3481600
294475203 chinesedfan C Dec. 2, 2024, 5:19 p.m. OK Node.js TESTS 9 171 8601600
294436831 DumbbAlgo C Dec. 2, 2024, 4:07 p.m. OK PyPy 3 TESTS 9 343 9318400
294444696 Creym C Dec. 2, 2024, 4:15 p.m. OK PyPy 3 TESTS 9 358 8192000
294521181 rajeshpenugonda C Dec. 3, 2024, 4 a.m. OK PyPy 3 TESTS 9 389 9932800
294472544 SoleProprietor C Dec. 2, 2024, 5:01 p.m. OK PyPy 3-64 TESTS 9 109 6553600
294436771 thanhtrnnn C Dec. 2, 2024, 4:06 p.m. OK PyPy 3-64 TESTS 9 124 8396800
294507483 PedalCircle C Dec. 2, 2024, 11:09 p.m. OK PyPy 3-64 TESTS 9 124 11571200
294523389 iygav1238 C Dec. 3, 2024, 4:37 a.m. OK PyPy 3-64 TESTS 9 124 23142400
294514838 ash2298744 C Dec. 3, 2024, 2:13 a.m. OK PyPy 3-64 TESTS 9 140 6451200
294434187 ibraheemkureshi C Dec. 2, 2024, 3:59 p.m. OK PyPy 3-64 TESTS 9 140 7987200
294481279 ychangseok C Dec. 2, 2024, 6 p.m. OK PyPy 3-64 TESTS 9 140 8192000
294470227 PyIsTheBestLang C Dec. 2, 2024, 4:46 p.m. OK PyPy 3-64 TESTS 9 140 8192000
294470270 MaxValgen_ C Dec. 2, 2024, 4:47 p.m. OK PyPy 3-64 TESTS 9 140 8601600
294496270 balalm10 C Dec. 2, 2024, 8:15 p.m. OK PyPy 3-64 TESTS 9 140 9830400
294454749 Dikshav07 C Dec. 2, 2024, 4:29 p.m. OK Python 2 TESTS 9 202 7065600
294434815 Ajai_Sharan C Dec. 2, 2024, 4:01 p.m. OK Python 3 TESTS 9 124 9420800
294452914 professorik C Dec. 2, 2024, 4:24 p.m. OK Python 3 TESTS 9 124 10649600
294455715 shubhkno C Dec. 2, 2024, 4:32 p.m. OK Python 3 TESTS 9 125 9625600
294453911 _stack C Dec. 2, 2024, 4:27 p.m. OK Python 3 TESTS 9 125 9625600
294452444 valeria2008 C Dec. 2, 2024, 4:22 p.m. OK Python 3 TESTS 9 125 9625600
294446647 vijcode C Dec. 2, 2024, 4:21 p.m. OK Python 3 TESTS 9 125 9625600
294432555 mugiwara_shanks C Dec. 2, 2024, 3:55 p.m. OK Python 3 TESTS 9 125 9625600
294469197 Esanov C Dec. 2, 2024, 4:41 p.m. OK Python 3 TESTS 9 140 9523200
294432841 dkamulboyev1 C Dec. 2, 2024, 3:56 p.m. OK Python 3 TESTS 9 140 10444800
294452415 Vitaliy270604 C Dec. 2, 2024, 4:22 p.m. OK Python 3 TESTS 9 140 10649600
294503389 matheusdacach C Dec. 2, 2024, 9:52 p.m. OK Rust 2021 TESTS 9 46 3993600
294508412 Lord-scheme C Dec. 2, 2024, 11:39 p.m. OK Rust 2021 TESTS 9 61 1126400
294496617 DreadedHippy C Dec. 2, 2024, 8:20 p.m. OK Rust 2021 TESTS 9 77 102400

remove filters

Back to search problems