Codeforces Round 564 (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
1172 Codeforces Round 564 (Div. 1) FINISHED False 7200 171914099 June 7, 2019, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 506 ) D Nauuo and Portals PROGRAMMING constructive algorithms 2800

B'Nauuo is a girl who loves playing games related to portals. One day she was playing a game as follows. In an n x n grid, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. We denote a cell on the intersection of the r -th row and c -th column as (r,c) . A portal is a pair of doors. You can travel from one of them to another without changing your direction. More formally, if you walk into a cell with a door, you will teleport to the cell with the other door of the same portal and then walk into the next cell facing the original direction. There can not be more than one doors in a single cell. The "next cell" is the nearest cell in the direction you are facing. For example, if you are facing bottom, the next cell of (2,5) is (3,5) . If you walk into a cell without a door, you must walk into the next cell after that without changing the direction. If the next cell does not exist, you must exit the grid. You have to set some (possibly zero) portals in the grid, so that if you walk into (i,1) facing right, you will eventually exit the grid from (r_i,n) , if you walk into (1, i) facing bottom, you will exit the grid from (n,c_i) . It is guaranteed that both r_{1..n} and c_{1..n} are permutations of n elements. A permutation of n elements is a sequence of numbers p_1,p_2, ldots,p_n in which every integer from 1 to n appears exactly once. She got confused while playing the game, can you help her to find a solution? The first line contains a single integer n ( 1 <= n <= 1000 ) -- the side length of the grid. The second line contains n integers r_1,r_2, ldots,r_n ( 1 <= r_i <= n ) -- if you walk into (i,1) facing right, you should exit the grid from (r_i,n) . It is guaranteed that r_{1..n} is a permutation of n elements. The third line'...

Tutorials

Codeforces Round #564 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68393562 geneanlyz D Jan. 8, 2020, 9:51 a.m. OK GNU C++11 TESTS 163 31 0 2800
65952163 vjudge1 D Nov. 29, 2019, 11:19 a.m. OK GNU C++11 TESTS 163 31 0 2800
63222387 Ivan_w D Oct. 23, 2019, 8:16 a.m. OK GNU C++11 TESTS 163 31 0 2800
62310071 CaptainSlow D Oct. 10, 2019, 1:41 p.m. OK GNU C++11 TESTS 163 31 0 2800
61323394 luogu_bot5 D Sept. 26, 2019, 1:09 p.m. OK GNU C++11 TESTS 163 31 0 2800
59598282 CQUzbx D Aug. 28, 2019, 3:56 a.m. OK GNU C++11 TESTS 163 31 0 2800
58414126 YaoBIG D Aug. 7, 2019, 3:36 a.m. OK GNU C++11 TESTS 163 31 0 2800
58196473 luogu_bot2 D Aug. 3, 2019, 12:52 a.m. OK GNU C++11 TESTS 163 31 0 2800
57919537 A.K.E.E. D July 29, 2019, 3:50 a.m. OK GNU C++11 TESTS 163 31 0 2800
57886953 AloneKnight D July 28, 2019, 10:21 a.m. OK GNU C++11 TESTS 163 31 0 2800
60527587 _DYT D Sept. 14, 2019, 11:01 a.m. OK GNU C++14 TESTS 163 31 0 2800
55535560 gasin D June 13, 2019, 4:12 p.m. OK GNU C++14 TESTS 163 31 0 2800
55325146 cloudsky01 D June 9, 2019, 7:34 a.m. OK GNU C++14 TESTS 163 31 0 2800
55289027 rainy_season D June 8, 2019, 6:43 a.m. OK GNU C++14 TESTS 163 31 0 2800
55285622 zhouzhendong D June 8, 2019, 4:40 a.m. OK GNU C++14 TESTS 163 31 0 2800
63690638 Toxel D Oct. 29, 2019, 2:21 a.m. OK GNU C++14 TESTS 163 31 102400 2800
61322626 HIR180 D Sept. 26, 2019, 1 p.m. OK GNU C++14 TESTS 163 31 102400 2800
59669795 Quang D Aug. 29, 2019, 3:34 p.m. OK GNU C++14 TESTS 163 31 102400 2800
59643297 Marckess D Aug. 29, 2019, 3:52 a.m. OK GNU C++14 TESTS 163 31 102400 2800
57920234 ThomasX D July 29, 2019, 4:21 a.m. OK GNU C++14 TESTS 163 31 102400 2800
67062203 mtsd D Dec. 17, 2019, 9:35 a.m. OK GNU C++17 TESTS 163 31 0 2800
67062187 mtsd D Dec. 17, 2019, 9:35 a.m. OK GNU C++17 TESTS 163 31 0 2800
67062079 mtsd D Dec. 17, 2019, 9:32 a.m. OK GNU C++17 TESTS 163 31 0 2800
61319512 semiexp D Sept. 26, 2019, 12:08 p.m. OK GNU C++17 TESTS 163 31 0 2800
56732658 lizhidan D July 9, 2019, 2:43 a.m. OK GNU C++17 TESTS 163 31 0 2800
56433527 Charles_Han D July 2, 2019, 1:07 p.m. OK GNU C++17 TESTS 163 31 0 2800
55615274 gubeiqg D June 16, 2019, 8:31 a.m. OK GNU C++17 TESTS 163 31 0 2800
55381294 Ilya_MSU D June 9, 2019, 8:53 p.m. OK GNU C++17 TESTS 163 31 0 2800
55287495 llbra9z D June 8, 2019, 5:53 a.m. OK GNU C++17 TESTS 163 31 0 2800
55274159 Shayan.P D June 7, 2019, 5:58 p.m. OK GNU C++17 TESTS 163 31 0 2800
55292481 dalt D June 8, 2019, 8:20 a.m. OK Java 8 TESTS 163 140 0 2800
55260444 Egor D June 7, 2019, 1:19 p.m. OK Java 8 TESTS 163 140 0 2800
55286917 whatshisbucket D June 8, 2019, 5:33 a.m. OK Python 3 TESTS 163 234 140185600 2800
57806710 Helli.code D July 26, 2019, 3:27 p.m. OK Python 3 TESTS 163 265 140185600 2800

remove filters

Back to search problems