Codeforces Round 942 (Div. 1)

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
1967 Codeforces Round 942 (Div. 1) FINISHED False 9000 22692263 April 30, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 107 ) E2 Again Counting Arrays (Hard Version) PROGRAMMING combinatorics dp math 3500

B'This is the hard version of the problem. The differences between the two versions are the constraints on n, m, b_0 and the time limit. You can make hacks only if both versions are solved. Little R has counted many sets before, and now she decides to count arrays. Little R thinks an array b_0, ldots, b_n consisting of non-negative integers is continuous if and only if, for each i such that 1 <= q i <= q n , lvert b_i - b_{i-1} rvert = 1 is satisfied. She likes continuity, so she only wants to generate continuous arrays. If Little R is given b_0 and a_1, ldots, a_n , she will try to generate a non-negative continuous array b , which has no similarity with a . More formally, for all 1 <= q i <= q n , a_i neq b_i holds. However, Little R does not have any array a . Instead, she gives you n , m and b_0 . She wants to count the different integer arrays a_1, ldots, a_n satisfying: Note that b_i geq 0 , but the b_i can be arbitrarily large. Since the actual answer may be enormous, please just tell her the answer modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains the number of test cases t (1 <= q t <= q 10^4) . The description of the test cases follows. The first and only line of each test case contains three integers n , m , and b_0 ( 1 <= q n <= q 2 cdot 10^6 , 1 <= q m <= q 2 cdot 10^6 , 0 <= q b_0 <= q 2 cdot 10^6 ) -- the length of the array a_1, ldots, a_n , the maximum possible element in a_1, ldots, a_n , and the initial element of the array b_0, ldots, b_n . It is guaranteed that the sum of n over all test cases does not exceeds 10^7 . For each test case, output a single line containing an integer: the number of different arrays a_1, ldots, a_n satisfying the conditions, modulo 998 ,244 ,353 . In the first test case, for example, w'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
261632850 luogu_bot3 E2 May 19, 2024, 9:38 a.m. OK C++14 (GCC 6-32) TESTS 32 640 32051200 3500
258957419 by_chance E2 May 1, 2024, 3:29 a.m. OK C++14 (GCC 6-32) TESTS 32 655 24064000 3500
259722295 by_chance E2 May 6, 2024, 8:38 a.m. OK C++14 (GCC 6-32) TESTS 32 671 24064000 3500
259303138 Flamire E2 May 3, 2024, 5:36 a.m. OK C++14 (GCC 6-32) TESTS 32 1264 240537600 3500
259071993 Chenly E2 May 2, 2024, 2:23 a.m. OK C++14 (GCC 6-32) TESTS 32 2952 32153600 3500
263198496 Thank2 E2 May 30, 2024, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 32 702 24064000 3500
259114158 ctrlcoder E2 May 2, 2024, 11:38 a.m. OK C++17 (GCC 7-32) TESTS 32 703 20480000 3500
261151206 Ramo7fsw E2 May 16, 2024, 6:25 a.m. OK C++17 (GCC 7-32) TESTS 32 734 20480000 3500
259288352 Ashu_5 E2 May 3, 2024, 2:26 a.m. OK C++17 (GCC 7-32) TESTS 32 827 64204800 3500
259088561 chappy1 E2 May 2, 2024, 6:28 a.m. OK C++17 (GCC 7-32) TESTS 32 827 64204800 3500
258926598 Elegia E2 April 30, 2024, 5:50 p.m. OK C++17 (GCC 7-32) TESTS 32 859 64204800 3500
259314982 nishkarsh E2 May 3, 2024, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 32 906 92569600 3500
259813052 servants E2 May 7, 2024, 1 a.m. OK C++17 (GCC 7-32) TESTS 32 983 64102400 3500
259854220 2210080011_yakub E2 May 7, 2024, 9:36 a.m. OK C++17 (GCC 7-32) TESTS 32 1140 117248000 3500
258917151 potato167 E2 April 30, 2024, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 32 1280 36966400 3500
259322586 JCY_ E2 May 3, 2024, 6:55 a.m. OK C++20 (GCC 13-64) TESTS 32 171 32051200 3500
259360235 N_z__ E2 May 3, 2024, 1:04 p.m. OK C++20 (GCC 13-64) TESTS 32 249 30208000 3500
262692486 yasseinhamdy15 E2 May 26, 2024, 10:58 a.m. OK C++20 (GCC 13-64) TESTS 32 264 24064000 3500
259378006 rui_er E2 May 3, 2024, 3:08 p.m. OK C++20 (GCC 13-64) TESTS 32 264 24064000 3500
263377000 gary87051298 E2 May 30, 2024, 6:42 p.m. OK C++20 (GCC 13-64) TESTS 32 265 24064000 3500
262221900 Alexanderter10 E2 May 23, 2024, 7:31 a.m. OK C++20 (GCC 13-64) TESTS 32 265 24064000 3500
259286846 Yuvraj_2004 E2 May 3, 2024, 2:01 a.m. OK C++20 (GCC 13-64) TESTS 32 265 24064000 3500
260205648 I_LOVE_QUYNHANH E2 May 10, 2024, 5:21 a.m. OK C++20 (GCC 13-64) TESTS 32 280 24064000 3500
259037308 2018LZY E2 May 1, 2024, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 32 281 22118400 3500
260677705 Leccelerator E2 May 12, 2024, 2:28 p.m. OK C++20 (GCC 13-64) TESTS 32 281 24064000 3500
258936526 rainboy E2 April 30, 2024, 7:49 p.m. OK GNU C11 TESTS 32 733 64204800 3500

remove filters

Back to search problems