Codeforces Round 635 (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
1336 Codeforces Round 635 (Div. 1) FINISHED False 9000 150391511 April 15, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20940 ) A Linova and Kingdom PROGRAMMING dfs and similar dp greedy sortings trees 1700

B"Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light novel for the kingdom as soon as she woke up, and of course, she is the queen of it. There are n cities and n-1 two-way roads connecting pairs of cities in the kingdom. From any city, you can reach any other city by walking through some roads. The cities are numbered from 1 to n , and the city 1 is the capital of the kingdom. So, the kingdom has a tree structure. As the queen, Linova plans to choose exactly k cities developing industry, while the other cities will develop tourism. The capital also can be either industrial or tourism city. A meeting is held in the capital once a year. To attend the meeting, each industry city sends an envoy. All envoys will follow the shortest path from the departure city to the capital (which is unique). Traveling in tourism cities is pleasant. For each envoy, his happiness is equal to the number of tourism cities on his path. In order to be a queen loved by people, Linova wants to choose k cities which can maximize the sum of happinesses of all envoys. Can you calculate the maximum sum for her? The first line contains two integers n and k ( 2 <= n <= 2 cdot 10^5 , 1 <= k< n ) -- the number of cities and industry cities respectively. Each of the next n-1 lines contains two integers u and v ( 1 <= u,v <= n ), denoting there is a road connecting city u and city v . It is guaranteed that from any city, you can reach any other city by the roads. Print the only line containing a single integer -- the maximum possible sum of happinesses of all envoys. In the first example, Linova can choose cities 2 , 5 , 6 , 7 to develop industry, then the happiness of the envoy from city 2 is 1 , the happiness of envoys from cities 5 , 6 , 7 is 2$"...

Tutorials

