Codeforces Round 603 (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
1263 Codeforces Round 603 (Div. 2) FINISHED False 7200 162401087 Nov. 29, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 899 ) F Economic Difficulties PROGRAMMING data structures dfs and similar dp flows graphs trees 2500

B"An electrical grid in Berland palaces consists of 2 grids: main and reserve. Wires in palaces are made of expensive material, so selling some of them would be a good idea! Each grid (main and reserve) has a head node (its number is 1 ). Every other node gets electricity from the head node. Each node can be reached from the head node by a unique path. Also, both grids have exactly n nodes, which do not spread electricity further. In other words, every grid is a rooted directed tree on n leaves with a root in the node, which number is 1 . Each tree has independent enumeration and nodes from one grid are not connected with nodes of another grid. Also, the palace has n electrical devices. Each device is connected with one node of the main grid and with one node of the reserve grid. Devices connect only with nodes, from which electricity is not spread further (these nodes are the tree's leaves). Each grid's leaf is connected with exactly one device. It is guaranteed that the whole grid (two grids and n devices) can be shown in this way (like in the picture above): Formally, for each tree exists a depth-first search from the node with number 1 , that visits leaves in order of connection to devices 1, 2, ... , n (firstly, the node, that is connected to the device 1 , then the node, that is connected to the device 2 , etc.). Businessman wants to sell (remove) maximal amount of wires so that each device will be powered from at least one grid (main or reserve). In other words, for each device should exist at least one path to the head node (in the main grid or the reserve grid), which contains only nodes from one grid. The first line contains an integer n ( 1 <= n <= 1000 ) -- the number of devices in the palace. The next line contains an integer a ( 1 + n <= a <= 1000 + n ) -- the amount of nodes in the main grid. Next line contains a - 1 integers p_i ( 1 <= p_i <= a$$"...

Tutorials

