Codeforces Round 583 (Div. 1 + Div. 2, based on Olympiad of Metropolises)

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
1214 Codeforces Round 583 (Div. 1 + Div. 2, based on Olympiad of Metropolises) FINISHED False 9000 169851287 Sept. 4, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 403 ) H Tiles Placement PROGRAMMING constructive algorithms dfs and similar trees 2700

B'The new pedestrian zone in Moscow city center consists of n squares connected with each other by n - 1 footpaths. We define a simple path as a sequence of squares such that no square appears in this sequence twice and any two adjacent squares in this sequence are directly connected with a footpath. The size of a simple path is the number of squares in it. The footpaths are designed in a such a way that there is exactly one simple path between any pair of different squares. During preparations for Moscow City Day the city council decided to renew ground tiles on all n squares. There are k tile types of different colors, numbered from 1 to k . For each square exactly one tile type must be selected and then used to cover this square surface. To make walking through the city center more fascinating, it was decided to select tiles types for each square in such a way that any possible simple path of size exactly k contains squares with all k possible tile colors. You need to find out whether it is possible to place the tiles this way or not. The first line contains two integers n , k ( 2 <= k <= n <= 200 ,000 ) -- the number of squares in the new pedestrian zone, the number of different tile colors. Each of the following n - 1 lines contains two integers v_i and u_i ( 1 <= v_i, u_i <= n ) -- numbers of the squares connected by the corresponding road. It 's guaranteed, that it 's possible to go from any square to any other square, moreover there is exactly one such simple path. Print "Yes" if it is possible to assign tile colors this way and "No" otherwise. In case your answer is "Yes", print n integers from 1 to k each, the color of the tile for every square. The following pictures illustrate the pedestrian zone in first and second examples. The second picture also shows one possible distribution of colors among the squares for k = 4 . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
60024956 hos.lyric H Sept. 4, 2019, 1:58 p.m. OK D TESTS 65 342 32870400 2700
60377250 zjczzzjczjczzzjc H Sept. 11, 2019, 7:15 a.m. OK GNU C++11 TESTS 65 62 13619200 2700
60355420 Kloze H Sept. 10, 2019, 3:57 p.m. OK GNU C++11 TESTS 65 78 24985600 2700
60053399 miaokehao H Sept. 5, 2019, 2:21 a.m. OK GNU C++11 TESTS 65 93 9625600 2700
60445690 GCCCCCCC H Sept. 12, 2019, 2:04 p.m. OK GNU C++11 TESTS 65 93 21196800 2700
62246719 RealFreddy H Oct. 10, 2019, 6:42 a.m. OK GNU C++11 TESTS 65 93 24985600 2700
61826561 ReaLNero1 H Oct. 4, 2019, 5:01 a.m. OK GNU C++11 TESTS 65 93 24985600 2700
60064878 orzorz_moeDzW H Sept. 5, 2019, 8:42 a.m. OK GNU C++11 TESTS 65 108 13619200 2700
60531308 TimeLimitExceed H Sept. 14, 2019, 12:35 p.m. OK GNU C++11 TESTS 65 109 17920000 2700
60370494 AutumnKite H Sept. 11, 2019, 1:17 a.m. OK GNU C++11 TESTS 65 109 19456000 2700
60020669 cuizhuyefei H Sept. 4, 2019, 1:02 p.m. OK GNU C++11 TESTS 65 109 19763200 2700
60081706 idxcalcal H Sept. 5, 2019, 2:16 p.m. OK GNU C++14 TESTS 65 124 19046400 2700
60597685 liblibal-sett H Sept. 15, 2019, 6:40 a.m. OK GNU C++14 TESTS 65 140 17408000 2700
60509507 mayaohua2003 H Sept. 14, 2019, 1:27 a.m. OK GNU C++14 TESTS 65 171 13824000 2700
61528591 Rabbittank H Sept. 30, 2019, 1:09 a.m. OK GNU C++14 TESTS 65 171 20172800 2700
60384107 kqp H Sept. 11, 2019, 10:44 a.m. OK GNU C++14 TESTS 65 186 9420800 2700
60251060 jerome_wei H Sept. 8, 2019, 6:47 a.m. OK GNU C++14 TESTS 65 186 13107200 2700
60183165 Zoli9 H Sept. 6, 2019, 5:13 p.m. OK GNU C++14 TESTS 65 187 10547200 2700
60074577 m4h H Sept. 5, 2019, 12:12 p.m. OK GNU C++14 TESTS 65 187 20172800 2700
60051904 haas H Sept. 5, 2019, 1:08 a.m. OK GNU C++14 TESTS 65 187 21811200 2700
63665506 Toxel H Oct. 28, 2019, 3:11 p.m. OK GNU C++14 TESTS 65 187 22835200 2700
60053891 naitir H Sept. 5, 2019, 2:48 a.m. OK GNU C++17 TESTS 65 140 33689600 2700
60313506 apostoldaniel854 H Sept. 9, 2019, 4:52 p.m. OK GNU C++17 TESTS 65 171 17817600 2700
62063394 Super_M. H Oct. 7, 2019, 2:23 p.m. OK GNU C++17 TESTS 65 171 20172800 2700
66154200 ToTLeS H Dec. 1, 2019, 8:53 p.m. OK GNU C++17 TESTS 65 171 23347200 2700
60032711 saketh H Sept. 4, 2019, 3:51 p.m. OK GNU C++17 TESTS 65 187 10956800 2700
60253139 flashmt H Sept. 8, 2019, 7:57 a.m. OK GNU C++17 TESTS 65 187 17510400 2700
60357556 rohanpota94 H Sept. 10, 2019, 4:49 p.m. OK GNU C++17 TESTS 65 187 17817600 2700
60012318 Isonan H Sept. 4, 2019, 11:15 a.m. OK GNU C++17 TESTS 65 187 21401600 2700
60018338 heno239 H Sept. 4, 2019, 12:33 p.m. OK GNU C++17 TESTS 65 202 12902400 2700
60381728 CQzhangyu H Sept. 11, 2019, 9:30 a.m. OK GNU C++17 TESTS 65 202 13926400 2700
66134941 dalt H Dec. 1, 2019, 11:51 a.m. OK Java 8 TESTS 65 686 142540800 2700

remove filters

Back to search problems