Codeforces Round #635 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
77220053 frederick99 A April 18, 2020, 7:54 p.m. OK D TESTS 60 265 40857600 1700
76873595 Gassa A April 15, 2020, 4:08 p.m. OK D TESTS 60 280 22835200 1700
77208308 frederick99 A April 18, 2020, 5:20 p.m. OK D TESTS 60 342 27340800 1700
76832975 hos.lyric A April 15, 2020, 2:55 p.m. OK D TESTS 60 514 30720000 1700
76838464 physics0523 A April 15, 2020, 3:01 p.m. OK GNU C11 TESTS 60 296 60723200 1700
76848253 pengin_2000 A April 15, 2020, 3:15 p.m. OK GNU C11 TESTS 60 451 14643200 1700
76928613 Enderturtle A April 16, 2020, 4:58 a.m. OK GNU C++11 TESTS 60 62 8601600 1700
76981602 Lu_Anlai A April 16, 2020, 2:24 p.m. OK GNU C++11 TESTS 60 62 9830400 1700
76915580 superbigjuruo A April 16, 2020, 12:28 a.m. OK GNU C++11 TESTS 60 62 12185600 1700
76833915 cjtcalc A April 15, 2020, 2:56 p.m. OK GNU C++11 TESTS 60 62 14848000 1700
76918342 luogu_bot3 A April 16, 2020, 1:39 a.m. OK GNU C++11 TESTS 60 62 15052800 1700
76967793 M_sea A April 16, 2020, 12:10 p.m. OK GNU C++11 TESTS 60 62 15052800 1700
77660273 luogu_bot1 A April 22, 2020, 2:30 p.m. OK GNU C++11 TESTS 60 62 15769600 1700
78008361 stal_xy23z7b8 A April 25, 2020, 9:35 a.m. OK GNU C++11 TESTS 60 62 16588800 1700
77247829 wyzwyz A April 19, 2020, 6:57 a.m. OK GNU C++11 TESTS 60 62 16691200 1700
77080152 nantf A April 17, 2020, 1:34 p.m. OK GNU C++11 TESTS 60 62 18227200 1700
76831117 _quq A April 15, 2020, 2:53 p.m. OK GNU C++14 TESTS 60 124 15360000 1700
76819441 disangan233 A April 15, 2020, 2:45 p.m. OK GNU C++14 TESTS 60 124 20275200 1700
76823529 Linkus A April 15, 2020, 2:47 p.m. OK GNU C++14 TESTS 60 139 20070400 1700
76838567 yhx-12243 A April 15, 2020, 3:01 p.m. OK GNU C++14 TESTS 60 140 13004800 1700
76815632 melancholic_fat_otaku A April 15, 2020, 2:42 p.m. OK GNU C++14 TESTS 60 140 15052800 1700
77058174 nitvjudge4 A April 17, 2020, 9:53 a.m. OK GNU C++14 TESTS 60 140 15974400 1700
76831562 tokitsukaze A April 15, 2020, 2:54 p.m. OK GNU C++14 TESTS 60 140 22220800 1700
76955568 Zhansultan A April 16, 2020, 10:05 a.m. OK GNU C++14 TESTS 60 140 45056000 1700
76844045 443singer A April 15, 2020, 3:09 p.m. OK GNU C++14 TESTS 60 155 11366400 1700
76838702 Kazusa A April 15, 2020, 3:02 p.m. OK GNU C++14 TESTS 60 155 18944000 1700
76822011 JOHNKRAM A April 15, 2020, 2:46 p.m. OK GNU C++17 TESTS 60 93 37273600 1700
76818064 LayCurse A April 15, 2020, 2:44 p.m. OK GNU C++17 TESTS 60 93 105164800 1700
76922695 Unsterblicher_Geist A April 16, 2020, 3:16 a.m. OK GNU C++17 TESTS 60 109 19456000 1700
77142280 LayCurse A April 18, 2020, 4:55 a.m. OK GNU C++17 TESTS 60 109 103116800 1700
77455928 theONEPIECE A April 21, 2020, 10:41 a.m. OK GNU C++17 TESTS 60 124 13414400 1700
77713165 Huah A April 23, 2020, 5:03 a.m. OK GNU C++17 TESTS 60 124 14233600 1700
77625132 HatsuneMikuo A April 22, 2020, 8:53 a.m. OK GNU C++17 TESTS 60 124 25600000 1700
76815001 Polygon-yg A April 15, 2020, 2:42 p.m. OK GNU C++17 TESTS 60 140 15360000 1700
76988764 imlk A April 16, 2020, 3:24 p.m. OK GNU C++17 TESTS 60 140 17100800 1700
76827867 limbo.null A April 15, 2020, 2:51 p.m. OK GNU C++17 TESTS 60 140 21606400 1700
76907626 ivan100sic A April 15, 2020, 9:10 p.m. OK GNU C++17 (64) TESTS 60 124 28876800 1700
77301731 LiChenKoh A April 19, 2020, 5:58 p.m. OK GNU C++17 (64) TESTS 60 124 28979200 1700
76836840 yosupo A April 15, 2020, 2:59 p.m. OK GNU C++17 (64) TESTS 60 124 29798400 1700
76907758 ivan100sic A April 15, 2020, 9:12 p.m. OK GNU C++17 (64) TESTS 60 124 36147200 1700
76908298 ivan100sic A April 15, 2020, 9:22 p.m. OK GNU C++17 (64) TESTS 60 139 65024000 1700
76821967 passer_ A April 15, 2020, 2:46 p.m. OK GNU C++17 (64) TESTS 60 140 23654400 1700
76823041 UniverseofHK A April 15, 2020, 2:47 p.m. OK GNU C++17 (64) TESTS 60 155 32870400 1700
76862023 wleung_bvg A April 15, 2020, 3:41 p.m. OK GNU C++17 (64) TESTS 60 155 34406400 1700
76972655 masab A April 16, 2020, 12:58 p.m. OK GNU C++17 (64) TESTS 60 156 26828800 1700
76946583 tuanio A April 16, 2020, 8:27 a.m. OK GNU C++17 (64) TESTS 60 171 27648000 1700
76954028 sonlh07 A April 16, 2020, 9:48 a.m. OK Go TESTS 60 389 36966400 1700
76816065 uwi A April 15, 2020, 2:42 p.m. OK Java 11 TESTS 60 311 6758400 1700
76968186 cribabby A April 16, 2020, 12:14 p.m. OK Java 11 TESTS 60 468 63590400 1700
77008865 rreeennnnn A April 16, 2020, 6:52 p.m. OK Java 11 TESTS 60 592 43827200 1700
76837990 Musin A April 15, 2020, 3:01 p.m. OK Java 11 TESTS 60 592 52531200 1700
76814039 Suzukaze A April 15, 2020, 2:41 p.m. OK Java 11 TESTS 60 639 46489600 1700
76995456 Roger40602 A April 16, 2020, 4:26 p.m. OK Java 11 TESTS 60 639 53964800 1700
76820815 mikit A April 15, 2020, 2:46 p.m. OK Java 11 TESTS 60 716 44953600 1700
77315374 prituladima A April 19, 2020, 10:20 p.m. OK Java 11 TESTS 60 998 174387200 1700
77315765 prituladima A April 19, 2020, 10:35 p.m. OK Java 11 TESTS 60 1029 174387200 1700
77204961 kabirpathak A April 18, 2020, 4:34 p.m. OK Java 11 TESTS 60 1138 55398400 1700
76824459 StayAwayFromBitches A April 15, 2020, 2:48 p.m. OK Java 8 TESTS 60 295 16793600 1700
76837429 aman28rwt A April 15, 2020, 3 p.m. OK Java 8 TESTS 60 342 19251200 1700
76900019 DarLam A April 15, 2020, 6:52 p.m. OK Java 8 TESTS 60 374 26419200 1700
76819417 cwise A April 15, 2020, 2:45 p.m. OK Java 8 TESTS 60 436 58368000 1700
76921077 akshay_miterani A April 16, 2020, 2:42 a.m. OK Java 8 TESTS 60 483 58470400 1700
76936443 MasssA A April 16, 2020, 6:38 a.m. OK Java 8 TESTS 60 545 57344000 1700
76835221 holeguma A April 15, 2020, 2:58 p.m. OK Java 8 TESTS 60 545 80076800 1700
77947683 shu37052 A April 24, 2020, 6:42 p.m. OK Java 8 TESTS 60 546 51814400 1700
77150307 yaoct A April 18, 2020, 6:49 a.m. OK Java 8 TESTS 60 561 46489600 1700
76821049 DanielW48 A April 15, 2020, 2:46 p.m. OK Java 8 TESTS 60 561 58368000 1700
76871654 elizarov A April 15, 2020, 4:04 p.m. OK Kotlin TESTS 60 748 39833600 1700
76973804 TadijaSebez A April 16, 2020, 1:09 p.m. OK Kotlin TESTS 60 857 56422400 1700
76821988 koboshi A April 15, 2020, 2:46 p.m. OK Kotlin TESTS 60 1091 103936000 1700
76824243 Tlatoani A April 15, 2020, 2:48 p.m. OK Kotlin TESTS 60 1309 83046400 1700
76917224 camypaper A April 16, 2020, 1:12 a.m. OK Mono C# TESTS 60 498 119603200 1700
76862052 mban259 A April 15, 2020, 3:41 p.m. OK Mono C# TESTS 60 545 26009600 1700
76830687 keymoon A April 15, 2020, 2:53 p.m. OK Mono C# TESTS 60 592 32153600 1700
76910981 PPons A April 15, 2020, 10:18 p.m. OK Mono C# TESTS 60 904 52019200 1700
77670536 InCorCadit A April 22, 2020, 4:02 p.m. OK Mono C# TESTS 60 920 52121600 1700
76839681 lxhgww A April 15, 2020, 3:03 p.m. OK MS C++ TESTS 60 202 15360000 1700
76850219 NotEvenWrong A April 15, 2020, 3:18 p.m. OK MS C++ TESTS 60 234 21094400 1700
76868626 tarattata1 A April 15, 2020, 3:56 p.m. OK MS C++ 2017 TESTS 60 217 12185600 1700
76968592 AleksanderBalobanov A April 16, 2020, 12:17 p.m. OK MS C++ 2017 TESTS 60 217 29696000 1700
76850131 P___ A April 15, 2020, 3:18 p.m. OK MS C++ 2017 TESTS 60 233 12902400 1700
76819074 pichulia A April 15, 2020, 2:44 p.m. OK MS C++ 2017 TESTS 60 249 14540800 1700
76927730 vjudge5 A April 16, 2020, 4:45 a.m. OK MS C++ 2017 TESTS 60 327 11468800 1700
76899907 CrashMaster A April 15, 2020, 6:51 p.m. OK MS C++ 2017 TESTS 60 405 14540800 1700
77358125 Kirill456Z A April 20, 2020, 12:13 p.m. OK MS C++ 2017 TESTS 60 421 12288000 1700
76849821 kupriyanov A April 15, 2020, 3:18 p.m. OK MS C++ 2017 TESTS 60 436 17817600 1700
77033568 Timonnable A April 17, 2020, 4:19 a.m. OK MS C++ 2017 TESTS 60 452 12185600 1700
76844297 danilgrig A April 15, 2020, 3:09 p.m. OK MS C++ 2017 TESTS 60 452 15257600 1700
76839041 pajenegod A April 15, 2020, 3:02 p.m. OK PyPy 2 TESTS 60 452 28262400 1700
76912703 chaudhary_19 A April 15, 2020, 11:03 p.m. OK PyPy 2 TESTS 60 560 39526400 1700
76856861 bcollet A April 15, 2020, 3:30 p.m. OK PyPy 2 TESTS 60 811 36761600 1700
77698342 c1729 A April 22, 2020, 10:12 p.m. OK PyPy 2 TESTS 60 1200 56934400 1700
77698129 c1729 A April 22, 2020, 10:06 p.m. OK PyPy 2 TESTS 60 1310 69529600 1700
76954287 gilesg A April 16, 2020, 9:51 a.m. OK PyPy 2 TESTS 60 1730 49049600 1700
76852690 astrom.lars A April 15, 2020, 3:23 p.m. OK PyPy 2 TESTS 60 1980 43008000 1700
76915607 wattaihei A April 16, 2020, 12:29 a.m. OK PyPy 3 TESTS 60 670 30003200 1700
76850624 nagiss A April 15, 2020, 3:19 p.m. OK PyPy 3 TESTS 60 670 50688000 1700
76818759 tamato A April 15, 2020, 2:44 p.m. OK PyPy 3 TESTS 60 685 42086400 1700
77039375 todor91 A April 17, 2020, 6:02 a.m. OK PyPy 3 TESTS 60 717 32153600 1700
77366022 zqx1392 A April 20, 2020, 1:41 p.m. OK PyPy 3 TESTS 60 717 35328000 1700
76821690 conqueror_of_tourist A April 15, 2020, 2:46 p.m. OK PyPy 3 TESTS 60 733 32153600 1700
77221569 Achilles221B A April 18, 2020, 8:20 p.m. OK PyPy 3 TESTS 60 779 28774400 1700
76872433 titia A April 15, 2020, 4:05 p.m. OK PyPy 3 TESTS 60 810 35225600 1700
76973741 codershuvo A April 16, 2020, 1:08 p.m. OK PyPy 3 TESTS 60 826 173568000 1700
76989081 qwertz73355a A April 16, 2020, 3:27 p.m. OK PyPy 3 TESTS 60 842 49049600 1700
77347757 a00920 A April 20, 2020, 10:07 a.m. OK Python 3 TESTS 60 888 206028800 1700
76832105 EbTech A April 15, 2020, 2:54 p.m. OK Rust TESTS 60 93 21196800 1700
76919561 sansen A April 16, 2020, 2:09 a.m. OK Rust TESTS 60 140 21401600 1700
77386169 ikazuya0201 A April 20, 2020, 5:02 p.m. OK Rust TESTS 60 156 17510400 1700
76903323 dariost A April 15, 2020, 7:58 p.m. OK Rust TESTS 60 234 18124800 1700

remove filters

Back to search problems