Russian Code Cup 2017 - Finals [Unofficial Mirror, Div. 1 Only Recommended, Teams Allowed]

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
856 Russian Code Cup 2017 - Finals [Unofficial Mirror, Div. 1 Only Recommended, Teams Allowed] FINISHED False 10800 232475124 Sept. 10, 2017, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 416 ) D Masha and Cactus PROGRAMMING 2500

B"Masha is fond of cacti. When she was a little girl, she decided to plant a tree. Now Masha wants to make a nice cactus out of her tree. Recall that tree is a connected undirected graph that has no cycles. Cactus is a connected undirected graph such that each vertex belongs to at most one cycle. Masha has some additional edges that she can add to a tree. For each edge she knows which vertices it would connect and the beauty of this edge. Masha can add some of these edges to the graph if the resulting graph is a cactus. Beauty of the resulting cactus is sum of beauties of all added edges. Help Masha find out what maximum beauty of the resulting cactus she can achieve. The first line of the input data contains two integers n and m -- the number of vertices in a tree, and the number of additional edges available (3 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105; 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105). Let us describe Masha's tree. It has a root at vertex 1. The second line contains n xe2 x80 x89- xe2 x80 x891 integers: p2, xe2 x80 x89p3, xe2 x80 x89..., xe2 x80 x89pn, here pi -- is the parent of a vertex i -- the first vertex on a path from the vertex i to the root of the tree (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89< xe2 x80 x89i). The following m lines contain three integers ui, vi and ci -- pairs of vertices to be connected by the additional edges that Masha can add to the tree and beauty of edge (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ui, xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; ui xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89vi; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89104). It is guaranteed that no additional edge coincides with the edge of the tree. Output one integer -- the maximum beauty of a cactus Masha can achieve. "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
30829746 zhaimingshuzms D Sept. 29, 2017, 1:02 p.m. OK GNU C++ TESTS 32 202 35532800 2500
30287631 SeventeenYears D Sept. 12, 2017, 1:34 p.m. OK GNU C++ TESTS 32 217 40550400 2500
30284743 SeventeenYears D Sept. 12, 2017, 11:31 a.m. OK GNU C++ TESTS 32 218 40448000 2500
30309565 samjia2000 D Sept. 13, 2017, 2:39 p.m. OK GNU C++ TESTS 32 233 23244800 2500
30829590 zhaimingshuzms D Sept. 29, 2017, 12:58 p.m. OK GNU C++ TESTS 32 234 35532800 2500
30281926 SeventeenYears D Sept. 12, 2017, 8:56 a.m. OK GNU C++ TESTS 32 234 40448000 2500
31589380 cdgyp D Oct. 22, 2017, 1:20 a.m. OK GNU C++ TESTS 32 249 50380800 2500
31471910 gjghfd D Oct. 18, 2017, 7:23 a.m. OK GNU C++ TESTS 32 280 40550400 2500
30829438 zhaimingshuzms D Sept. 29, 2017, 12:52 p.m. OK GNU C++ TESTS 32 296 35430400 2500
30302254 SeventeenYears D Sept. 13, 2017, 8:46 a.m. OK GNU C++ TESTS 32 296 101785600 2500
30250854 ditoly ACMLCZH FallDream D Sept. 10, 2017, 4:04 p.m. OK GNU C++11 TESTS 32 187 33177600 2500
30864587 Feeey D Sept. 30, 2017, 11:39 a.m. OK GNU C++11 TESTS 32 202 41574400 2500
30969946 snowflake D Oct. 3, 2017, 2:23 p.m. OK GNU C++11 TESTS 32 217 31948800 2500
30864667 Feeey D Sept. 30, 2017, 11:41 a.m. OK GNU C++11 TESTS 32 217 31948800 2500
58336757 LittleBeetle D Aug. 5, 2019, 11:46 a.m. OK GNU C++11 TESTS 32 217 34304000 2500
57509738 adorae D July 22, 2019, 1:19 p.m. OK GNU C++11 TESTS 32 217 39014400 2500
30827738 iamqzh D Sept. 29, 2017, 12:16 p.m. OK GNU C++11 TESTS 32 217 39116800 2500
30864635 Feeey D Sept. 30, 2017, 11:40 a.m. OK GNU C++11 TESTS 32 218 31948800 2500
30864648 Feeey D Sept. 30, 2017, 11:41 a.m. OK GNU C++11 TESTS 32 233 31948800 2500
30865074 Feeey D Sept. 30, 2017, 11:42 a.m. OK GNU C++11 TESTS 32 233 41574400 2500
30827101 Timsei D Sept. 29, 2017, 11:51 a.m. OK GNU C++14 TESTS 32 249 33382400 2500
30823084 cxt D Sept. 29, 2017, 8:01 a.m. OK GNU C++14 TESTS 32 249 37580800 2500
30827284 Timsei D Sept. 29, 2017, 11:58 a.m. OK GNU C++14 TESTS 32 265 31846400 2500
30827256 Timsei D Sept. 29, 2017, 11:57 a.m. OK GNU C++14 TESTS 32 280 31948800 2500
30827207 Timsei D Sept. 29, 2017, 11:55 a.m. OK GNU C++14 TESTS 32 280 31948800 2500
31472077 _LowestJN D Oct. 18, 2017, 7:28 a.m. OK GNU C++14 TESTS 32 280 46899200 2500
30871451 jufusong D Sept. 30, 2017, 4:11 p.m. OK GNU C++14 TESTS 32 295 102297600 2500
51614123 molamola. D March 21, 2019, 11:46 a.m. OK GNU C++14 TESTS 32 311 37888000 2500
30250843 VladaMG98 ivan100sic D Sept. 10, 2017, 4:03 p.m. OK GNU C++14 TESTS 32 311 50483200 2500
35582862 radoslav11 D Feb. 22, 2018, 8:14 p.m. OK GNU C++14 TESTS 32 311 158822400 2500
60247676 yuhaw D Sept. 8, 2019, 4:20 a.m. OK GNU C++17 TESTS 32 296 35225600 2500
60247704 yuhaw D Sept. 8, 2019, 4:21 a.m. OK GNU C++17 TESTS 32 327 34406400 2500
55668827 hjk1030 D June 17, 2019, 6:11 a.m. OK GNU C++17 TESTS 32 405 32665600 2500
62535038 Umi D Oct. 13, 2019, 9:43 p.m. OK GNU C++17 TESTS 32 436 55193600 2500
52275788 chinmay0906 D April 3, 2019, 2:43 p.m. OK GNU C++17 TESTS 32 451 55296000 2500
41959478 am.azadi D Aug. 22, 2018, 8:36 a.m. OK GNU C++17 TESTS 32 530 68505600 2500
52668065 Chuzyh D April 13, 2019, 5:57 a.m. OK GNU C++17 TESTS 32 607 171212800 2500
52639901 libra9z D April 12, 2019, 12:01 p.m. OK GNU C++17 TESTS 32 655 43315200 2500
46436703 _Ore_ D Dec. 1, 2018, 9:33 a.m. OK GNU C++17 TESTS 32 685 133734400 2500
57347376 Benq D July 20, 2019, 12:47 a.m. OK GNU C++17 TESTS 32 982 158105600 2500
30250306 mmaxio D Sept. 10, 2017, 3:43 p.m. OK Java 8 TESTS 32 935 146329600 2500
32416455 JShinjuro D Nov. 17, 2017, 11:40 p.m. OK Java 8 TESTS 32 950 146432000 2500
36403952 dalt D March 19, 2018, 6:41 a.m. OK Java 8 TESTS 32 1497 129945600 2500
30309254 I_Need_Alex_R_Coleman D Sept. 13, 2017, 2:23 p.m. OK Java 8 TESTS 32 1543 120012800 2500

remove filters

Back to search problems