Educational Codeforces Round 19

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
797 Educational Codeforces Round 19 FINISHED False 7200 245258724 April 15, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1865 ) D Broken BST PROGRAMMING data structures dfs and similar 2200

B"Let T be arbitrary binary tree -- tree, every vertex of which has no more than two children. Given tree is rooted, so there exists only one vertex which doesn't have a parent -- it's the root of a tree. Every vertex has an integer number written on it. Following algorithm is run on every value from the tree T: Here is the pseudo-code of the described algorithm: The described algorithm works correctly if the tree is binary search tree (i.e. for each node the values of left subtree are less than the value in the node, the values of right subtree are greater than the value in the node). But it can return invalid result if tree is not a binary search tree. Since the given tree is not necessarily a binary search tree, not all numbers can be found this way. Your task is to calculate, how many times the search will fail being running on every value from the tree. If the tree has multiple vertices with the same values on them then you should run algorithm on every one of them separately. First line contains integer number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- number of vertices in the tree. Each of the next n lines contains 3 numbers v, l, r (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- value on current vertex, index of the left child of the vertex and index of the right child of the vertex, respectively. If some child doesn't exist then number xe2 x80 x89- xe2 x80 x891 is set instead. Note that different vertices of the tree may contain the same values. Print number of times when search algorithm will fail. In the example the root of the tree in vertex 2. Search of numbers 5 and 15 will return fail because on the first step algorithm will choose the subtree which doesn't contain numbers you are looking for. "...

Tutorials

