Codeforces Round 516 (Div. 1, by Moscow Team Olympiad)

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
1063 Codeforces Round 516 (Div. 1, by Moscow Team Olympiad) FINISHED False 7200 198014124 Oct. 14, 2018, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 360 ) E Lasers and Mirrors PROGRAMMING constructive algorithms math 3000

B'Oleg came to see the maze of mirrors. The maze is a n by n room in which each cell is either empty or contains a mirror connecting opposite corners of this cell. Mirrors in this maze reflect light in a perfect way, which causes the interesting visual effects and contributes to the loss of orientation in the maze. Oleg is a person of curious nature, so he decided to install n lasers facing internal of the maze on the south wall of the maze. On the north wall of the maze, Oleg installed n receivers, also facing internal of the maze. Let 's number lasers and receivers from west to east with distinct integers from 1 to n . Each laser sends a beam of some specific kind and receiver with number a_i should receive the beam sent from laser number i . Since two lasers ' beams can 't come to the same receiver, these numbers form a permutation -- each of the receiver numbers occurs exactly once. You came to the maze together with Oleg. Help him to place the mirrors in the initially empty maze so that the maximum number of lasers ' beams will come to the receivers they should. There are no mirrors outside the maze, so if the laser beam leaves the maze, it will not be able to go back. The first line contains a single integer n ( 1 <= n <= 1000 ) -- the size of the maze. The second line contains a permutation of n integers a_i ( 1 <= a_i <= n ), where a_i defines the number of the receiver, to which the beam from i -th laser should come. In the first line print the maximum possible number of laser beams, which can come to the receivers they should. In the next n lines of length n print the arrangement of mirrors, causing such number of laser beams to come where they should. If the corresponding cell is empty, print ".", otherwise print "/" or " ", depending on the orientation of the mirror. In your output north should be above, south should be below, and west and east shou'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
45940000 Gassa E Nov. 18, 2018, 7:05 p.m. OK D TESTS 72 46 4198400 3000
45939852 Gassa E Nov. 18, 2018, 6:58 p.m. OK D TESTS 72 46 4300800 3000
44534472 luogu_bot2 E Oct. 19, 2018, 8:15 a.m. OK GNU C++11 TESTS 72 31 0 3000
57868203 lopare E July 27, 2019, 11:01 p.m. OK GNU C++11 TESTS 72 31 819200 3000
46272228 CrazyTeaMajor E Nov. 27, 2018, 9 a.m. OK GNU C++11 TESTS 72 31 819200 3000
44491278 Max.D. E Oct. 18, 2018, 2:33 p.m. OK GNU C++11 TESTS 72 31 819200 3000
44439064 CMXRYNP E Oct. 17, 2018, 11:23 a.m. OK GNU C++11 TESTS 72 31 819200 3000
44438266 xianglingao E Oct. 17, 2018, 11:06 a.m. OK GNU C++11 TESTS 72 31 819200 3000
44343967 131131yhx E Oct. 15, 2018, 5:57 a.m. OK GNU C++11 TESTS 72 31 819200 3000
53317171 Connected_failed E April 26, 2019, 11:03 a.m. OK GNU C++11 TESTS 72 31 1024000 3000
50734548 Big_black_jujube E March 3, 2019, 12:20 p.m. OK GNU C++11 TESTS 72 31 1024000 3000
46272081 luogu_bot2 E Nov. 27, 2018, 8:54 a.m. OK GNU C++11 TESTS 72 31 1024000 3000
44307031 WA_TLE E Oct. 14, 2018, 11:14 a.m. OK GNU C++14 TESTS 72 31 0 3000
44394539 TLE E Oct. 16, 2018, 10:06 a.m. OK GNU C++14 TESTS 72 31 307200 3000
54473701 RNS_CUS E May 22, 2019, 7:09 a.m. OK GNU C++14 TESTS 72 31 1024000 3000
44749270 Pakalns E Oct. 23, 2018, 6:41 p.m. OK GNU C++14 TESTS 72 31 1024000 3000
44726577 MiFaFaOvO E Oct. 23, 2018, 8:19 a.m. OK GNU C++14 TESTS 72 31 1024000 3000
44389551 consecutivelimit E Oct. 16, 2018, 7:47 a.m. OK GNU C++14 TESTS 72 31 1024000 3000
44438355 yfzcsc E Oct. 17, 2018, 11:08 a.m. OK GNU C++14 TESTS 72 31 1228800 3000
44430100 Elegia E Oct. 17, 2018, 7:12 a.m. OK GNU C++14 TESTS 72 31 1228800 3000
44431001 georgerapeanu E Oct. 17, 2018, 7:38 a.m. OK GNU C++14 TESTS 72 31 1331200 3000
44375800 neal E Oct. 15, 2018, 9:19 p.m. OK GNU C++14 TESTS 72 31 1433600 3000
46359035 bortoz E Nov. 29, 2018, 10:03 a.m. OK GNU C++17 TESTS 72 31 1126400 3000
65528288 David-M E Nov. 22, 2019, 11:21 a.m. OK GNU C++17 TESTS 72 31 1331200 3000
64895154 flashmt E Nov. 14, 2019, 4:17 p.m. OK GNU C++17 TESTS 72 31 1331200 3000
44311650 -Wave- E Oct. 14, 2018, 11:41 a.m. OK GNU C++17 TESTS 72 31 1433600 3000
44313651 bmerry E Oct. 14, 2018, 11:53 a.m. OK GNU C++17 TESTS 72 31 1536000 3000
44314472 yujinwunz E Oct. 14, 2018, 11:57 a.m. OK GNU C++17 TESTS 72 31 2150400 3000
44317640 Marcin_smu E Oct. 14, 2018, 1:19 p.m. OK GNU C++17 TESTS 72 46 307200 3000
46254011 bortoz E Nov. 26, 2018, 3:36 p.m. OK GNU C++17 TESTS 72 46 1126400 3000
68647268 satashun E Jan. 12, 2020, 9:30 a.m. OK GNU C++17 TESTS 72 46 1228800 3000
46963268 Trote_w E Dec. 13, 2018, 9:39 a.m. OK GNU C++17 TESTS 72 46 1228800 3000
44459063 Harpae E Oct. 17, 2018, 7:24 p.m. OK Java 8 TESTS 72 155 0 3000
44623355 tri E Oct. 21, 2018, 7:46 a.m. OK Java 8 TESTS 72 171 0 3000
45030918 witchu E Oct. 29, 2018, 3:49 a.m. OK Mono C# TESTS 72 77 3072000 3000

remove filters

Back to search problems