Codeforces Round 394 (Div. 2)

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
761 Codeforces Round 394 (Div. 2) FINISHED False 7200 245949899 Jan. 31, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2182 ) E Dasha and Puzzle PROGRAMMING constructive algorithms dfs and similar graphs greedy trees 2000

B'Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity -- origami, but remembered the puzzle that she could not solve. The tree is a non-oriented connected graph without cycles. In particular, there always are n xe2 x80 x89- xe2 x80 x891 edges in a tree with n vertices. The puzzle is to position the vertices at the points of the Cartesian plane with integral coordinates, so that the segments between the vertices connected by edges are parallel to the coordinate axes. Also, the intersection of segments is allowed only at their ends. Distinct vertices should be placed at different points. Help Dasha to find any suitable way to position the tree vertices on the plane. It is guaranteed that if it is possible to position the tree vertices on the plane without violating the condition which is given above, then you can do it by using points with integral coordinates which don 't exceed 1018 in absolute value. The first line contains single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8930) -- the number of vertices in the tree. Each of next n xe2 x80 x89- xe2 x80 x891 lines contains two integers ui, vi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ui, xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) that mean that the i-th edge of the tree connects vertices ui and vi. It is guaranteed that the described graph is a tree. If the puzzle doesn 't have a solution then in the only line print "NO". Otherwise, the first line should contain "YES". The next n lines should contain the pair of integers xi, yi (|xi|, xe2 x80 x89|yi| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891018) -- the coordinates of the point which corresponds to the i-th vertex of the tree. If there are several solutions, print any of them. In the first sample one of the possible positions of tree is: '...

Tutorials