51588

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26416721 quintessence D April 16, 2017, 3:39 p.m. OK GNU C++ TESTS 55 31 3788800 2200
26416631 vjudge1 D April 16, 2017, 3:38 p.m. OK GNU C++ TESTS 55 31 3788800 2200
40981765 ReaLNero1 D July 30, 2018, 6:08 p.m. OK GNU C++ TESTS 55 31 10035200 2200
26407501 Immortal.S D April 16, 2017, 7:51 a.m. OK GNU C++ TESTS 55 31 12083200 2200
26391534 ACMLCZH D April 15, 2017, 4:10 p.m. OK GNU C++ TESTS 55 31 12083200 2200
40981209 ReaLNero1 D July 30, 2018, 5:52 p.m. OK GNU C++ TESTS 55 46 10035200 2200
33260521 Scut82 D Dec. 15, 2017, 10:20 a.m. OK GNU C++ TESTS 55 46 14131200 2200
26696750 HbFS- D April 27, 2017, 6:11 a.m. OK GNU C++ TESTS 55 46 26112000 2200
26394962 ugly2333 D April 15, 2017, 5:12 p.m. OK GNU C++ TESTS 55 61 4300800 2200
27349596 150420 D May 26, 2017, 6:17 a.m. OK GNU C++ TESTS 55 61 4812800 2200
26407683 danagi D April 16, 2017, 7:59 a.m. OK GNU C++11 TESTS 55 31 4608000 2200
53891865 vjudge5 D May 9, 2019, 1:17 a.m. OK GNU C++11 TESTS 55 46 4608000 2200
57874793 lopare D July 28, 2019, 4:32 a.m. OK GNU C++11 TESTS 55 61 1843200 2200
26784736 2bcn D May 1, 2017, 11:47 a.m. OK GNU C++11 TESTS 55 61 3686400 2200
26784627 2bcn D May 1, 2017, 11:39 a.m. OK GNU C++11 TESTS 55 61 3686400 2200
27718409 SoSad D June 11, 2017, 9:26 a.m. OK GNU C++11 TESTS 55 61 4812800 2200
57769918 py_ultron D July 25, 2019, 11:37 p.m. OK GNU C++11 TESTS 55 62 1843200 2200
26570029 ljaneczk D April 21, 2017, 10:20 p.m. OK GNU C++11 TESTS 55 62 3686400 2200
26404583 szszsz D April 16, 2017, 5:30 a.m. OK GNU C++11 TESTS 55 62 3788800 2200
26391663 beach D April 15, 2017, 4:11 p.m. OK GNU C++11 TESTS 55 62 3788800 2200
52634034 zerotohero D April 12, 2019, 8:53 a.m. OK GNU C++14 TESTS 55 78 2764800 2200
26490998 echo80313 D April 19, 2017, 7:58 a.m. OK GNU C++14 TESTS 55 78 3788800 2200
26479753 iKID.Huy D April 18, 2017, 4:07 p.m. OK GNU C++14 TESTS 55 78 3891200 2200
54503229 zstu_MingSD D May 23, 2019, 12:53 a.m. OK GNU C++14 TESTS 55 78 3993600 2200
32044996 chinmay0906 D Nov. 4, 2017, 7:09 a.m. OK GNU C++14 TESTS 55 78 4812800 2200
27932856 -Morass- D June 20, 2017, 9:52 p.m. OK GNU C++14 TESTS 55 78 5120000 2200
26387340 Hasan0540 D April 15, 2017, 3:26 p.m. OK GNU C++14 TESTS 55 78 6656000 2200
26453281 orz010orz D April 17, 2017, 11:37 a.m. OK GNU C++14 TESTS 55 78 6963200 2200
26390344 DimaWoogy D April 15, 2017, 3:56 p.m. OK GNU C++14 TESTS 55 78 10137600 2200
56522970 abhayps D July 4, 2019, 3:48 p.m. OK GNU C++14 TESTS 55 93 4096000 2200
48576623 endereye D Jan. 19, 2019, 2:24 p.m. OK GNU C++17 TESTS 55 78 2252800 2200
57375007 errorgorn D July 20, 2019, 12:15 p.m. OK GNU C++17 TESTS 55 78 3584000 2200
58222561 Phortox D Aug. 3, 2019, 1:09 p.m. OK GNU C++17 TESTS 55 93 3584000 2200
69282957 amiralisalimi D Jan. 22, 2020, 6:49 a.m. OK GNU C++17 TESTS 55 93 4710400 2200
68357996 Zihad_Bd D Jan. 7, 2020, 12:56 p.m. OK GNU C++17 TESTS 55 108 5017600 2200
61744182 Durumu D Oct. 2, 2019, 10:21 p.m. OK GNU C++17 TESTS 55 109 4198400 2200
54799540 Lucina D May 29, 2019, 11:19 a.m. OK GNU C++17 TESTS 55 109 5017600 2200
46098961 Toliman D Nov. 23, 2018, 3:47 a.m. OK GNU C++17 TESTS 55 109 5017600 2200
41232813 coder_h D Aug. 5, 2018, 5:05 a.m. OK GNU C++17 TESTS 55 109 9728000 2200
44081861 vjudge5 D Oct. 10, 2018, 3:26 p.m. OK GNU C++17 TESTS 55 109 9932800 2200
26442076 only_methol D April 16, 2017, 11:43 p.m. OK Go TESTS 55 155 39833600 2200
28484177 mouse_wireless D July 12, 2017, 10:07 p.m. OK Haskell TESTS 55 373 90214400 2200
26389527 uwi D April 15, 2017, 3:48 p.m. OK Java 8 TESTS 55 156 25292800 2200
26592305 kwetril D April 22, 2017, 10:36 p.m. OK Java 8 TESTS 55 171 27033600 2200
26392441 pitfall D April 15, 2017, 4:20 p.m. OK Java 8 TESTS 55 187 30208000 2200
60232373 jakejase2 D Sept. 7, 2019, 4:55 p.m. OK Java 8 TESTS 55 218 14848000 2200
26753177 niteWarior D April 29, 2017, 5:10 p.m. OK Java 8 TESTS 55 249 36454400 2200
26506049 sintax_eror D April 20, 2017, 1:05 a.m. OK Java 8 TESTS 55 264 35942400 2200
53021494 StayAwayFromBitches D April 19, 2019, 4:41 p.m. OK Java 8 TESTS 55 264 69939200 2200
26397952 megaspazz D April 15, 2017, 8:15 p.m. OK Java 8 TESTS 55 265 82124800 2200
27212574 Kammola D May 19, 2017, 10:49 a.m. OK Java 8 TESTS 55 280 13721600 2200
26388873 shalamanov.marin D April 15, 2017, 3:41 p.m. OK Java 8 TESTS 55 280 25190400 2200
26400191 simonmysun D April 15, 2017, 11:46 p.m. OK JavaScript TESTS 55 452 16076800 2200
26396247 og.kostya D April 15, 2017, 6:14 p.m. OK MS C# TESTS 55 171 14745600 2200
26400275 iamexist D April 15, 2017, 11:57 p.m. OK MS C++ TESTS 55 77 6860800 2200
26416006 thphong D April 16, 2017, 3:10 p.m. OK MS C++ TESTS 55 78 5632000 2200
26399093 RCG D April 15, 2017, 9:48 p.m. OK MS C++ TESTS 55 93 6860800 2200
28407225 mshcherba D July 10, 2017, 12:38 p.m. OK MS C++ TESTS 55 93 7372800 2200
26704490 dzhaba D April 27, 2017, 2:18 p.m. OK MS C++ TESTS 55 140 15769600 2200
26453232 Ancient_mage D April 17, 2017, 11:35 a.m. OK MS C++ TESTS 55 234 5120000 2200
26463342 TheConfessor D April 17, 2017, 7:46 p.m. OK MS C++ TESTS 55 265 6656000 2200
26538115 _mactep D April 21, 2017, 1:09 p.m. OK MS C++ TESTS 55 265 7884800 2200
26670244 goodhope D April 25, 2017, 8:02 p.m. OK MS C++ TESTS 55 265 8601600 2200
26395674 Cabpacob D April 15, 2017, 5:43 p.m. OK MS C++ TESTS 55 265 133222400 2200
51118319 kill-z D March 10, 2019, 8 a.m. OK MS C++ 2017 TESTS 55 265 7987200 2200
57708252 pseuda D July 24, 2019, 9:34 p.m. OK MS C++ 2017 TESTS 55 389 13619200 2200
26531334 shilcare D April 21, 2017, 5:56 a.m. OK Python 2 TESTS 55 514 20172800 2200
36406163 A.Yazdani D March 19, 2018, 8:59 a.m. OK Python 2 TESTS 55 967 28160000 2200
37581588 pyrus D April 24, 2018, 6:47 p.m. OK Python 3 TESTS 55 639 25190400 2200
33009610 nathantheinventor jacob.brazeal D Dec. 7, 2017, 8:12 p.m. OK Python 3 TESTS 55 826 20889600 2200

remove filters

Back to search problems