Codeforces Round 572 (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
1188 Codeforces Round 572 (Div. 1) FINISHED False 7200 175100087 July 5, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8528 ) A1 Add on a Tree PROGRAMMING trees 1600

B'Note that this is the first problem of the two similar problems. You can hack this problem only if you solve both problems. You are given a tree with n nodes. In the beginning, 0 is written on all edges. In one operation, you can choose any 2 distinct leaves u , v and any real number x and add x to values written on all edges on the simple path between u and v . For example, on the picture below you can see the result of applying two operations to the graph: adding 2 on the path from 7 to 6 , and then adding -0.5 on the path from 4 to 5 . Is it true that for any configuration of real numbers written on edges, we can achieve it with a finite number of operations? Leaf is a node of a tree of degree 1 . Simple path is a path that doesn 't contain any node twice. The first line contains a single integer n ( 2 <= n <= 10^5 ) -- the number of nodes. Each of the next n-1 lines contains two integers u and v ( 1 <= u, v <= n , u neq v ), meaning that there is an edge between nodes u and v . It is guaranteed that these edges form a tree. If there is a configuration of real numbers written on edges of the tree that we can 't achieve by performing the operations, output "NO". Otherwise, output "YES". You can print each letter in any case (upper or lower). In the first example, we can add any real x to the value written on the only edge (1, 2) . In the second example, one of configurations that we can 't reach is 0 written on (1, 2) and 1 written on (2, 3) . Below you can see graphs from examples 3 , 4 : '...

Tutorials