Codeforces Round #394 (Div. 2) [Editorial]

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
30903825 wuyiqi E Oct. 1, 2017, 8:55 a.m. OK FPC TESTS 60 15 0 2000
24365003 bzh E Feb. 2, 2017, 1:19 p.m. OK FPC TESTS 60 15 1638400 2000
24315866 Tommyr7 E Jan. 31, 2017, 4:05 p.m. OK FPC TESTS 60 15 1638400 2000
24321782 Zeron E Jan. 31, 2017, 5:38 p.m. OK FPC TESTS 60 31 1638400 2000
24319162 tin1412 E Jan. 31, 2017, 4:31 p.m. OK FPC TESTS 60 31 1843200 2000
24407885 Gray_58 E Feb. 3, 2017, 10:51 a.m. OK FPC TESTS 60 31 7680000 2000
24328276 rainboy E Jan. 31, 2017, 9:53 p.m. OK GNU C TESTS 60 15 1843200 2000
24324892 Tebak_Siapa_Aku E Jan. 31, 2017, 7:04 p.m. OK GNU C TESTS 60 15 1843200 2000
24316600 sgtlaugh E Jan. 31, 2017, 4:10 p.m. OK GNU C TESTS 60 15 1843200 2000
24314398 Totodile17 E Jan. 31, 2017, 3:55 p.m. OK GNU C TESTS 60 15 1843200 2000
24330302 TsReaper E Feb. 1, 2017, 12:52 a.m. OK GNU C TESTS 60 31 1843200 2000
31705210 vjudge1 E Oct. 25, 2017, 10:18 a.m. OK GNU C++ TESTS 60 15 0 2000
27787881 SHRst E June 15, 2017, 6:55 a.m. OK GNU C++ TESTS 60 15 0 2000
27607061 kezhiying E June 6, 2017, 7:01 a.m. OK GNU C++ TESTS 60 15 0 2000
27473843 oXman038 E May 31, 2017, 8:16 p.m. OK GNU C++ TESTS 60 15 0 2000
26973442 qiaoranpenxiang E May 9, 2017, 12:19 p.m. OK GNU C++ TESTS 60 15 0 2000
28774352 EurusHolmes E July 22, 2017, 9:08 a.m. OK GNU C++ TESTS 60 15 1945600 2000
28491098 vjudge4 E July 13, 2017, 5:52 a.m. OK GNU C++ TESTS 60 15 1945600 2000
24358712 BUAAduhao E Feb. 2, 2017, 6:51 a.m. OK GNU C++ TESTS 60 15 1945600 2000
24335584 Hrisk E Feb. 1, 2017, 7:33 a.m. OK GNU C++ TESTS 60 15 1945600 2000
24319598 ACMLCZH E Jan. 31, 2017, 4:34 p.m. OK GNU C++ TESTS 60 15 1945600 2000
31122002 biltharesatyendra E Oct. 7, 2017, 4:20 p.m. OK GNU C++11 TESTS 60 15 0 2000
31115197 buaacai E Oct. 7, 2017, 12:50 p.m. OK GNU C++11 TESTS 60 15 0 2000
31115057 buaacai E Oct. 7, 2017, 12:46 p.m. OK GNU C++11 TESTS 60 15 0 2000
31005592 Maniac_Wallnut E Oct. 5, 2017, 1:59 a.m. OK GNU C++11 TESTS 60 15 0 2000
30992216 VinayakaB E Oct. 4, 2017, 12:54 p.m. OK GNU C++11 TESTS 60 15 0 2000
30992131 VinayakaB E Oct. 4, 2017, 12:50 p.m. OK GNU C++11 TESTS 60 15 0 2000
30318179 Jayzhang E Sept. 14, 2017, 12:44 a.m. OK GNU C++11 TESTS 60 15 0 2000
29865687 CookiC E Aug. 29, 2017, 12:25 p.m. OK GNU C++11 TESTS 60 15 0 2000
29848587 BinZhao E Aug. 28, 2017, 3:11 p.m. OK GNU C++11 TESTS 60 15 0 2000
29555227 Flavius E Aug. 18, 2017, 2:17 p.m. OK GNU C++11 TESTS 60 15 0 2000
31189931 BBuf E Oct. 10, 2017, 12:48 p.m. OK GNU C++14 TESTS 60 15 0 2000
30323415 pb0207 E Sept. 14, 2017, 8:59 a.m. OK GNU C++14 TESTS 60 15 102400 2000
27684644 MoliH97 E June 9, 2017, 7:48 a.m. OK GNU C++14 TESTS 60 15 102400 2000
27458961 kingsmad E May 31, 2017, 4:20 a.m. OK GNU C++14 TESTS 60 15 102400 2000
26915156 MasterMind0108 E May 7, 2017, 3:35 a.m. OK GNU C++14 TESTS 60 15 102400 2000
26915069 MasterMind0108 E May 7, 2017, 3:26 a.m. OK GNU C++14 TESTS 60 15 102400 2000
26915023 MasterMind0108 E May 7, 2017, 3:21 a.m. OK GNU C++14 TESTS 60 15 102400 2000
49783773 seo E Feb. 11, 2019, 6:41 p.m. OK GNU C++14 TESTS 60 15 204800 2000
32569048 mola.mola E Nov. 23, 2017, 7:56 a.m. OK GNU C++14 TESTS 60 15 204800 2000
32155036 imnotreal E Nov. 9, 2017, 10:28 a.m. OK GNU C++14 TESTS 60 15 204800 2000
39075570 shivendra_k E June 9, 2018, 5:48 p.m. OK GNU C++17 TESTS 60 15 204800 2000
38774357 47th-draganov E May 30, 2018, 1:18 p.m. OK GNU C++17 TESTS 60 15 3788800 2000
52664096 Gene_Liu E April 13, 2019, 3:11 a.m. OK GNU C++17 TESTS 60 30 0 2000
58947211 Test2311 E Aug. 17, 2019, 9:32 a.m. OK GNU C++17 TESTS 60 30 102400 2000
67645205 the_hyp0cr1t3 E Dec. 26, 2019, 9:50 a.m. OK GNU C++17 TESTS 60 30 204800 2000
56215094 quake0 E June 28, 2019, 9:42 a.m. OK GNU C++17 TESTS 60 30 204800 2000
52605587 vjudge1 E April 11, 2019, 1:45 p.m. OK GNU C++17 TESTS 60 30 204800 2000
39877264 Martin53 E July 2, 2018, 7:19 p.m. OK GNU C++17 TESTS 60 30 204800 2000
38773508 karasek E May 30, 2018, 12:51 p.m. OK GNU C++17 TESTS 60 30 3788800 2000
38798270 Mr_leon E May 31, 2018, 10:42 a.m. OK GNU C++17 TESTS 60 30 8294400 2000
25840404 pitfall E March 27, 2017, 2:32 p.m. OK Java 8 TESTS 60 109 20582400 2000
54217178 nullptr2 E May 15, 2019, 10:56 p.m. OK Java 8 TESTS 60 124 0 2000
54215472 zhijunlicd E May 15, 2019, 8:33 p.m. OK Java 8 TESTS 60 124 0 2000
31029647 Jeel_Vaishnav E Oct. 5, 2017, 10:16 a.m. OK Java 8 TESTS 60 124 0 2000
30768365 Slamur E Sept. 27, 2017, 5:41 a.m. OK Java 8 TESTS 60 124 0 2000
30768311 Slamur E Sept. 27, 2017, 5:38 a.m. OK Java 8 TESTS 60 124 0 2000
24319275 gpita E Jan. 31, 2017, 4:32 p.m. OK Java 8 TESTS 60 124 20275200 2000
24317457 bohuss E Jan. 31, 2017, 4:16 p.m. OK Java 8 TESTS 60 124 20275200 2000
24315634 arock E Jan. 31, 2017, 4:04 p.m. OK Java 8 TESTS 60 124 20275200 2000
24314073 Ahmad_Elsagheer E Jan. 31, 2017, 3:53 p.m. OK Java 8 TESTS 60 124 20275200 2000
35204870 aleex E Feb. 13, 2018, 4:03 p.m. OK Kotlin TESTS 60 171 22732800 2000
24318358 Zvigintsev E Jan. 31, 2017, 4:23 p.m. OK MS C# TESTS 60 62 9113600 2000
24323267 artsin666 E Jan. 31, 2017, 6:12 p.m. OK MS C# TESTS 60 77 9113600 2000
24322595 og.kostya E Jan. 31, 2017, 5:56 p.m. OK MS C# TESTS 60 77 11468800 2000
24323028 emelyan E Jan. 31, 2017, 6:05 p.m. OK MS C# TESTS 60 108 11468800 2000
26131508 RCG E April 4, 2017, 8:20 p.m. OK MS C++ TESTS 60 15 2048000 2000
25454693 fenderclock E March 13, 2017, 1:27 p.m. OK MS C++ TESTS 60 15 2048000 2000
24673589 dklsfjlksdfj E Feb. 14, 2017, 3:01 p.m. OK MS C++ TESTS 60 15 2048000 2000
24599734 Flowersea E Feb. 12, 2017, 2:05 a.m. OK MS C++ TESTS 60 15 2048000 2000
24465773 Jason_Lee E Feb. 6, 2017, 9:27 a.m. OK MS C++ TESTS 60 15 2048000 2000
24445339 SSW E Feb. 5, 2017, 5:35 a.m. OK MS C++ TESTS 60 15 2048000 2000
24363038 Gasai_Yuno_2nd E Feb. 2, 2017, 11:40 a.m. OK MS C++ TESTS 60 15 2048000 2000
24360697 Diplomate E Feb. 2, 2017, 9:40 a.m. OK MS C++ TESTS 60 15 2048000 2000
24347701 _mactep E Feb. 1, 2017, 3:21 p.m. OK MS C++ TESTS 60 15 2048000 2000
24319267 ovProphet E Jan. 31, 2017, 4:32 p.m. OK MS C++ TESTS 60 15 2048000 2000
66161469 Svlad_Cjelli E Dec. 2, 2019, 4:50 a.m. OK Ocaml TESTS 60 15 0 2000
24317867 osev E Jan. 31, 2017, 4:19 p.m. OK PyPy 2 TESTS 60 77 21913600 2000
24314623 NicolasK E Jan. 31, 2017, 3:57 p.m. OK PyPy 2 TESTS 60 77 22016000 2000
24433558 lazy_af E Feb. 4, 2017, 2 p.m. OK PyPy 2 TESTS 60 78 21913600 2000
39275292 aeternalis1 E June 15, 2018, 9:26 p.m. OK PyPy 2 TESTS 60 93 0 2000
24433582 har_vi E Feb. 4, 2017, 2:02 p.m. OK PyPy 2 TESTS 60 93 21913600 2000
24329565 cfcfs E Jan. 31, 2017, 11:38 p.m. OK PyPy 2 TESTS 60 109 22016000 2000
24332131 artmch E Feb. 1, 2017, 3:42 a.m. OK PyPy 3 TESTS 60 186 23142400 2000
24320980 Vosatorp E Jan. 31, 2017, 5:23 p.m. OK PyPy 3 TESTS 60 186 23142400 2000
42332180 petiteteaparty E Sept. 1, 2018, 10:57 a.m. OK PyPy 3 TESTS 60 187 512000 2000
24317039 jebwizoscar E Jan. 31, 2017, 4:13 p.m. OK Python 2 TESTS 60 62 4710400 2000
24364219 BIGCHENG E Feb. 2, 2017, 12:38 p.m. OK Python 2 TESTS 60 77 5017600 2000
24320343 MBogda E Jan. 31, 2017, 5:10 p.m. OK Python 3 TESTS 60 62 4915200 2000
24317910 Boterphile E Jan. 31, 2017, 4:20 p.m. OK Python 3 TESTS 60 62 4915200 2000
34997205 yugle7 E Feb. 7, 2018, noon OK Python 3 TESTS 60 62 5632000 2000
36286293 ShapeBlaze E March 14, 2018, 8:10 p.m. OK Python 3 TESTS 60 77 5734400 2000
24349764 cgfs10000 E Feb. 1, 2017, 4:27 p.m. OK Python 3 TESTS 60 109 5120000 2000
67139661 NocturneBflat E Dec. 18, 2019, 6:10 a.m. OK Python 3 TESTS 60 124 307200 2000

remove filters

Back to search problems