Codeforces Round 930 (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
1936 Codeforces Round 930 (Div. 1) FINISHED False 7200 22605899 Feb. 29, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 125 ) E Yet Yet Another Permutation Problem PROGRAMMING divide and conquer fft math

B'You are given a permutation p of length n . Please count the number of permutations q of length n which satisfy the following: Since the answer may be large, output the answer modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ). The second line of each test case contains n integers p_1, p_2, ldots, p_n ( 1 <= p_i <= n ). It is guaranteed that p is a permutation. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print a single integer -- the answer modulo 998 ,244 ,353 . In the first test case, p = [2, 1] . The only suitable q is [1, 2] . Indeed, we need to satisfy the inequality q_1 neq p_1 . It only holds for q = [1, 2] . In the second test case, p = [1, 2, 3] . So q has to satisfy two inequalities: q_1 neq p_1 and max(q_1, q_2) neq max(1, 2) = 2 . One can prove that this only holds for the following 3 permutations: '...

Tutorials

Codeforces Round 930 (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
249003340 rainboy E Feb. 29, 2024, 10:21 p.m. OK GNU C11 TESTS 20 4492 21913600
248968880 Shiroqwq_ E Feb. 29, 2024, 4:29 p.m. OK GNU C++17 TESTS 20 3837 710041600
249007959 dognotlike E March 1, 2024, midnight OK GNU C++17 (64) TESTS 20 811 45875200
249003485 rainboy E Feb. 29, 2024, 10:24 p.m. OK GNU C++17 (64) TESTS 20 841 21504000
248969738 orzdevinwang E Feb. 29, 2024, 4:30 p.m. OK GNU C++17 (64) TESTS 20 1263 95129600
248981737 mo_onrabbit2 E Feb. 29, 2024, 6:42 p.m. OK GNU C++17 (64) TESTS 20 1871 27443200
249024096 kirilltop1 E March 1, 2024, 4:31 a.m. OK GNU C++20 (64) TESTS 20 826 25088000
248981377 BurnedChicken E Feb. 29, 2024, 6:40 p.m. OK GNU C++20 (64) TESTS 20 873 25395200
248981225 hos.lyric E Feb. 29, 2024, 6:39 p.m. OK GNU C++20 (64) TESTS 20 1107 45670400
248981250 tourist E Feb. 29, 2024, 6:39 p.m. OK GNU C++20 (64) TESTS 20 1201 17408000
248997308 Eliminatrix_0 E Feb. 29, 2024, 8:46 p.m. OK GNU C++20 (64) TESTS 20 1684 27443200
249000320 Sparkle_Twilight E Feb. 29, 2024, 9:30 p.m. OK GNU C++20 (64) TESTS 20 1684 27443200
248994201 jeroenodb E Feb. 29, 2024, 8:13 p.m. OK GNU C++20 (64) TESTS 20 1965 32460800
249024020 Fido_Puppy E March 1, 2024, 4:30 a.m. OK GNU C++20 (64) TESTS 20 2058 67481600
249019529 jiangly E March 1, 2024, 3:33 a.m. OK GNU C++20 (64) TESTS 20 2167 21401600
249010315 EternalAlexander E March 1, 2024, 12:53 a.m. OK GNU C++20 (64) TESTS 20 2730 120217600

remove filters

Back to search problems