Codeforces Round 559 (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
1158 Codeforces Round 559 (Div. 1) FINISHED False 7200 218733923 May 12, 2019, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 927 ) D Winding polygonal line PROGRAMMING constructive algorithms geometry greedy math 2800

Vasya has n different points A_1, A_2, ldots A_n on the plane. No three of them lie on the same line He wants to place them in some order A_{p_1}, A_{p_2}, ldots, A_{p_n} , where p_1, p_2, ldots, p_n -- some permutation of integers from 1 to n . After doing so, he will draw oriented polygonal line on these points, drawing oriented segments from each point to the next in the chosen order. So, for all 1 <= q i <= q n-1 he will draw oriented segment from point A_{p_i} to point A_{p_{i+1}} . He wants to make this polygonal line satisfying 2 conditions: Vasya has a string s , consisting of (n-2) symbols "L" or "R". Let 's call an oriented polygonal line winding, if its i -th turn left, if s_i = "L" and right, if s_i = "R". More formally: i -th turn will be in point A_{p_{i+1}} , where oriented segment from point A_{p_i} to point A_{p_{i+1}} changes to oriented segment from point A_{p_{i+1}} to point A_{p_{i+2}} . Let 's define vectors overrightarrow{v_1} = overrightarrow{A_{p_i} A_{p_{i+1}}} and overrightarrow{v_2} = overrightarrow{A_{p_{i+1}} A_{p_{i+2}}} . Then if in order to rotate the vector overrightarrow{v_1} by the smallest possible angle, so that its direction coincides with the direction of the vector overrightarrow{v_2} we need to make a turn counterclockwise, then we say that i -th turn is to the left, and otherwise to the right. For better understanding look at this pictures with some examples of turns: You are given coordinates of the points A_1, A_2, ldots A_n on the plane and string s . Find a permutation p_1, p_2, ldots, p_n of the integers from 1 to n , such that the polygonal line, drawn by Vasya satisfy two necessary conditions. The first line contains one integer n -- the number of points ( 3 <= q n <= q 2000 ). Next n lines contains two i

Tutorials

