Codeforces Round 994 (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
2049 Codeforces Round 994 (Div. 2) FINISHED False 7200 41700323 Dec. 20, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 577 ) F MEX OR Mania PROGRAMMING bitmasks data structures implementation

An integer sequence (b_1, b_2, \ldots, b_n) is good if (\operatorname{mex}(b_1, b_2, \ldots, b_n) - (b_1 | b_2 | \ldots | b_n) = 1). Here, (\operatorname{mex(c)}) denotes the MEX(^{\text{∗}}) of the collection (c), and (|) is the bitwise OR operator. Shohag has an integer sequence (a_1, a_2, \ldots, a_n). He will perform the following (q) updates on (a): (i) (x) — increase (a_i) by (x). After each update, help him find the length of the longest good subarray(^{\text{†}}) of (a). (^{\text{∗}})The minimum excluded (MEX) of a collection of integers (c_1, c_2, \ldots, c_k) is defined as the smallest non-negative integer (y) which does not occur in the collection (c). (^{\text{†}})An array (d) is a subarray of an array (f) if (d) can be obtained from (f) by the deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. 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 two space-separated integers (n) and (q) ((1 \le n, q \le 10^5)). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((0 \le a_i \le n)). The next (q) lines of each test case are of the following form: (i) (x) ((1 \le i, x \le n)) — it means you should increase (a_i) by (x). It is guaranteed that the sum of (n) over all test cases doesn't exceed (10^5) and the sum of (q) doesn't exceed (10^5). For each test case, output (q) lines — on the (i)-th line output the length of the longest good subarray of (a) after the (i)-th update. In the first test case, after the first update, the array becomes (0, 0, 1, 0, 1, 1), and here the whole array is good because $$$\operator

Tutorials

Codeforces Round #994 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
297564747 4977 F Dec. 20, 2024, 7:13 p.m. OK C++17 (GCC 7-32) TESTS 67 671 5734400
297573718 kasanaruomoi F Dec. 20, 2024, 8:28 p.m. OK C++17 (GCC 7-32) TESTS 67 828 68300800
297585069 rogeryi F Dec. 21, 2024, 12:26 a.m. OK C++17 (GCC 7-32) TESTS 67 842 49152000
297573096 kasanaruomoi F Dec. 20, 2024, 8:22 p.m. OK C++17 (GCC 7-32) TESTS 67 1000 75776000
297565672 HHY_zZhu F Dec. 20, 2024, 7:20 p.m. OK C++17 (GCC 7-32) TESTS 67 1328 32256000
297600129 celin F Dec. 21, 2024, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 67 1640 815718400
297599654 celin F Dec. 21, 2024, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 67 1655 815718400
297582514 IsaacMoris F Dec. 20, 2024, 10:53 p.m. OK C++17 (GCC 7-32) TESTS 67 1702 66969600
297601945 Ylx15 F Dec. 21, 2024, 5:24 a.m. OK C++17 (GCC 7-32) TESTS 67 2092 562790400
297601792 Ylx21 F Dec. 21, 2024, 5:23 a.m. OK C++17 (GCC 7-32) TESTS 67 2092 562790400
297583422 De3b0o F Dec. 20, 2024, 11:22 p.m. OK C++20 (GCC 13-64) TESTS 67 234 12697600
297583331 De3b0o F Dec. 20, 2024, 11:20 p.m. OK C++20 (GCC 13-64) TESTS 67 343 23040000
297543226 Rubikun F Dec. 20, 2024, 5:06 p.m. OK C++20 (GCC 13-64) TESTS 66 452 8192000
297565911 shiven F Dec. 20, 2024, 7:22 p.m. OK C++20 (GCC 13-64) TESTS 67 577 8499200
297564535 shiven F Dec. 20, 2024, 7:12 p.m. OK C++20 (GCC 13-64) TESTS 67 578 8396800
297582074 iamfrancisco F Dec. 20, 2024, 10:40 p.m. OK C++20 (GCC 13-64) TESTS 67 578 10035200
297565657 shiven F Dec. 20, 2024, 7:20 p.m. OK C++20 (GCC 13-64) TESTS 67 624 8601600
297563815 4977 F Dec. 20, 2024, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 67 624 10035200
297547157 MegalovaniaJ F Dec. 20, 2024, 5:23 p.m. OK C++20 (GCC 13-64) TESTS 66 640 11571200
297556206 MegalovaniaJ F Dec. 20, 2024, 6:16 p.m. OK C++20 (GCC 13-64) TESTS 67 640 11776000
297583264 edogawa_something F Dec. 20, 2024, 11:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 67 327 23040000
297605740 rtgsp F Dec. 21, 2024, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 67 671 11059200
297597848 Dragos F Dec. 21, 2024, 4:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 67 718 44748800
297555140 Abbess F Dec. 20, 2024, 6:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 67 811 10649600
297550216 Ahmed57 F Dec. 20, 2024, 5:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 66 828 49254400
297597809 Dragos F Dec. 21, 2024, 4:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 67 999 50176000
297582044 Genteki F Dec. 20, 2024, 10:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 67 1218 17100800
297549774 YamOCHca F Dec. 20, 2024, 5:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 66 1233 12492800
297576015 Suwan F Dec. 20, 2024, 8:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 67 1327 75468800
297571567 __NONE__ F Dec. 20, 2024, 8:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 67 1406 38604800
297552991 __baozii__ F Dec. 20, 2024, 5:56 p.m. OK Go TESTS 67 2030 490803200

remove filters

Back to search problems