Codeforces Round 168 (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
274 Codeforces Round 168 (Div. 1) FINISHED False 7200 376064987 Feb. 20, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5086 ) B Zero Tree PROGRAMMING dfs and similar dp greedy trees 2000

B"A tree is a graph with n vertices and exactly n xe2 x80 x89- xe2 x80 x891 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices. A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T. You're given a tree with n vertices. Consider its vertices numbered with integers from 1 to n. Additionally an integer is written on every vertex of this tree. Initially the integer written on the i-th vertex is equal to vi. In one move you can apply the following operation: Calculate the minimum number of moves that is required to make all the integers written on the vertices of the given tree equal to zero. The first line of the input contains n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Each of the next n xe2 x80 x89- xe2 x80 x891 lines contains two integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1, xe2 x80 x89v2, xe2 x80 x89..., xe2 x80 x89vn (|vi| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specifier."...

Tutorials

Codeforces Round #168 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3160028 Timur_Keks B Feb. 20, 2013, 5:09 p.m. OK Delphi TESTS 27 93 7680000 2000
3155782 IgorL B Feb. 20, 2013, 4:18 p.m. OK Delphi TESTS 27 93 15667200 2000
3162372 MrJigan1488 B Feb. 20, 2013, 6:10 p.m. OK Delphi TESTS 27 93 36249600 2000
3162551 MrJigan1488 B Feb. 20, 2013, 6:16 p.m. OK Delphi TESTS 27 93 37888000 2000
3168718 Mosyagin B Feb. 21, 2013, 6:10 p.m. OK Delphi TESTS 27 109 12288000 2000
4317214 Misha100896 B Aug. 20, 2013, 7:27 p.m. OK Delphi TESTS 27 124 36249600 2000
3158885 KaiZeR B Feb. 20, 2013, 4:54 p.m. OK Delphi TESTS 27 125 18432000 2000
3167221 AleksanderBalobanov B Feb. 21, 2013, 12:11 p.m. OK Delphi TESTS 27 187 23756800 2000
3314412 nhphuongltv B March 14, 2013, 6:58 a.m. OK FPC TESTS 27 109 6758400 2000
3329727 hiepsieunhan B March 17, 2013, 9:41 a.m. OK FPC TESTS 27 109 6963200 2000
3175743 Fedosik B Feb. 23, 2013, 10:16 a.m. OK FPC TESTS 27 109 38502400 2000
5525444 bognden100w B Dec. 26, 2013, 2:45 p.m. OK FPC TESTS 27 124 9830400 2000
3167494 nhandi B Feb. 21, 2013, 1:04 p.m. OK FPC TESTS 27 125 6963200 2000
3153943 con_nha_ngheo B Feb. 20, 2013, 3:58 p.m. OK FPC TESTS 27 125 6963200 2000
3750279 _Mao_ B May 20, 2013, 1:54 p.m. OK FPC TESTS 27 125 10137600 2000
3166566 Oryshych B Feb. 21, 2013, 9:57 a.m. OK FPC TESTS 27 125 10137600 2000
3155606 M0sTik B Feb. 20, 2013, 4:16 p.m. OK FPC TESTS 27 125 38195200 2000
3153663 Alex_2oo8 B Feb. 20, 2013, 3:55 p.m. OK FPC TESTS 27 140 6963200 2000
18055703 TsReaper B May 24, 2016, 1:04 p.m. OK GNU C TESTS 27 186 11059200 2000
27333914 ShinriiTin B May 25, 2017, 10:27 a.m. OK GNU C++ TESTS 27 62 10240000 2000
23555441 vjudge4 B Jan. 5, 2017, 1:24 p.m. OK GNU C++ TESTS 27 62 11468800 2000
3171058 sokian B Feb. 22, 2013, 7:43 a.m. OK GNU C++ TESTS 27 62 12902400 2000
3174597 ACMonster B Feb. 23, 2013, 1:30 a.m. OK GNU C++ TESTS 27 78 11366400 2000
13691660 unknown_shadow B Oct. 17, 2015, 12:21 p.m. OK GNU C++ TESTS 27 92 5017600 2000
38351270 Sooke B May 17, 2018, 1:57 p.m. OK GNU C++ TESTS 27 92 9011200 2000
27102639 SoSad B May 14, 2017, 7:52 a.m. OK GNU C++ TESTS 27 92 9420800 2000
42111044 vjudge4 B Aug. 26, 2018, 6:02 a.m. OK GNU C++ TESTS 27 92 10444800 2000
22108581 Cydiater B Nov. 8, 2016, 8:50 a.m. OK GNU C++ TESTS 27 92 10752000 2000
9605078 halfo B Jan. 28, 2015, 4 p.m. OK GNU C++ TESTS 27 92 11571200 2000
3163548 htc550605125 B Feb. 20, 2013, 7:44 p.m. OK GNU C++0x TESTS 27 62 11366400 2000
3157884 savinov B Feb. 20, 2013, 4:42 p.m. OK GNU C++0x TESTS 27 78 11776000 2000
8669671 Duxar B Nov. 12, 2014, 9:57 a.m. OK GNU C++0x TESTS 27 124 11776000 2000
3155015 krdln B Feb. 20, 2013, 4:09 p.m. OK GNU C++0x TESTS 27 125 11366400 2000
3806559 Edvard B May 31, 2013, 10:43 a.m. OK GNU C++0x TESTS 27 140 11366400 2000
3163407 GuyUpLion B Feb. 20, 2013, 7:29 p.m. OK GNU C++0x TESTS 27 140 11366400 2000
3167767 hex539 B Feb. 21, 2013, 1:58 p.m. OK GNU C++0x TESTS 27 140 11776000 2000
3155522 stan B Feb. 20, 2013, 4:15 p.m. OK GNU C++0x TESTS 27 140 12902400 2000
3155166 MinakoKojima B Feb. 20, 2013, 4:10 p.m. OK GNU C++0x TESTS 27 140 12902400 2000
3158459 boleyn.su B Feb. 20, 2013, 4:49 p.m. OK GNU C++0x TESTS 27 140 13312000 2000
58673745 rainboy B Aug. 12, 2019, 3:32 p.m. OK GNU C11 TESTS 27 124 11161600 2000
44351451 msuwakow B Oct. 15, 2018, 10:22 a.m. OK GNU C++11 TESTS 27 92 5939200 2000
48664438 KING_LRL B Jan. 21, 2019, 7:27 a.m. OK GNU C++11 TESTS 27 92 6144000 2000
43024334 luogu_bot5 B Sept. 18, 2018, 7:37 a.m. OK GNU C++11 TESTS 27 92 9011200 2000
46367501 qkoqhh B Nov. 29, 2018, 1:55 p.m. OK GNU C++11 TESTS 27 92 9216000 2000
48773306 luogu_bot1 B Jan. 23, 2019, 2:10 a.m. OK GNU C++11 TESTS 27 92 10035200 2000
40990194 ReaLNero1 B July 30, 2018, 11:42 p.m. OK GNU C++11 TESTS 27 92 11366400 2000
63643930 Amadeus_System B Oct. 28, 2019, 9 a.m. OK GNU C++11 TESTS 27 92 12185600 2000
63644064 vjudge3 B Oct. 28, 2019, 9:04 a.m. OK GNU C++11 TESTS 27 92 12288000 2000
58061613 DennyQi B July 31, 2019, 7:37 a.m. OK GNU C++11 TESTS 27 92 12595200 2000
44353154 luogu_bot5 B Oct. 15, 2018, 11:11 a.m. OK GNU C++11 TESTS 27 92 14643200 2000
29288888 LiChenKoh B Aug. 8, 2017, 3:56 p.m. OK GNU C++14 TESTS 27 92 13312000 2000
66654490 wleung_bvg B Dec. 11, 2019, 9:18 p.m. OK GNU C++14 TESTS 27 124 12185600 2000
57490199 vjudge1 B July 22, 2019, 6:49 a.m. OK GNU C++14 TESTS 27 186 6246400 2000
57485853 conceptual_framework B July 22, 2019, 5:17 a.m. OK GNU C++14 TESTS 27 186 9216000 2000
53731031 Sasiyar B May 4, 2019, 7:12 a.m. OK GNU C++14 TESTS 27 186 9625600 2000
25541860 yassin_ B March 16, 2017, 8:09 a.m. OK GNU C++14 TESTS 27 186 9830400 2000
61669301 Storm_Stark B Oct. 1, 2019, 6:13 p.m. OK GNU C++14 TESTS 27 186 11776000 2000
36286344 alimagde B March 14, 2018, 8:15 p.m. OK GNU C++14 TESTS 27 186 12697600 2000
27468041 Givemetips B May 31, 2017, 1:40 p.m. OK GNU C++14 TESTS 27 186 13107200 2000
47386321 manu_kgp B Dec. 23, 2018, 5:14 a.m. OK GNU C++14 TESTS 27 186 13312000 2000
48923375 Fucker_And_Lover B Jan. 25, 2019, 9 a.m. OK GNU C++17 TESTS 27 156 6144000 2000
60398356 vjudge3 B Sept. 11, 2019, 3:46 p.m. OK GNU C++17 TESTS 27 186 6246400 2000
63881551 vjudge5 B Oct. 30, 2019, 9:15 p.m. OK GNU C++17 TESTS 27 186 9216000 2000
62044971 JBer B Oct. 7, 2019, 7:14 a.m. OK GNU C++17 TESTS 27 186 9216000 2000
58933184 vjudge3 B Aug. 17, 2019, 2:18 a.m. OK GNU C++17 TESTS 27 186 9216000 2000
51926351 ruo B March 28, 2019, 7:54 a.m. OK GNU C++17 TESTS 27 216 11366400 2000
45884810 Curnurx B Nov. 17, 2018, 3:29 p.m. OK GNU C++17 TESTS 27 216 11366400 2000
63884415 kvutxdy B Oct. 30, 2019, 11:24 p.m. OK GNU C++17 TESTS 27 216 11776000 2000
54506023 Mr_leon B May 23, 2019, 3:53 a.m. OK GNU C++17 TESTS 27 216 11776000 2000
53740533 Kianaz.A B May 4, 2019, 1:33 p.m. OK GNU C++17 TESTS 27 216 11776000 2000
3163058 cojna B Feb. 20, 2013, 6:50 p.m. OK Haskell TESTS 27 578 75776000 2000
67020146 Oom B Dec. 16, 2019, 12:42 p.m. OK Java 11 TESTS 27 778 26009600 2000
66285912 KulikAlex B Dec. 4, 2019, 7:15 p.m. OK Java 11 TESTS 27 840 28876800 2000
69278246 kashishsingh8700 B Jan. 22, 2020, 4:10 a.m. OK Java 11 TESTS 27 1590 29491200 2000
3156723 uwi B Feb. 20, 2013, 4:28 p.m. OK Java 6 TESTS 27 218 0 2000
3164281 emo B Feb. 20, 2013, 10:50 p.m. OK Java 6 TESTS 27 281 8192000 2000
3424266 hiukim B March 30, 2013, 7:19 p.m. OK Java 6 TESTS 27 312 7884800 2000
3153146 ysyshtc B Feb. 20, 2013, 3:50 p.m. OK Java 6 TESTS 27 312 9523200 2000
3172145 lazzrov B Feb. 22, 2013, 12:32 p.m. OK Java 6 TESTS 27 343 43212800 2000
3196193 mukku B Feb. 25, 2013, 7:02 p.m. OK Java 6 TESTS 27 421 23347200 2000
3157602 Ahmed.Ibrahem B Feb. 20, 2013, 4:38 p.m. OK Java 6 TESTS 27 437 24371200 2000
3577699 santjuan B April 19, 2013, 11:38 p.m. OK Java 6 TESTS 27 437 28160000 2000
3156630 Azat_Yusupov B Feb. 20, 2013, 4:27 p.m. OK Java 6 TESTS 27 484 25088000 2000
3154753 Slamur B Feb. 20, 2013, 4:06 p.m. OK Java 6 TESTS 27 593 55705600 2000
3155713 OutSide B Feb. 20, 2013, 4:17 p.m. OK Java 7 TESTS 27 171 11571200 2000
3166011 jiangzhijie B Feb. 21, 2013, 8:05 a.m. OK Java 7 TESTS 27 187 0 2000
3158117 S.Yesipenko B Feb. 20, 2013, 4:44 p.m. OK Java 7 TESTS 27 265 7987200 2000
3231651 KOHCTAHTIH B March 2, 2013, 7:57 p.m. OK Java 7 TESTS 27 265 10444800 2000
3156326 dusty.and.rusty B Feb. 20, 2013, 4:24 p.m. OK Java 7 TESTS 27 343 22323200 2000
3164350 mostafa_fahim B Feb. 20, 2013, 11:59 p.m. OK Java 7 TESTS 27 390 24576000 2000
3164686 Soldat B Feb. 21, 2013, 2:39 a.m. OK Java 7 TESTS 27 437 24576000 2000
3164419 ocelopilli B Feb. 21, 2013, 12:39 a.m. OK Java 7 TESTS 27 437 29184000 2000
3159137 gh_ost B Feb. 20, 2013, 4:57 p.m. OK Java 7 TESTS 27 453 13926400 2000
3203787 andrey_s B Feb. 27, 2013, 5:57 p.m. OK Java 7 TESTS 27 453 24268800 2000
47281253 StayAwayFromBitches B Dec. 20, 2018, 1:12 a.m. OK Java 8 TESTS 27 280 9113600 2000
50158222 rv_619 B Feb. 19, 2019, 11:18 a.m. OK Java 8 TESTS 27 340 17920000 2000
14220898 AlexFetisov B Nov. 13, 2015, 1:16 a.m. OK Java 8 TESTS 27 404 10240000 2000
27951595 prashanth_rebala B June 21, 2017, 7:10 p.m. OK Java 8 TESTS 27 498 37990400 2000
47312569 jenish9599 B Dec. 20, 2018, 9:18 p.m. OK Java 8 TESTS 27 528 42700800 2000
50217140 saurabh0611 B Feb. 20, 2019, 5:24 a.m. OK Java 8 TESTS 27 530 33996800 2000
68839859 saurabhs1206 B Jan. 15, 2020, 5:20 a.m. OK Java 8 TESTS 27 560 31744000 2000
31472066 7dan B Oct. 18, 2017, 7:28 a.m. OK Java 8 TESTS 27 560 53964800 2000
56427470 yorky B July 2, 2019, 10:21 a.m. OK Java 8 TESTS 27 622 26624000 2000
38455913 amnesiac_dusk B May 20, 2018, 10:41 a.m. OK Java 8 TESTS 27 622 28672000 2000
3158409 fiver B Feb. 20, 2013, 4:48 p.m. OK Mono C# TESTS 27 375 238592000 2000
3226004 mylifefordota B March 1, 2013, 3:34 p.m. OK Mono C# TESTS 27 703 80588800 2000
16555135 og.kostya B March 6, 2016, 4:44 p.m. OK MS C# TESTS 27 248 20377600 2000
3316518 NovChaos B March 14, 2013, 12:52 p.m. OK MS C++ TESTS 27 93 6553600 2000
3156536 lost3030 B Feb. 20, 2013, 4:26 p.m. OK MS C++ TESTS 27 93 8908800 2000
3153459 rcx92 B Feb. 20, 2013, 3:53 p.m. OK MS C++ TESTS 27 109 7372800 2000
3157142 Sklyack B Feb. 20, 2013, 4:32 p.m. OK MS C++ TESTS 27 109 8499200 2000
3154667 carber B Feb. 20, 2013, 4:05 p.m. OK MS C++ TESTS 27 109 9625600 2000
3296952 sololixt B March 13, 2013, 3:49 a.m. OK MS C++ TESTS 27 109 13209600 2000
48863677 vjudge4 B Jan. 24, 2019, 1:21 a.m. OK MS C++ TESTS 27 124 7987200 2000
16804306 vjudge1 B March 19, 2016, 7:36 a.m. OK MS C++ TESTS 27 124 10035200 2000
34912047 vjudge2 B Feb. 4, 2018, 1:53 a.m. OK MS C++ TESTS 27 124 10547200 2000
3176831 NSV B Feb. 23, 2013, 4:23 p.m. OK MS C++ TESTS 27 140 8499200 2000
59476269 CtrlAlt B Aug. 25, 2019, 4 p.m. OK MS C++ 2017 TESTS 27 280 7987200 2000
5457292 yugle7 B Dec. 17, 2013, 7:56 p.m. OK Python 2 TESTS 27 1528 17203200 2000
13875362 naresh7406 B Oct. 26, 2015, 3:51 p.m. OK Python 2 TESTS 27 1964 17920000 2000
48462940 jadeddragon B Jan. 16, 2019, 3:40 p.m. OK Python 3 TESTS 27 1588 18944000 2000
5457275 yugle7 B Dec. 17, 2013, 7:50 p.m. OK Python 3 TESTS 27 1778 20070400 2000

remove filters

Back to search problems