Codeforces Round 599 (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
1242 Codeforces Round 599 (Div. 1) FINISHED False 7200 164127263 Nov. 6, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 131 ) E Planar Perimeter PROGRAMMING constructive algorithms graphs 3200

B'Ujan has finally cleaned up his house and now wants to decorate the interior. He decided to place a beautiful carpet that would really tie the guest room together. He is interested in carpets that are made up of polygonal patches such that each side of a patch is either a side of another (different) patch, or is an exterior side of the whole carpet. In other words, the carpet can be represented as a planar graph, where each patch corresponds to a face of the graph, each face is a simple polygon. The perimeter of the carpet is the number of the exterior sides. Ujan considers a carpet beautiful if it consists of f patches, where the i -th patch has exactly a_i sides, and the perimeter is the smallest possible. Find an example of such a carpet, so that Ujan can order it! The first line of input contains a single integer f ( 1 <= q f <= q 10^5 ), the number of patches in the carpet. The next line contains f integers a_1, ldots, a_f ( 3 <= q a_i <= q 3 cdot 10^5 ), the number of sides of the patches. The total number of the sides of the patches a_1 + ldots + a_f does not exceed 3 cdot10^5 . Output the description of the carpet as a graph. First, output a single integer n ( 3 <= q n <= q 3 cdot 10^5 ), the total number of vertices in your graph (the vertices must be numbered from 1 to n ). Then output f lines containing the description of the faces. The i -th line should describe the i -th face and contain a_i distinct integers v_{i,1}, ldots, v_{i,a_i} ( 1 <= q v_{i,j} <= q n ), which means that the vertices v_{i,j} and v_{i,(j bmod{a_i})+1} are connected by an edge for any 1 <= q j <= q a_i . The graph should be planar and satisfy the restrictions described in the problem statement. Its perimeter should be the smallest possible. There should be no double edges or self-loops in the graph. The graph should be connected. Note that a'...

Tutorials

Codeforces Round #599 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64435055 rainboy E Nov. 7, 2019, 12:39 a.m. OK GNU C++11 TESTS 67 78 4812800 3200
64421338 rainboy E Nov. 6, 2019, 5:55 p.m. OK GNU C++11 TESTS 67 93 7168000 3200
68453440 dysyn1314 E Jan. 9, 2020, 3:12 p.m. OK GNU C++11 TESTS 67 109 11468800 3200
66763268 frodakcin E Dec. 13, 2019, 7:20 a.m. OK GNU C++11 TESTS 67 124 29081600 3200
64465068 WZYYN E Nov. 7, 2019, 11:31 a.m. OK GNU C++11 TESTS 67 155 15155200 3200
64554816 msuwakow E Nov. 9, 2019, 2:50 a.m. OK GNU C++11 TESTS 67 155 32870400 3200
64657640 duality E Nov. 10, 2019, 7:45 p.m. OK GNU C++11 TESTS 67 156 14745600 3200
65936159 jiangly E Nov. 29, 2019, 2:19 a.m. OK GNU C++14 TESTS 67 93 4608000 3200
64424736 ecnerwala E Nov. 6, 2019, 6:49 p.m. OK GNU C++14 TESTS 67 93 6758400 3200
66414488 Toxel E Dec. 6, 2019, 4:32 p.m. OK GNU C++14 TESTS 67 108 8601600 3200
64567445 JioFell E Nov. 9, 2019, 8:04 a.m. OK GNU C++14 TESTS 67 108 9932800 3200
65031118 NoTeamName E Nov. 15, 2019, 9:55 a.m. OK GNU C++14 TESTS 67 109 6758400 3200
64419348 ecnerwala E Nov. 6, 2019, 5:41 p.m. OK GNU C++14 TESTS 67 124 13414400 3200
65223620 Motarack E Nov. 16, 2019, 11:08 p.m. OK GNU C++14 TESTS 67 139 37478400 3200
64411659 Marcin_smu E Nov. 6, 2019, 4:45 p.m. OK GNU C++14 TESTS 67 140 11673600 3200
64606150 Nikitosh E Nov. 9, 2019, 8:47 p.m. OK GNU C++14 TESTS 67 202 28774400 3200
64420461 MiFaFaOvO E Nov. 6, 2019, 5:47 p.m. OK GNU C++14 TESTS 67 249 190464000 3200
65267041 saafgh E Nov. 17, 2019, 5:36 p.m. OK GNU C++17 TESTS 67 93 4915200 3200
69940569 gongsuidashen E Feb. 1, 2020, 6 a.m. OK GNU C++17 TESTS 67 93 4915200 3200
64642824 Xellos E Nov. 10, 2019, 1:49 p.m. OK GNU C++17 TESTS 67 93 5632000 3200
64631273 user202729_ E Nov. 10, 2019, 10:14 a.m. OK GNU C++17 TESTS 67 93 5836800 3200
65113441 LightInShadow E Nov. 16, 2019, 1:28 a.m. OK GNU C++17 TESTS 67 93 7577600 3200
64555984 StepMommy E Nov. 9, 2019, 3:44 a.m. OK GNU C++17 TESTS 67 108 7577600 3200
64432380 esrever E Nov. 6, 2019, 10:10 p.m. OK GNU C++17 TESTS 67 109 4710400 3200
65507002 krijgertje E Nov. 21, 2019, 11:50 p.m. OK GNU C++17 TESTS 67 109 5529600 3200
64580504 keko37 E Nov. 9, 2019, 11:57 a.m. OK GNU C++17 TESTS 67 139 22732800 3200
64590416 bmerry E Nov. 9, 2019, 2:35 p.m. OK GNU C++17 TESTS 67 155 14233600 3200
64435054 Dukkha E Nov. 7, 2019, 12:39 a.m. OK Java 11 TESTS 67 390 3993600 3200

remove filters

Back to search problems