Codeforces Round 1046 (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
2135 Codeforces Round 1046 (Div. 1) FINISHED False 10800 20359488 Aug. 28, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 242 ) E1 Beyond the Palindrome (Easy Version) PROGRAMMING combinatorics dp math

This is the easy version of the problem. The difference between the versions is that in this version, (n\le 10^6), and the sum of (n) over all test cases does not exceed (10^6). You can hack only if you solved all versions of this problem. For a binary string(^{\text{∗}}) (r), we define (f(r)) as the result of the following process: Delete all (10) substrings(^{\text{†}}) simultaneously from (r); Repeat the above operation until there are no (10) substrings in (r). For example, (f(\mathtt{100110001})=\mathtt{001}) because (r) changes as follows: (\mathtt{\underline{10}01\underline{10}001}\to \mathtt{0\underline{10}01}\to\mathtt{001}). We call a binary string (s) almost-palindrome if and only if (f(s)=f(\mathrm{rev}(s)))(^{\text{‡}}). Aquawave has given you an integer (n). You have to help him find the number of distinct almost-palindrome binary strings of length (n), modulo (998\,244\,353). (^{\text{∗}})A binary string is a string where each character is either (0) or (1). (^{\text{†}})A string (a) is a substring of a string (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end. (^{\text{‡}})(\mathrm{rev}(s)) is the string obtained by writing (s) from right to left. For example, (\mathrm{rev(\mathtt{10100})=\mathtt{00101}}). 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 only line of each test case contains a single integer (n) ((1\le n\le 10^6)) — the length of the binary strings. It is guaranteed that the sum of (n) over all test cases does not exceed (10^6). For each test case, output a single integer — the number of distinct almost-pa

Tutorials

Codeforces Round 1046 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
336067801 balakrishnan E1 Aug. 29, 2025, 12:34 a.m. OK C++20 (GCC 13-64) TESTS 34 108 36249600
336056058 kotatsugame E1 Aug. 28, 2025, 8:11 p.m. OK C++20 (GCC 13-64) TESTS 34 202 12595200
336081791 adam01 E1 Aug. 29, 2025, 4:36 a.m. OK C++20 (GCC 13-64) TESTS 34 202 16076800
336077747 L_Wave E1 Aug. 29, 2025, 3:34 a.m. OK C++20 (GCC 13-64) TESTS 34 265 32051200
336019824 BurnedChicken E1 Aug. 28, 2025, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 34 374 28262400
336029259 shiomusubi496 E1 Aug. 28, 2025, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 34 437 8704000
336063683 LuCpp E1 Aug. 28, 2025, 10:32 p.m. OK C++20 (GCC 13-64) TESTS 34 483 60211200
336030290 hhhgjyismine E1 Aug. 28, 2025, 4:56 p.m. OK C++20 (GCC 13-64) TESTS 34 515 12083200
336070664 qiuzx E1 Aug. 29, 2025, 1:43 a.m. OK C++20 (GCC 13-64) TESTS 34 578 16076800
336058848 noya2 E1 Aug. 28, 2025, 8:50 p.m. OK C++20 (GCC 13-64) TESTS 34 593 19660800
336088680 ecnerwala E1 Aug. 29, 2025, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 77 8192000
336086269 ecnerwala E1 Aug. 29, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 124 8294400
336024088 maspy E1 Aug. 28, 2025, 4:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 218 16384000
336013379 hos.lyric E1 Aug. 28, 2025, 4:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 233 32153600
336022136 Nachia E1 Aug. 28, 2025, 4:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 234 12288000
336077769 rqoi031 E1 Aug. 29, 2025, 3:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 234 24064000
336033475 TRDOG E1 Aug. 28, 2025, 5:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 234 68403200
336039149 PinkieRabbit E1 Aug. 28, 2025, 5:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 249 16076800
336055885 YuJiahe E1 Aug. 28, 2025, 8:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 265 8089600
336075836 rqoi031 E1 Aug. 29, 2025, 3:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 280 24064000

remove filters

Back to search problems