Editorial of Codeforces Round #572

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56586505 hos.lyric A1 July 5, 2019, 4:40 p.m. OK D TESTS 44 78 4300800 1600
56564144 iica A1 July 5, 2019, 3:14 p.m. OK D TESTS 44 171 22835200 1600
57184703 HoangVu123 A1 July 17, 2019, 8:20 a.m. OK FPC TESTS 44 61 409600 1600
56835926 sansen A1 July 11, 2019, 9:03 a.m. OK GNU C11 TESTS 44 31 409600 1600
61019420 nikhilreddy123 A1 Sept. 21, 2019, 2:12 p.m. OK GNU C11 TESTS 44 46 409600 1600
56651660 TsReaper A1 July 7, 2019, 7:50 a.m. OK GNU C11 TESTS 44 46 409600 1600
59123690 luogu_bot4 A1 Aug. 20, 2019, 7:18 a.m. OK GNU C++11 TESTS 44 31 204800 1600
58221172 Frame233 A1 Aug. 3, 2019, 12:36 p.m. OK GNU C++11 TESTS 44 31 204800 1600
56561972 _rqy A1 July 5, 2019, 3:09 p.m. OK GNU C++11 TESTS 44 31 204800 1600
59127026 luogu_bot5 A1 Aug. 20, 2019, 9:30 a.m. OK GNU C++11 TESTS 44 31 204800 1600
59123845 luogu_bot4 A1 Aug. 20, 2019, 7:24 a.m. OK GNU C++11 TESTS 44 31 307200 1600
64278731 BrianPan A1 Nov. 4, 2019, 11:53 p.m. OK GNU C++11 TESTS 44 31 409600 1600
64054815 lokyo A1 Nov. 2, 2019, 12:38 a.m. OK GNU C++11 TESTS 44 31 409600 1600
64295624 luogu_bot5 A1 Nov. 5, 2019, 8:31 a.m. OK GNU C++11 TESTS 44 31 409600 1600
64353185 SimonSU A1 Nov. 6, 2019, 9:12 a.m. OK GNU C++11 TESTS 44 31 409600 1600
64349429 _I_Snow_Shine_ A1 Nov. 6, 2019, 7:43 a.m. OK GNU C++11 TESTS 44 31 409600 1600
56632320 tokitsukaze A1 July 6, 2019, 5:10 p.m. OK GNU C++14 TESTS 44 30 512000 1600
57012667 quachtridat A1 July 14, 2019, 10:04 a.m. OK GNU C++14 TESTS 44 46 409600 1600
56774974 hodduc A1 July 10, 2019, 2:02 a.m. OK GNU C++14 TESTS 44 46 409600 1600
56601849 SongC A1 July 6, 2019, 1:21 a.m. OK GNU C++14 TESTS 44 46 409600 1600
56566251 ztc. A1 July 5, 2019, 3:19 p.m. OK GNU C++14 TESTS 44 46 409600 1600
56566097 spacewalker A1 July 5, 2019, 3:18 p.m. OK GNU C++14 TESTS 44 46 409600 1600
56564067 BSBandme A1 July 5, 2019, 3:14 p.m. OK GNU C++14 TESTS 44 46 409600 1600
59123919 cqbz999222888 A1 Aug. 20, 2019, 7:27 a.m. OK GNU C++14 TESTS 44 46 409600 1600
62045769 xzt_2 A1 Oct. 7, 2019, 7:29 a.m. OK GNU C++14 TESTS 44 46 409600 1600
57080351 zhugezy A1 July 15, 2019, 7:01 a.m. OK GNU C++14 TESTS 44 46 409600 1600
57506410 lesskreker A1 July 22, 2019, 12:11 p.m. OK GNU C++17 TESTS 44 31 409600 1600
56600375 nickluo A1 July 5, 2019, 11:19 p.m. OK GNU C++17 TESTS 44 31 921600 1600
58975260 dinosaurs A1 Aug. 17, 2019, 11:55 p.m. OK GNU C++17 TESTS 44 46 409600 1600
68232916 charity A1 Jan. 5, 2020, 9:52 a.m. OK GNU C++17 TESTS 44 46 409600 1600
64135640 passer__by A1 Nov. 3, 2019, 6:59 a.m. OK GNU C++17 TESTS 44 46 409600 1600
61265548 hjk1030 A1 Sept. 25, 2019, 12:40 p.m. OK GNU C++17 TESTS 44 46 409600 1600
59551513 HighLights A1 Aug. 27, 2019, 3:22 a.m. OK GNU C++17 TESTS 44 46 409600 1600
58148106 RNS_CUS A1 Aug. 2, 2019, 12:09 a.m. OK GNU C++17 TESTS 44 46 409600 1600
57487135 vjudge1 A1 July 22, 2019, 5:48 a.m. OK GNU C++17 TESTS 44 46 409600 1600
56862628 Hipo_3412 A1 July 12, 2019, 12:28 a.m. OK GNU C++17 TESTS 44 46 409600 1600
57075860 efimmanevich A1 July 15, 2019, 5:08 a.m. OK Go TESTS 44 140 0 1600
57434000 HCI A1 July 21, 2019, 3:32 a.m. OK Go TESTS 44 155 4505600 1600
56566480 caidodo0_0 A1 July 5, 2019, 3:19 p.m. OK Go TESTS 44 171 0 1600
69220995 zhanyi_xiaolu A1 Jan. 21, 2020, 4:38 a.m. OK Java 11 TESTS 44 217 0 1600
64546306 zekigurbuz A1 Nov. 8, 2019, 8:23 p.m. OK Java 11 TESTS 44 312 15974400 1600
63722880 prituladima A1 Oct. 29, 2019, 11:51 a.m. OK Java 11 TESTS 44 483 39219200 1600
56568579 nchn27 A1 July 5, 2019, 3:25 p.m. OK Java 8 TESTS 44 124 0 1600
59633786 qwerty787788 A1 Aug. 28, 2019, 7:30 p.m. OK Java 8 TESTS 44 140 0 1600
58941390 aman28rwt A1 Aug. 17, 2019, 7:04 a.m. OK Java 8 TESTS 44 140 0 1600
58875954 zmurzagaliev A1 Aug. 15, 2019, 5:51 p.m. OK Java 8 TESTS 44 155 0 1600
56693527 kpbochenek A1 July 8, 2019, 5:41 a.m. OK Java 8 TESTS 44 155 0 1600
56634288 di_halt A1 July 6, 2019, 6:23 p.m. OK Java 8 TESTS 44 155 0 1600
56634227 di_halt A1 July 6, 2019, 6:20 p.m. OK Java 8 TESTS 44 155 0 1600
56593241 AnandOza A1 July 5, 2019, 6:12 p.m. OK Java 8 TESTS 44 155 0 1600
56574462 fetetriste A1 July 5, 2019, 3:43 p.m. OK Java 8 TESTS 44 155 0 1600
56561815 jdurie A1 July 5, 2019, 3:09 p.m. OK Java 8 TESTS 44 155 0 1600
56564519 knightL A1 July 5, 2019, 3:15 p.m. OK Kotlin TESTS 44 295 204800 1600
56639749 darnley A1 July 6, 2019, 11:53 p.m. OK Kotlin TESTS 44 295 1331200 1600
56563697 darnley A1 July 5, 2019, 3:13 p.m. OK Kotlin TESTS 44 342 1331200 1600
56628950 -arg A1 July 6, 2019, 3:17 p.m. OK Kotlin TESTS 44 483 5632000 1600
56570863 eki A1 July 5, 2019, 3:31 p.m. OK Mono C# TESTS 44 124 4300800 1600
56564902 claw88 A1 July 5, 2019, 3:16 p.m. OK Mono C# TESTS 44 140 3481600 1600
58869897 scorpiowf A1 Aug. 15, 2019, 2:56 p.m. OK MS C++ TESTS 44 46 409600 1600
58797088 vjudge1 A1 Aug. 14, 2019, 5:41 a.m. OK MS C++ TESTS 44 46 409600 1600
56869447 cumt_fyj971217 A1 July 12, 2019, 5:38 a.m. OK MS C++ TESTS 44 46 409600 1600
58817191 vjudge2 A1 Aug. 14, 2019, 12:53 p.m. OK MS C++ TESTS 44 46 819200 1600
56563083 math957963 A1 July 5, 2019, 3:11 p.m. OK MS C++ TESTS 44 46 819200 1600
56866012 vjudge1 A1 July 12, 2019, 3:07 a.m. OK MS C++ TESTS 44 139 409600 1600
57564939 vjudge3 A1 July 23, 2019, 2:37 a.m. OK MS C++ TESTS 44 140 409600 1600
56575201 BaturaDima A1 July 5, 2019, 3:46 p.m. OK MS C++ TESTS 44 186 4096000 1600
56563405 Milanin A1 July 5, 2019, 3:12 p.m. OK MS C++ 2017 TESTS 44 62 409600 1600
58813222 vjudge1 A1 Aug. 14, 2019, 11:35 a.m. OK MS C++ 2017 TESTS 44 77 409600 1600
56562007 NVAL A1 July 5, 2019, 3:09 p.m. OK MS C++ 2017 TESTS 44 78 409600 1600
57487587 hld67890 A1 July 22, 2019, 5:57 a.m. OK MS C++ 2017 TESTS 44 78 512000 1600
66187951 CtrlAlt A1 Dec. 2, 2019, 3:16 p.m. OK MS C++ 2017 TESTS 44 156 409600 1600
57455776 EverRest A1 July 21, 2019, 11:34 a.m. OK MS C++ 2017 TESTS 44 171 409600 1600
57185724 cousins A1 July 17, 2019, 8:38 a.m. OK MS C++ 2017 TESTS 44 171 409600 1600
56674383 xsc A1 July 7, 2019, 2:43 p.m. OK MS C++ 2017 TESTS 44 171 409600 1600
56563000 I.Smirn0ff A1 July 5, 2019, 3:11 p.m. OK MS C++ 2017 TESTS 44 171 409600 1600
57146231 nik1998 A1 July 16, 2019, 1:01 p.m. OK MS C++ 2017 TESTS 44 171 6963200 1600
56619806 mayakin A1 July 6, 2019, 11:31 a.m. OK PHP TESTS 44 124 5836800 1600
56579115 pajenegod A1 July 5, 2019, 4:01 p.m. OK PyPy 2 TESTS 44 140 7372800 1600
56563036 aeternalis1 A1 July 5, 2019, 3:11 p.m. OK PyPy 2 TESTS 44 732 9318400 1600
69648298 roaris A1 Jan. 28, 2020, 3:23 a.m. OK PyPy 3 TESTS 44 264 5120000 1600
56564903 titia A1 July 5, 2019, 3:16 p.m. OK PyPy 3 TESTS 44 327 11264000 1600
61078266 nikeshthapa255 A1 Sept. 22, 2019, 3:21 p.m. OK PyPy 3 TESTS 44 343 12595200 1600
56564136 Kiri8128 A1 July 5, 2019, 3:14 p.m. OK PyPy 3 TESTS 44 358 11878400 1600
56957747 pineriver A1 July 13, 2019, 5:26 a.m. OK PyPy 3 TESTS 44 358 14233600 1600
58526446 PhilTheFish A1 Aug. 10, 2019, 7:21 a.m. OK PyPy 3 TESTS 44 888 8192000 1600
56652145 praveen_yadav A1 July 7, 2019, 7:55 a.m. OK PyPy 3 TESTS 44 889 8294400 1600
64614924 lke_python A1 Nov. 10, 2019, 4:13 a.m. OK PyPy 3 TESTS 44 904 11673600 1600
59024204 FedorianZ A1 Aug. 18, 2019, 2:29 p.m. OK PyPy 3 TESTS 44 919 8192000 1600
57367803 hg17june A1 July 20, 2019, 9:46 a.m. OK PyPy 3 TESTS 44 920 11366400 1600
56561996 nwi A1 July 5, 2019, 3:09 p.m. OK Python 2 TESTS 44 249 11161600 1600
56606678 Indecchi A1 July 6, 2019, 5:08 a.m. OK Python 2 TESTS 44 343 2764800 1600
56606402 Indecchi A1 July 6, 2019, 4:57 a.m. OK Python 2 TESTS 44 343 2764800 1600
57529660 Helli.code A1 July 22, 2019, 3:16 p.m. OK Python 2 TESTS 44 373 2048000 1600
58480527 soumyasarkar1998 A1 Aug. 9, 2019, 5:18 a.m. OK Python 2 TESTS 44 374 2048000 1600
56717790 sy_chen A1 July 8, 2019, 3:22 p.m. OK Python 2 TESTS 44 389 2048000 1600
56628237 ahcub A1 July 6, 2019, 2:59 p.m. OK Python 3 TESTS 44 311 7987200 1600
61603396 wattaihei A1 Oct. 1, 2019, 11:52 a.m. OK Python 3 TESTS 44 327 10035200 1600
58108815 codershuvo A1 Aug. 1, 2019, 6:03 a.m. OK Python 3 TESTS 44 342 409600 1600
56758861 mostcleverboy A1 July 9, 2019, 3 p.m. OK Python 3 TESTS 44 343 409600 1600
62492214 tahsin_ahmed14 A1 Oct. 13, 2019, 10:35 a.m. OK Python 3 TESTS 44 358 409600 1600
56681805 ZenithINA A1 July 7, 2019, 6:58 p.m. OK Python 3 TESTS 44 358 409600 1600
56625647 WTY329 A1 July 6, 2019, 1:45 p.m. OK Python 3 TESTS 44 358 1331200 1600
56628650 spikh A1 July 6, 2019, 3:09 p.m. OK Python 3 TESTS 44 358 6451200 1600
60816658 chgliu A1 Sept. 18, 2019, 8:37 p.m. OK Python 3 TESTS 44 358 16179200 1600
56628416 kukushking A1 July 6, 2019, 3:03 p.m. OK Python 3 TESTS 44 389 1024000 1600
57257555 corvvs_ A1 July 18, 2019, 3:08 a.m. OK Ruby TESTS 44 280 409600 1600
69837131 gearjack A1 Jan. 30, 2020, 12:08 p.m. OK Rust TESTS 44 31 3276800 1600
62374406 ikazuya0201 A1 Oct. 11, 2019, 4:47 p.m. OK Rust TESTS 44 46 1331200 1600
59845379 LowR A1 Sept. 1, 2019, 9:14 a.m. OK Rust TESTS 44 62 409600 1600
56873665 gu_castle A1 July 12, 2019, 7:28 a.m. OK Rust TESTS 44 77 3686400 1600
56637918 Chenyao A1 July 6, 2019, 9:26 p.m. OK Rust TESTS 44 93 1433600 1600
59844850 LowR A1 Sept. 1, 2019, 9:02 a.m. OK Rust TESTS 44 93 3686400 1600

remove filters

Back to search problems