Codeforces Global Round 6

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
1266 Codeforces Global Round 6 FINISHED False 9000 160584863 Dec. 17, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 123 ) G Permutation Concatenation PROGRAMMING string suffix structures 3300

B'Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence P . For example, if n = 3 , then P = [1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1, 2, 3, 2, 1] . The length of this sequence is n cdot n! . Let 1 <= q i <= q j <= q n cdot n! be a pair of indices. We call the sequence (P_i, P_{i+1}, ... , P_{j-1}, P_j) a subarray of P . You are given n . Find the number of distinct subarrays of P . Since this number may be large, output it modulo 998244353 (a prime number). The only line contains one integer n ( 1 <= q n <= q 10^6 ), as described in the problem statement. Output a single integer -- the number of distinct subarrays, modulo 998244353 . In the first example, the sequence P = [1, 2, 2, 1] . It has eight distinct subarrays: [1] , [2] , [1, 2] , [2, 1] , [2, 2] , [1, 2, 2] , [2, 2, 1] and [1, 2, 2, 1] . '...

Tutorials

Codeforces Global Round 6 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67114198 hos.lyric G Dec. 17, 2019, 5:04 p.m. OK D TESTS 18 358 29286400 3300
68455969 birka0 G Jan. 9, 2020, 4:13 p.m. OK GNU C++11 TESTS 18 46 0 3300
67111333 1919810 G Dec. 17, 2019, 4:48 p.m. OK GNU C++11 TESTS 18 62 12083200 3300
67450231 WZYYN G Dec. 23, 2019, 3:31 a.m. OK GNU C++11 TESTS 18 109 16076800 3300
67127731 Benq G Dec. 17, 2019, 9:02 p.m. OK GNU C++14 TESTS 18 62 7987200 3300
68083788 virushika G Jan. 2, 2020, 3:24 p.m. OK GNU C++14 TESTS 18 77 12083200 3300
68832521 Motarack G Jan. 14, 2020, 11:58 p.m. OK GNU C++14 TESTS 18 186 12083200 3300
67112235 apiadu G Dec. 17, 2019, 4:53 p.m. OK GNU C++14 TESTS 18 249 11776000 3300
67115187 whzzt G Dec. 17, 2019, 5:10 p.m. OK GNU C++17 TESTS 18 31 8192000 3300
67133857 uin G Dec. 18, 2019, 2:34 a.m. OK GNU C++17 TESTS 18 62 12083200 3300
67323184 neal G Dec. 21, 2019, 8:47 a.m. OK GNU C++17 TESTS 18 77 11878400 3300
69537113 virushika G Jan. 25, 2020, 7:22 p.m. OK GNU C++17 TESTS 18 77 11980800 3300
67762356 Xellos G Dec. 27, 2019, 11:55 p.m. OK GNU C++17 TESTS 18 78 16076800 3300
67158173 Theo830 G Dec. 18, 2019, 1:09 p.m. OK GNU C++17 TESTS 18 93 23961600 3300
67319494 neal G Dec. 21, 2019, 7:27 a.m. OK GNU C++17 TESTS 18 124 24064000 3300
67779386 krijgertje G Dec. 28, 2019, 10:20 a.m. OK GNU C++17 TESTS 18 249 11980800 3300
67142027 MiFaFaOvO G Dec. 18, 2019, 7:12 a.m. OK PyPy 2 TESTS 18 202 0 3300
67141664 MiFaFaOvO G Dec. 18, 2019, 7:03 a.m. OK PyPy 2 TESTS 18 218 0 3300
67142652 MiFaFaOvO G Dec. 18, 2019, 7:27 a.m. OK PyPy 2 TESTS 18 248 0 3300
67141587 MiFaFaOvO G Dec. 18, 2019, 7 a.m. OK PyPy 2 TESTS 18 249 0 3300
67182933 ecnerwala G Dec. 19, 2019, 1:44 a.m. OK PyPy 3 TESTS 18 280 1536000 3300
67182897 ecnerwala G Dec. 19, 2019, 1:42 a.m. OK PyPy 3 TESTS 18 312 1228800 3300

remove filters

Back to search problems