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

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 900 ) F Nim PROGRAMMING bitmasks dp games

Recall the rules of the game "Nim". There are $$$n$$$ piles of stones, where the $$$i$$$-th pile initially contains some number of stones. Two players take turns choosing a non-empty pile and removing any positive (strictly greater than $$$0$$$) number of stones from it. The player unable to make a move loses the game. You are given an array $$$a$$$, consisting of $$$n$$$ integers. Artem and Ruslan decided to play Nim on segments of this array. Each of the $$$q$$$ rounds is defined by a segment $$$(l_i, r_i)$$$, where the elements $$$a_{l_i}, a_{l_i+1}, \dots, a_{r_i}$$$ represent the sizes of the piles of stones. Before the game starts, Ruslan can remove any number of piles from the chosen segment. However, at least one pile must remain , so in a single round he can remove at most $$$(r_i - l_i)$$$ piles. He is allowed to remove $$$0$$$ piles. After the removal, the game is played on the remaining piles within the segment. All rounds are independent : the changes made in one round do not affect the original array or any other rounds. Ruslan wants to remove as many piles as possible so that Artem, who always makes the first move, loses. For each round, determine: the maximum number of piles Ruslan can remove; the number of ways to choose the maximum number of piles for removal. Two ways are considered different if there exists an index $$$i$$$ such that the pile at index $$$i$$$ is removed in one way but not in the other. Since the number of ways can be large, output it modulo $$$998\,244\,353$$$. If Ruslan cannot ensure Artem's loss in a particular round, output -1 for that round. The first line of input contains two integers $$$n$$$ and $$$q$$$ ($$$1 \le n, q \le 10^5$$$) — the size of the array and the number of segments for which the answers need to be calculated. The second line of input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 \le a_i \le 50$$$) — the elements of the initial array. The $$$i$$$-th of the next $$$q$$$ lines contains t

Tutorials

Educational Codeforces Round 173 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
298345269 mban259 F Dec. 24, 2024, 10:38 p.m. OK C# 10 TESTS 43 4530 48537600
298366556 chennie F Dec. 25, 2024, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 43 312 25702400
298310372 pmt2018 F Dec. 24, 2024, 5:24 p.m. OK C++17 (GCC 7-32) TESTS 43 343 55091200
298307195 KroosTheKeenGlint F Dec. 24, 2024, 5:06 p.m. OK C++17 (GCC 7-32) TESTS 43 812 819200
298354489 ywjylx F Dec. 25, 2024, 3:12 a.m. OK C++17 (GCC 7-32) TESTS 43 875 20889600
298311139 pmt2018 F Dec. 24, 2024, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 43 999 55091200
298303207 pmt2018 F Dec. 24, 2024, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 43 999 55091200
298313305 hieu_2004 F Dec. 24, 2024, 5:43 p.m. OK C++17 (GCC 7-32) TESTS 43 1030 26521600
298318790 ender_shayan F Dec. 24, 2024, 6:22 p.m. OK C++17 (GCC 7-32) TESTS 43 1093 27340800
298340847 ezluci F Dec. 24, 2024, 9:06 p.m. OK C++17 (GCC 7-32) TESTS 43 1124 20684800
298351625 parag776 F Dec. 25, 2024, 2:06 a.m. OK C++17 (GCC 7-32) TESTS 43 1436 25088000
298367326 siuhou F Dec. 25, 2024, 6:03 a.m. OK C++20 (GCC 13-64) TESTS 43 218 22630400
298316730 hyperReality F Dec. 24, 2024, 6:07 p.m. OK C++20 (GCC 13-64) TESTS 43 280 17305600
298312557 HASBOT F Dec. 24, 2024, 5:38 p.m. OK C++20 (GCC 13-64) TESTS 43 499 39731200
298312883 HASBOT F Dec. 24, 2024, 5:40 p.m. OK C++20 (GCC 13-64) TESTS 43 500 39731200
298345344 VinnySJ F Dec. 24, 2024, 10:41 p.m. OK C++20 (GCC 13-64) TESTS 43 609 22425600
298314959 Ormlis F Dec. 24, 2024, 5:55 p.m. OK C++20 (GCC 13-64) TESTS 43 640 22630400
298306469 hyperReality F Dec. 24, 2024, 5:02 p.m. OK C++20 (GCC 13-64) TESTS 43 733 17203200
298338209 hazzlek F Dec. 24, 2024, 8:29 p.m. OK C++20 (GCC 13-64) TESTS 43 765 22425600
298334731 DaniraSilla F Dec. 24, 2024, 7:49 p.m. OK C++20 (GCC 13-64) TESTS 43 827 22630400
298317204 yyh603 F Dec. 24, 2024, 6:10 p.m. OK C++20 (GCC 13-64) TESTS 43 874 44134400
298347799 FallingRain F Dec. 25, 2024, 12:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 202 17408000
298311328 7.Up F Dec. 24, 2024, 5:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 203 17408000
298349037 FallingRain F Dec. 25, 2024, 12:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 217 17408000
298348743 FallingRain F Dec. 25, 2024, 12:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 233 17408000
298315798 NekoRolly F Dec. 24, 2024, 6 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 249 18124800
298325194 neal F Dec. 24, 2024, 7:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 281 17408000
298319667 neal F Dec. 24, 2024, 6:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 296 17510400
298325193 neal F Dec. 24, 2024, 7:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 343 17305600
298324383 neal F Dec. 24, 2024, 7:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 374 17305600
298319196 neal F Dec. 24, 2024, 6:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 374 17305600
298322228 arnabmanna F Dec. 24, 2024, 6:51 p.m. OK Java 21 TESTS 43 3296 42905600
298325617 Dukkha F Dec. 24, 2024, 7:22 p.m. OK Java 21 TESTS 43 5342 42086400
298325196 Dukkha F Dec. 24, 2024, 7:18 p.m. OK Java 21 TESTS 43 5780 42598400

remove filters

Back to search problems