Codeforces Round 944 (Div. 4)

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
1971 Codeforces Round 944 (Div. 4) FINISHED False 8100 21828263 May 10, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1947 ) H ±1 PROGRAMMING 2-sat dfs and similar graphs 2100

B"Bob has a grid with 3 rows and n columns, each of which contains either a_i or -a_i for some integer 1 <= q i <= q n . For example, one possible grid for n=4 is shown below: begin{bmatrix} a_1 & -a_2 & -a_3 & -a_2 -a_4 & a_4 & -a_1 & -a_3 a_1 & a_2 & -a_2 & a_4 end{bmatrix} Alice and Bob play a game as follows: For example, suppose Alice gives Bob the array [1, -1, -1, 1] for the grid above. Then the following will happen (colors are added for clarity): begin{bmatrix} color{red}{a_1} & color{green}{-a_2} & color{blue}{-a_3} & color{green}{-a_2} -a_4 & a_4 & color{red}{-a_1} & color{blue}{-a_3} color{red}{a_1} & color{green}{a_2} & color{green}{-a_2} & a_4 end{bmatrix} xrightarrow{[ color{red}{1}, color{green}{-1}, color{blue}{-1},1]} begin{bmatrix} color{red}{1} & color{green}{1} & color{blue}{1} & color{green}{1} -1 & 1 & color{red}{-1} & color{blue}{1} color{red}{1} & color{green}{-1} & color{green}{1} & 1 end{bmatrix} xrightarrow{ text{sort each column}} begin{bmatrix} -1 & -1 & -1 & 1 mathbf{1} & mathbf{1} & mathbf{1} & mathbf{1} 1 & 1 & 1 & 1 end{bmatrix} ,. Since the middle row is all 1 , Alice wins. Given Bob's grid, determine whether or not Alice can choose the array a to win the game. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains a single integer n ( 2 <= q n <= q 500 ) -- the number of columns of Bob's grid. The next three lines each contain n integers, the i -th of which contains g_{i,1}, g_{i,2}, ... , g_{i,n} ( -n <= q g_{i,j} <= q n , g_{i,j} neq 0 ), representing Bob's grid. If cell x > 0 is in the input, that cell in Bob's grid should contain a_x ; if x < 0 is in the input, that cell in Bob's grid should contain -a_{-x} . See the sample input "...

Tutorials

Codeforces Round 944 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
262482377 __Watcher H May 25, 2024, 8:42 a.m. OK C++14 (GCC 6-32) TESTS 9 311 72192000 2100
263568051 lishiao3405 H June 1, 2024, 3:26 a.m. OK C++14 (GCC 6-32) TESTS 9 312 102400 2100
263258046 ERoslon H May 30, 2024, 1:46 p.m. OK C++14 (GCC 6-32) TESTS 9 374 102400 2100
263258196 ERoslon H May 30, 2024, 1:47 p.m. OK C++14 (GCC 6-32) TESTS 9 405 102400 2100
263257813 ERoslon H May 30, 2024, 1:44 p.m. OK C++14 (GCC 6-32) TESTS 9 405 512000 2100
263694539 zhichenlin H June 2, 2024, 3:16 a.m. OK C++14 (GCC 6-32) TESTS 9 421 82124800 2100
262463582 luogu_bot2 H May 25, 2024, 5:46 a.m. OK C++14 (GCC 6-32) TESTS 9 624 0 2100
262463423 3017 H May 25, 2024, 5:44 a.m. OK C++14 (GCC 6-32) TESTS 9 640 102400 2100
262170525 MrDelrus H May 22, 2024, 4:36 p.m. OK C++14 (GCC 6-32) TESTS 9 890 0 2100
263417084 david_tao H May 31, 2024, 5:50 a.m. OK C++14 (GCC 6-32) TESTS 9 1171 716800 2100
262636003 bkifhr8 H May 26, 2024, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 9 296 0 2100
262221939 AlvinFei H May 23, 2024, 7:31 a.m. OK C++17 (GCC 7-32) TESTS 9 296 102400 2100
263608533 sayeedt H June 1, 2024, 9:48 a.m. OK C++17 (GCC 7-32) TESTS 9 311 0 2100
262380298 phirtheta H May 24, 2024, 11:56 a.m. OK C++17 (GCC 7-32) TESTS 9 311 102400 2100
263682894 Mahm2od H June 1, 2024, 9:46 p.m. OK C++17 (GCC 7-32) TESTS 9 312 102400 2100
262354307 wym111 H May 24, 2024, 8:20 a.m. OK C++17 (GCC 7-32) TESTS 9 327 102400 2100
262260475 jzh20041008 H May 23, 2024, 12:54 p.m. OK C++17 (GCC 7-32) TESTS 9 327 307200 2100
262186288 Harshvardhan_Acharya H May 22, 2024, 7:02 p.m. OK C++17 (GCC 7-32) TESTS 9 328 102400 2100
262953992 WBS123 H May 28, 2024, 4:13 a.m. OK C++17 (GCC 7-32) TESTS 9 343 0 2100
262851834 Yugi.Hacker H May 27, 2024, 8:40 a.m. OK C++17 (GCC 7-32) TESTS 9 343 0 2100
263437797 Suwan H May 31, 2024, 8:39 a.m. OK C++20 (GCC 13-64) TESTS 9 249 102400 2100
262895070 dnyh H May 27, 2024, 2:30 p.m. OK C++20 (GCC 13-64) TESTS 9 265 16896000 2100
263144197 Diverbee H May 29, 2024, 12:58 p.m. OK C++20 (GCC 13-64) TESTS 9 280 102400 2100
263697878 Cheeseman H June 2, 2024, 4:17 a.m. OK C++20 (GCC 13-64) TESTS 9 281 0 2100
263121355 FlowerandYou H May 29, 2024, 9:50 a.m. OK C++20 (GCC 13-64) TESTS 9 281 102400 2100
262252177 void_3 H May 23, 2024, 11:57 a.m. OK C++20 (GCC 13-64) TESTS 9 281 102400 2100
263156128 otsoheavens H May 29, 2024, 2:29 p.m. OK C++20 (GCC 13-64) TESTS 9 281 16179200 2100
263060843 Saden2011 H May 28, 2024, 7:59 p.m. OK C++20 (GCC 13-64) TESTS 9 296 102400 2100
263060561 CyberCow H May 28, 2024, 7:55 p.m. OK C++20 (GCC 13-64) TESTS 9 296 102400 2100
263010789 bluerar H May 28, 2024, 12:35 p.m. OK C++20 (GCC 13-64) TESTS 9 296 102400 2100
262320658 duyipeng H May 24, 2024, 12:41 a.m. OK Java 21 TESTS 9 968 1638400 2100
263184825 pierrot H May 29, 2024, 9:01 p.m. OK PyPy 3-64 TESTS 9 999 12185600 2100
262871959 vwxyz0 H May 27, 2024, 11:32 a.m. OK PyPy 3-64 TESTS 9 999 12390400 2100
262289594 sadqubit H May 23, 2024, 4:51 p.m. OK PyPy 3-64 TESTS 9 1984 24576000 2100
262233713 2210080018 H May 23, 2024, 9:26 a.m. OK Python 3 TESTS 9 843 409600 2100
262204351 MdNazmulHossain H May 23, 2024, 12:48 a.m. OK Python 3 TESTS 9 1093 1024000 2100
262645950 SnowballSH H May 26, 2024, 4:09 a.m. OK Rust 2021 TESTS 9 156 0 2100
262795292 vstiff H May 26, 2024, 7:26 p.m. OK Rust 2021 TESTS 9 530 0 2100

remove filters

Back to search problems