Good Bye 2022: 2023 is NEAR

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
1770 Good Bye 2022: 2023 is NEAR FINISHED False 9000 67793090 Dec. 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 131 ) H Koxia, Mahiru and Winter Festival PROGRAMMING constructive algorithms

B"Koxia and Mahiru are enjoying the Winter Festival. The streets of the Winter Festival can be represented as a n x n undirected grid graph. Formally, the set of vertices is {(i,j) ; | ; 1 <= q i,j <= q n } and two vertices (i_1,j_1) and (i_2,j_2) are connected by an edge if and only if |i_1-i_2|+|j_1-j_2|=1 . Koxia and Mahiru are planning to visit The Winter Festival by traversing 2n routes. Although routes are not planned yet, the endpoints of the routes are already planned as follows: Your task is to find a routing scheme -- 2n paths where each path connects the specified endpoints. Let's define the congestion of an edge as the number of times it is used (both directions combined) in the routing scheme. In order to ensure that Koxia and Mahiru won't get too bored because of traversing repeated edges, please find a routing scheme that minimizes the maximum congestion among all edges. The first line contains an integer n ( 2 <= q n <= q 200 ) -- the size of the network. The second line contains n integers p_1, p_2, ... , p_n ( 1 <= q p_i <= q n ). The third line contains n integers q_1, q_2, ... , q_n ( 1 <= q q_i <= q n ). It is guaranteed that both p and q are permutations of length n . Output 2n lines, each line describing a route. The first n lines should describe the connections from top to bottom. The i -th line should describe the route starting at vertex (1, i) and ending at vertex (n, p_i) . The next n lines should describe the connections from left to right. The (i+n) -th line should describe the route starting at vertex (i, 1) and ending at vertex (q_i, n) . Each line describing a route should start with an integer k ( 2 <= k <= 10^5 ) -- the number of vertices the route passes, including the starting and ending vertices. Then output all the vertices on the route in order. "...

Tutorials

Good Bye 2022 -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
187469381 rainboy H Dec. 31, 2022, 5:22 p.m. OK GNU C11 TESTS 32 499 5120000
187406316 MonDellBit H Dec. 31, 2022, 4:56 a.m. OK GNU C++17 TESTS 32 78 4915200
187455690 ghaethalshaban54 H Dec. 31, 2022, 2:37 p.m. OK GNU C++17 TESTS 32 78 4915200
187453056 farhanLabib2537 H Dec. 31, 2022, 2:04 p.m. OK GNU C++17 (64) TESTS 32 46 2764800
187441445 IsraelWinningIOI2023 H Dec. 31, 2022, 11:51 a.m. OK GNU C++17 (64) TESTS 32 46 2764800
187469660 mdshadesh H Dec. 31, 2022, 5:26 p.m. OK GNU C++20 (64) TESTS 32 93 4300800
187399391 Messi_GOAT H Dec. 31, 2022, 2:23 a.m. OK Rust 2021 TESTS 32 31 5017600
187384877 Benq H Dec. 30, 2022, 7:41 p.m. OK Rust 2021 TESTS 32 31 5017600

remove filters

Back to search problems