66993

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
58994595 nantf D Aug. 18, 2019, 10:48 a.m. OK GNU C++11 TESTS 75 31 1433600 2800
64635513 2016wudi D Nov. 10, 2019, 11:28 a.m. OK GNU C++11 TESTS 75 46 0 2800
63355093 songpengyu D Oct. 25, 2019, 1:52 a.m. OK GNU C++11 TESTS 75 46 0 2800
61395640 lzoiexplorer2004 D Sept. 28, 2019, 1:58 a.m. OK GNU C++11 TESTS 75 46 0 2800
61216261 CaptainSlow D Sept. 24, 2019, 12:48 p.m. OK GNU C++11 TESTS 75 46 0 2800
57916490 AloneKnight D July 29, 2019, 1:44 a.m. OK GNU C++11 TESTS 75 46 0 2800
57866053 lopare D July 27, 2019, 9:05 p.m. OK GNU C++11 TESTS 75 46 0 2800
56048072 LMOliver D June 25, 2019, 5:35 p.m. OK GNU C++11 TESTS 75 46 0 2800
55326787 WZYYN D June 9, 2019, 8:34 a.m. OK GNU C++11 TESTS 75 46 0 2800
55060709 justin_cao D June 3, 2019, 10:23 p.m. OK GNU C++11 TESTS 75 46 0 2800
62968238 lqs2015 D Oct. 20, 2019, 5:48 a.m. OK GNU C++14 TESTS 75 46 0 2800
59694007 shifanyiakioi D Aug. 30, 2019, 7:38 a.m. OK GNU C++14 TESTS 75 46 0 2800
58975491 Scut82 D Aug. 18, 2019, 12:12 a.m. OK GNU C++14 TESTS 75 46 0 2800
58956114 Scut82 D Aug. 17, 2019, 1:05 p.m. OK GNU C++14 TESTS 75 46 0 2800
58956112 Scut82 D Aug. 17, 2019, 1:05 p.m. OK GNU C++14 TESTS 75 46 0 2800
58955782 Scut82 D Aug. 17, 2019, 12:56 p.m. OK GNU C++14 TESTS 75 46 0 2800
58949927 Scut82 D Aug. 17, 2019, 10:34 a.m. OK GNU C++14 TESTS 75 46 0 2800
58948320 Scut82 D Aug. 17, 2019, 9:53 a.m. OK GNU C++14 TESTS 75 46 0 2800
58567660 Libitina D Aug. 11, 2019, 8:41 a.m. OK GNU C++14 TESTS 75 46 0 2800
56702306 schtomi97 D July 8, 2019, 9:40 a.m. OK GNU C++14 TESTS 75 46 0 2800
63370742 user202729_ D Oct. 25, 2019, 9:16 a.m. OK GNU C++17 TESTS 75 31 0 2800
60312408 Medeowex D Sept. 9, 2019, 4:24 p.m. OK GNU C++17 TESTS 75 31 102400 2800
54033510 maroonrk D May 12, 2019, 3:02 p.m. OK GNU C++17 TESTS 75 31 6758400 2800
66284926 how_to_become_purple D Dec. 4, 2019, 6:48 p.m. OK GNU C++17 TESTS 75 46 0 2800
64726816 Arpa D Nov. 12, 2019, 6:46 a.m. OK GNU C++17 TESTS 75 46 0 2800
64721508 Arpa D Nov. 12, 2019, 3:53 a.m. OK GNU C++17 TESTS 75 46 0 2800
61530873 dragonslayerintraining D Sept. 30, 2019, 3 a.m. OK GNU C++17 TESTS 75 46 0 2800
55860816 drade0 D June 21, 2019, 9:28 a.m. OK GNU C++17 TESTS 75 46 0 2800
55509528 KrK D June 12, 2019, 8:40 p.m. OK GNU C++17 TESTS 75 46 0 2800
55334008 CMXRYNP D June 9, 2019, 12:39 p.m. OK GNU C++17 TESTS 75 46 0 2800
54042595 mmaxio D May 12, 2019, 4:07 p.m. OK Java 8 TESTS 75 156 0 2800
54320005 4mda4mda D May 17, 2019, 8:26 p.m. OK Java 8 TESTS 75 171 0 2800
54039122 darnley D May 12, 2019, 3:39 p.m. OK Java 8 TESTS 75 171 0 2800
54047252 Harpae D May 12, 2019, 5:54 p.m. OK Java 8 TESTS 75 186 0 2800
54060873 dalt D May 13, 2019, 11:10 a.m. OK Java 8 TESTS 75 202 0 2800
54041538 uwi D May 12, 2019, 3:58 p.m. OK Java 8 TESTS 75 202 0 2800
54034420 xiaowuc1 D May 12, 2019, 3:07 p.m. OK Java 8 TESTS 75 233 0 2800
54039638 Egor D May 12, 2019, 3:43 p.m. OK Java 8 TESTS 75 343 0 2800
54539658 DmitryGrigorev D May 23, 2019, 11:33 p.m. OK Kotlin TESTS 75 857 204800 2800
54042517 icecuber D May 12, 2019, 4:06 p.m. OK PyPy 2 TESTS 75 514 5017600 2800
54470929 burhonbaqoyev D May 22, 2019, 5:25 a.m. OK PyPy 2 TESTS 75 529 6041600 2800
54356345 EbTech D May 18, 2019, 5:49 p.m. OK Rust TESTS 75 46 204800 2800
54342325 EbTech D May 18, 2019, 10:54 a.m. OK Rust TESTS 75 46 204800 2800
54323437 EbTech D May 18, 2019, 12:03 a.m. OK Rust TESTS 75 46 204800 2800
54323760 EbTech D May 18, 2019, 12:31 a.m. OK Rust TESTS 75 61 204800 2800
55060881 EbTech D June 3, 2019, 10:32 p.m. OK Rust TESTS 75 62 0 2800
54323455 EbTech D May 18, 2019, 12:06 a.m. OK Rust TESTS 75 62 204800 2800

remove filters

Back to search problems