Разбор Codeforces Round #603 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66004116 rainboy F Nov. 29, 2019, 8:28 p.m. OK GNU C11 TESTS 180 46 12083200 2500
66017990 mdpfeifer F Nov. 30, 2019, 6:15 a.m. OK GNU C++11 TESTS 180 31 204800 2500
66550781 bqq F Dec. 9, 2019, 2:50 p.m. OK GNU C++11 TESTS 181 31 204800 2500
66426298 qxforever F Dec. 6, 2019, 9:55 p.m. OK GNU C++11 TESTS 181 31 307200 2500
66272871 YU1 F Dec. 4, 2019, 12:55 p.m. OK GNU C++11 TESTS 181 31 307200 2500
66013138 zucker42 F Nov. 30, 2019, 3:52 a.m. OK GNU C++11 TESTS 180 31 307200 2500
65993326 Pelmelnik2 F Nov. 29, 2019, 5:10 p.m. OK GNU C++11 TESTS 180 31 409600 2500
65996549 Jonte_98 F Nov. 29, 2019, 5:45 p.m. OK GNU C++11 TESTS 180 31 409600 2500
66173043 yukosa F Dec. 2, 2019, 11:17 a.m. OK GNU C++11 TESTS 181 31 512000 2500
68117301 adamchase F Jan. 3, 2020, 11:57 a.m. OK GNU C++11 TESTS 181 31 4198400 2500
69287528 zhixusheng F Jan. 22, 2020, 8:50 a.m. OK GNU C++11 TESTS 181 31 6553600 2500
66011820 NoTeamName F Nov. 30, 2019, 3:02 a.m. OK GNU C++14 TESTS 180 31 204800 2500
66151125 nikolapesic2802 F Dec. 1, 2019, 7:02 p.m. OK GNU C++14 TESTS 181 31 307200 2500
66150406 nikolapesic2802 F Dec. 1, 2019, 6:41 p.m. OK GNU C++14 TESTS 181 31 307200 2500
66009148 jiangly F Nov. 30, 2019, 1:06 a.m. OK GNU C++14 TESTS 180 31 409600 2500
66313011 erichsu F Dec. 5, 2019, 12:06 p.m. OK GNU C++14 TESTS 181 31 409600 2500
66052373 mr.logix F Nov. 30, 2019, 5:52 p.m. OK GNU C++14 TESTS 180 31 409600 2500
66029806 aayush9 F Nov. 30, 2019, 9:47 a.m. OK GNU C++14 TESTS 180 31 409600 2500
66013758 yan-zp F Nov. 30, 2019, 4:16 a.m. OK GNU C++14 TESTS 180 31 409600 2500
66010897 Zandew F Nov. 30, 2019, 2:26 a.m. OK GNU C++14 TESTS 180 31 409600 2500
65997657 step_by_step F Nov. 29, 2019, 6:03 p.m. OK GNU C++14 TESTS 180 31 409600 2500
67685985 despair F Dec. 27, 2019, 8:54 a.m. OK GNU C++17 TESTS 181 31 102400 2500
66004728 okwedook F Nov. 29, 2019, 8:50 p.m. OK GNU C++17 TESTS 180 31 307200 2500
66762954 achvanov F Dec. 13, 2019, 7:12 a.m. OK GNU C++17 TESTS 181 31 409600 2500
66027311 FlowerOfSorrow F Nov. 30, 2019, 9:04 a.m. OK GNU C++17 TESTS 180 31 409600 2500
65993690 Pechalka F Nov. 29, 2019, 5:12 p.m. OK GNU C++17 TESTS 180 31 409600 2500
66156376 iaNTU F Dec. 1, 2019, 11 p.m. OK GNU C++17 TESTS 181 31 409600 2500
66305410 EIKOU F Dec. 5, 2019, 9:09 a.m. OK GNU C++17 TESTS 181 31 409600 2500
66240005 neal F Dec. 3, 2019, 5:44 p.m. OK GNU C++17 TESTS 181 31 512000 2500
66156260 iaNTU F Dec. 1, 2019, 10:51 p.m. OK GNU C++17 TESTS 181 31 512000 2500
66008424 Superty F Nov. 30, 2019, 12:22 a.m. OK GNU C++17 TESTS 180 31 512000 2500
67387252 mikolaychuknn F Dec. 21, 2019, 6:15 p.m. OK Go TESTS 181 1248 18739200 2500
66004104 Dukkha F Nov. 29, 2019, 8:27 p.m. OK Java 11 TESTS 180 249 17408000 2500
66744676 Xylenox F Dec. 13, 2019, 12:50 a.m. OK Java 8 TESTS 181 155 14233600 2500
66046568 nikolay.v.mikhaylov F Nov. 30, 2019, 3:20 p.m. OK Java 8 TESTS 180 171 0 2500
66310138 IdoItMyWay F Dec. 5, 2019, 11:06 a.m. OK Java 8 TESTS 181 187 0 2500
66310071 IdoItMyWay F Dec. 5, 2019, 11:05 a.m. OK Java 8 TESTS 181 218 0 2500
66019970 dalt F Nov. 30, 2019, 7 a.m. OK Java 8 TESTS 180 249 49868800 2500
68427882 binrodon F Jan. 9, 2020, 5:05 a.m. OK Java 8 TESTS 181 374 39219200 2500
65999694 barakraganosungam F Nov. 29, 2019, 6:40 p.m. OK Java 8 TESTS 180 374 40038400 2500
66004981 Harpae F Nov. 29, 2019, 8:59 p.m. OK Java 8 TESTS 180 389 45670400 2500
66145809 icpc_loser F Dec. 1, 2019, 4:30 p.m. OK Java 8 TESTS 181 639 137216000 2500
65984296 Tlatoani F Nov. 29, 2019, 4 p.m. OK Kotlin TESTS 180 202 819200 2500
66080752 youx F Nov. 30, 2019, 11:08 p.m. OK MS C++ 2017 TESTS 180 46 16281600 2500
66242638 Ancient_mage F Dec. 3, 2019, 6:49 p.m. OK MS C++ 2017 TESTS 181 390 10240000 2500
65989042 bcollet F Nov. 29, 2019, 4:23 p.m. OK PyPy 2 TESTS 180 233 10752000 2500
65993719 sansen F Nov. 29, 2019, 5:12 p.m. OK Rust TESTS 180 140 1126400 2500
66150992 limed F Dec. 1, 2019, 6:58 p.m. OK Scala TESTS 181 483 0 2500

remove filters

Back to search problems