Codeforces Round 680 (Div. 1, based on 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
1444 Codeforces Round 680 (Div. 1, based on Moscow Team Olympiad) FINISHED False 7200 133037663 Nov. 1, 2020, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 615 ) D Rectangular Polyline PROGRAMMING constructive algorithms dp geometry

B'One drew a closed polyline on a plane, that consisted only of vertical and horizontal segments (parallel to the coordinate axes). The segments alternated between horizontal and vertical ones (a horizontal segment was always followed by a vertical one, and vice versa). The polyline did not contain strict self-intersections, which means that in case any two segments shared a common point, that point was an endpoint for both of them (please consult the examples in the notes section). Unfortunately, the polyline was erased, and you only know the lengths of the horizonal and vertical segments. Please construct any polyline matching the description with such segments, or determine that it does not exist. The first line contains one integer t ( 1 <= q t <= q 200 ) --the number of test cases. The first line of each test case contains one integer h ( 1 <= q h <= q 1000 ) -- the number of horizontal segments. The following line contains h integers l_1, l_2, ... , l_h ( 1 <= q l_i <= q 1000 ) -- lengths of the horizontal segments of the polyline, in arbitrary order. The following line contains an integer v ( 1 <= q v <= q 1000 ) -- the number of vertical segments, which is followed by a line containing v integers p_1, p_2, ... , p_v ( 1 <= q p_i <= q 1000 ) -- lengths of the vertical segments of the polyline, in arbitrary order. Test cases are separated by a blank line, and the sum of values h + v over all test cases does not exceed 1000 . For each test case output Yes, if there exists at least one polyline satisfying the requirements, or No otherwise. If it does exist, in the following n lines print the coordinates of the polyline vertices, in order of the polyline traversal: the i -th line should contain two integers x_i and y_i -- coordinates of the i -th vertex. Note that, each polyline segment must be either horizontal or vertical, and the segments '...

Tutorials

