Codeforces Round 969 (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
2006 Codeforces Round 969 (Div. 1) FINISHED False 9000 51463484 Aug. 30, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 164 ) F Dora's Paint PROGRAMMING brute force combinatorics constructive algorithms graphs

Sadly, Dora poured the paint when painting the class mural. Dora considers the mural as the matrix (b) of size (n \times n). Initially, (b_{i,j} = 0) for all (1 \le i, j \le n). Dora has only two brushes which have two different colors. In one operation, she can paint the matrix with one of two brushes: The first brush has color (1) on it and can paint one column of the matrix. That is, Dora chooses (1 \leq j \leq n) and makes (b_{i,j} := 1) for all (1 \leq i \leq n); The second brush has color (2) on it and can paint one row of the matrix. That is, Dora chooses (1 \leq i \leq n) and makes (b_{i,j} := 2) for all (1 \leq j \leq n). Dora paints the matrix so that the resulting matrix (b) contains only (1) and (2). For a matrix (b), let (f(b)) denote the minimum number of operations needed to turn the initial matrix (containing only (0)) into (b). The beauty of a matrix (b) is the number of ways to paint the initial matrix in exactly (f(b)) operations to turn it into (b). If there's no way to turn the initial matrix into (b), the beauty of (b) is (0). However, Dora made a uniformly random mistake; there's exactly one element different in the matrix (a) given to you from the real matrix (b). That is, there is exactly one pair ((i, j)) such that (a_{i, j} = 3 - b_{i, j}). Please help Dora compute the expected beauty of the real matrix (b) modulo (998\,244\,353) (all possible (n^2) mistakes have equal probability). Since the size of the matrix is too large, Dora will only tell you the positions of (m) elements of color (1), and the remaining (n^2-m) elements have color (2). Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers $$$n$$

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
278872889 wzc_IOI_czw F Aug. 31, 2024, 1:41 a.m. OK C++17 (GCC 7-32) TESTS 76 655 30412800
278849665 Um_nik F Aug. 30, 2024, 6:23 p.m. OK C++17 (GCC 7-32) TESTS 76 703 66048000
278835221 csyakuoi F Aug. 30, 2024, 4:36 p.m. OK C++17 (GCC 7-32) TESTS 76 733 13619200
278860790 arikrrr77 F Aug. 30, 2024, 8:37 p.m. OK C++17 (GCC 7-32) TESTS 76 1109 52019200
278876195 qiuzx F Aug. 31, 2024, 2:50 a.m. OK C++20 (GCC 13-64) TESTS 76 374 34099200
278847360 mallicktariq F Aug. 30, 2024, 6:02 p.m. OK C++20 (GCC 13-64) TESTS 76 390 19148800
278834885 jiangly F Aug. 30, 2024, 4:35 p.m. OK C++20 (GCC 13-64) TESTS 76 390 19148800
278850075 N_z__ F Aug. 30, 2024, 6:26 p.m. OK C++20 (GCC 13-64) TESTS 76 390 137318400
278866591 StellarSpecter F Aug. 30, 2024, 10:29 p.m. OK C++20 (GCC 13-64) TESTS 76 405 19046400
278839605 ecnerwala F Aug. 30, 2024, 4:52 p.m. OK C++20 (GCC 13-64) TESTS 76 624 34918400
278846466 abc864197532 F Aug. 30, 2024, 5:56 p.m. OK C++20 (GCC 13-64) TESTS 76 843 51814400
278867505 CALLSIGN_NULL_ F Aug. 30, 2024, 10:54 p.m. OK C++20 (GCC 13-64) TESTS 76 890 53145600
278851169 ksun48 F Aug. 30, 2024, 6:37 p.m. OK C++20 (GCC 13-64) TESTS 76 905 51507200
278838627 tourist F Aug. 30, 2024, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 76 1062 71782400
278886822 adityakumardas18871 F Aug. 31, 2024, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 76 984 72089600

remove filters

Back to search problems