Hello 2024

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
1919 Hello 2024 FINISHED False 9000 71853923 Jan. 6, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 208 ) G Tree LGM PROGRAMMING constructive algorithms games trees 3500

In TreeWorld, there is a popular two-player game played on a tree with (n) vertices labelled from (1) to (n). In this game, the tournament leaders first choose a vertex to be the root of the tree and choose another vertex (possibly the same vertex as the root) to place a coin on. Then, each player will take turns moving the coin to any child(^\dagger) of the vertex that the coin is currently on. The first player who is unable to make a move loses. Alice wants to be a tree LGM, so she spends a lot of time studying the game. She wrote down an (n) by (n) matrix (s), where (s_{i,j} = \mathtt{1}) if the first player can win with the root of the tree chosen to be vertex (i), and the coin was initially placed on vertex (j). Otherwise, (s_{i, j} = \mathtt{0}). Alice is a perfectionist, so she assumes that both players play perfectly in the game. However, she accidentally knocked her head on the way to the tournament and forgot what the tree looked like. Determine whether there exists a tree that satisfies the winning and losing states represented by matrix (s), and if it exists, construct a valid tree. (^\dagger) A vertex (c) is a child of vertex (u) if there is an edge between (c) and (u), and (c) does not lie on the unique simple path from the root to vertex (u). The first line contains a single integer (n) ((1 \le n \le 5000)) — the number of vertices in the tree. Each of the next (n) lines contains a string with (n) characters, the (j)-th character of the (i)-th line representing (s_{i, j}) ((s_{i, j} \in \{\mathtt{0}, \mathtt{1}\})) — the winning and losing states of the tree. If there is no tree satisfying the winning and losing states represented by matrix (s), print a single line containing " NO ". Otherwise, if there exists a tree satisfying matrix (s), print " YES " on the first line, followed by (n - 1) lines each containing two intege

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
240642341 gisp_zjz G Jan. 7, 2024, 5:48 a.m. OK GNU C++14 TESTS 66 732 107520000 3500
240612272 Slamaa G Jan. 6, 2024, 7:30 p.m. OK GNU C++17 TESTS 66 810 101990400 3500
240603614 Benq G Jan. 6, 2024, 6:05 p.m. OK GNU C++17 (64) TESTS 64 842 102809600 3500
240604665 ainta G Jan. 6, 2024, 6:12 p.m. OK GNU C++17 (64) TESTS 65 1185 227430400 3500
240613261 Geothermal G Jan. 6, 2024, 7:43 p.m. OK GNU C++17 (64) TESTS 66 1543 26214400 3500
240618706 chappy1 G Jan. 6, 2024, 9:03 p.m. OK GNU C++17 (64) TESTS 66 1606 26214400 3500
240605747 tourist G Jan. 6, 2024, 6:20 p.m. OK GNU C++20 (64) TESTS 65 592 155852800 3500
240607597 Sparkle_Twilight G Jan. 6, 2024, 6:38 p.m. OK GNU C++20 (64) TESTS 65 951 35532800 3500
240630600 tulshikaa G Jan. 7, 2024, 2:34 a.m. OK GNU C++20 (64) TESTS 66 966 35532800 3500
240606266 ecnerwala G Jan. 6, 2024, 6:25 p.m. OK GNU C++20 (64) TESTS 65 982 35532800 3500
240595491 ecnerwala G Jan. 6, 2024, 4:58 p.m. OK GNU C++20 (64) TESTS 64 982 35532800 3500
240600558 antontrygubO_o G Jan. 6, 2024, 5:51 p.m. OK GNU C++20 (64) TESTS 64 1013 91443200 3500
240624687 magga G Jan. 6, 2024, 11:39 p.m. OK GNU C++20 (64) TESTS 66 1606 204390400 3500
240623708 magga G Jan. 6, 2024, 11:06 p.m. OK GNU C++20 (64) TESTS 66 1668 230502400 3500
240607804 Tlatoani G Jan. 6, 2024, 6:41 p.m. OK Kotlin 1.6 TESTS 66 1575 7782400 3500

remove filters

Back to search problems