Codeforces Round #680 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
97376572 georgerapeanu D Nov. 1, 2020, 5:38 p.m. OK Clang++17 Diagnostics TESTS 42 811 262348800
97344354 5times187 D Nov. 1, 2020, 12:34 p.m. OK GNU C++11 TESTS 40 62 63488000
97379322 huangxiaohua D Nov. 1, 2020, 6:24 p.m. OK GNU C++11 TESTS 42 62 79360000
97379646 huangxiaohua D Nov. 1, 2020, 6:30 p.m. OK GNU C++11 TESTS 42 78 79360000
97364141 nwi D Nov. 1, 2020, 2:46 p.m. OK GNU C++11 TESTS 40 93 2048000
97390874 gmh77 D Nov. 2, 2020, 1:07 a.m. OK GNU C++11 TESTS 42 93 125747200
97351486 penguin1017 D Nov. 1, 2020, 12:57 p.m. OK GNU C++11 TESTS 40 109 125849600
97371632 MiricaMatei D Nov. 1, 2020, 4:19 p.m. OK GNU C++11 TESTS 42 109 256102400
97357300 ynsm D Nov. 1, 2020, 1:36 p.m. OK GNU C++11 TESTS 40 124 9625600
97342896 Isonan D Nov. 1, 2020, 12:30 p.m. OK GNU C++11 TESTS 40 124 62976000
97341601 TadijaSebez D Nov. 1, 2020, 12:26 p.m. OK GNU C++11 TESTS 40 124 127488000
97358730 A.K.E.E. D Nov. 1, 2020, 1:48 p.m. OK GNU C++14 TESTS 40 46 16076800
97366129 kmjp D Nov. 1, 2020, 3:09 p.m. OK GNU C++14 TESTS 40 46 16691200
97340895 yhx-12243 D Nov. 1, 2020, 12:24 p.m. OK GNU C++14 TESTS 40 62 66150400
97356987 voover D Nov. 1, 2020, 1:34 p.m. OK GNU C++14 TESTS 40 78 201523200
97343802 posij118 D Nov. 1, 2020, 12:33 p.m. OK GNU C++14 TESTS 40 109 2150400
97359158 AhoCorasick D Nov. 1, 2020, 1:52 p.m. OK GNU C++14 TESTS 40 109 125849600
97389037 AhoCorasick D Nov. 1, 2020, 11:29 p.m. OK GNU C++14 TESTS 42 109 126361600
97349018 TiwAirOAO D Nov. 1, 2020, 12:49 p.m. OK GNU C++14 TESTS 40 109 126566400
97359021 Argentina D Nov. 1, 2020, 1:51 p.m. OK GNU C++14 TESTS 40 139 254976000
97363752 AhoCorasick D Nov. 1, 2020, 2:42 p.m. OK GNU C++14 TESTS 40 140 167116800
97359225 hank55663 D Nov. 1, 2020, 1:53 p.m. OK GNU C++17 TESTS 40 46 31641600
97368598 peti1234 D Nov. 1, 2020, 3:39 p.m. OK GNU C++17 TESTS 42 61 40345600
97348921 Rafbill D Nov. 1, 2020, 12:49 p.m. OK GNU C++17 TESTS 40 61 66355200
97367838 timf1089 D Nov. 1, 2020, 3:30 p.m. OK GNU C++17 TESTS 41 62 15769600
97348249 Hazyknight D Nov. 1, 2020, 12:47 p.m. OK GNU C++17 TESTS 40 62 32051200
97345955 p6pou D Nov. 1, 2020, 12:39 p.m. OK GNU C++17 TESTS 40 62 63283200
97356214 Amoo_Safar D Nov. 1, 2020, 1:29 p.m. OK GNU C++17 TESTS 40 77 12390400
97347842 tEMMIE.w. D Nov. 1, 2020, 12:45 p.m. OK GNU C++17 TESTS 40 93 32563200
97376379 VEGAnn D Nov. 1, 2020, 5:36 p.m. OK GNU C++17 TESTS 42 93 33177600
97386946 paulica D Nov. 1, 2020, 9:41 p.m. OK GNU C++17 TESTS 42 93 62976000
97391221 Dreaminger D Nov. 2, 2020, 1:22 a.m. OK GNU C++17 (64) TESTS 42 46 31744000
97340003 hos.lyric D Nov. 1, 2020, 12:21 p.m. OK GNU C++17 (64) TESTS 40 46 31744000
97358138 Subconscious D Nov. 1, 2020, 1:43 p.m. OK GNU C++17 (64) TESTS 40 62 15769600
97345333 neal D Nov. 1, 2020, 12:37 p.m. OK GNU C++17 (64) TESTS 40 62 15769600
97346935 KevinWan D Nov. 1, 2020, 12:43 p.m. OK GNU C++17 (64) TESTS 40 62 32051200
97393561 qazswedx2 D Nov. 2, 2020, 2:49 a.m. OK GNU C++17 (64) TESTS 42 62 34508800
97350451 boboniu D Nov. 1, 2020, 12:54 p.m. OK GNU C++17 (64) TESTS 40 62 69836800
97374366 dorijanlendvaj D Nov. 1, 2020, 5:02 p.m. OK GNU C++17 (64) TESTS 42 62 150528000
97344956 noimi D Nov. 1, 2020, 12:36 p.m. OK GNU C++17 (64) TESTS 40 77 62873600
97337709 jiangly D Nov. 1, 2020, 12:14 p.m. OK GNU C++17 (64) TESTS 40 92 31641600
97353981 uwi D Nov. 1, 2020, 1:03 p.m. OK Java 11 TESTS 40 1934 241254400
97360195 cwise D Nov. 1, 2020, 2:02 p.m. OK Java 8 TESTS 40 779 140083200
97386331 dominotim D Nov. 1, 2020, 9:17 p.m. OK MS C++ 2017 TESTS 42 280 1024000
97368211 kclee2172 D Nov. 1, 2020, 3:34 p.m. OK PyPy 3 TESTS 41 233 34508800

remove filters

Back to search problems