Codeforces Round 586 (Div. 1 + 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
1220 Codeforces Round 586 (Div. 1 + Div. 2) FINISHED False 7200 168530111 Sept. 18, 2019, 4:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2831 ) E Tourism PROGRAMMING dfs and similar dp ds graphs greedy trees 2200

B"Alex decided to go on a touristic trip over the country. For simplicity let's assume that the country has n cities and m bidirectional roads connecting them. Alex lives in city s and initially located in it. To compare different cities Alex assigned each city a score w_i which is as high as interesting city seems to Alex. Alex believes that his trip will be interesting only if he will not use any road twice in a row. That is if Alex came to city v from city u , he may choose as the next city in the trip any city connected with v by the road, except for the city u . Your task is to help Alex plan his city in a way that maximizes total score over all cities he visited. Note that for each city its score is counted at most once, even if Alex been there several times during his trip. First line of input contains two integers n and m , ( 1 <= n <= 2 cdot 10^5 , 0 <= m <= 2 cdot 10^5 ) which are numbers of cities and roads in the country. Second line contains n integers w_1, w_2, ldots, w_n ( 0 <= w_i <= 10^9 ) which are scores of all cities. The following m lines contain description of the roads. Each of these m lines contains two integers u and v ( 1 <= u, v <= n ) which are cities connected by this road. It is guaranteed that there is at most one direct road between any two cities, no city is connected to itself by the road and, finally, it is possible to go from any city to any other one using only roads. The last line contains single integer s ( 1 <= s <= n ), which is the number of the initial city. Output single integer which is the maximum possible sum of scores of visited cities. "...

Tutorials

Codeforces Round #586 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
60797043 hos.lyric E Sept. 18, 2019, 4:51 p.m. OK D TESTS 57 374 42598400 2200
60951694 forget E Sept. 20, 2019, 10:16 p.m. OK GNU C11 TESTS 58 124 6451200 2200
60961113 chenyewei_1234 E Sept. 21, 2019, 5:24 a.m. OK GNU C++11 TESTS 58 46 9932800 2200
61207654 Dancepted E Sept. 24, 2019, 10:20 a.m. OK GNU C++11 TESTS 58 62 9011200 2200
60926337 Llf0703 E Sept. 20, 2019, 12:23 p.m. OK GNU C++11 TESTS 58 77 14438400 2200
60829008 msuwakow E Sept. 19, 2019, 5:58 a.m. OK GNU C++11 TESTS 57 77 18841600 2200
64187933 Dream-chasing_Juvenile E Nov. 4, 2019, 6:19 a.m. OK GNU C++11 TESTS 58 77 23961600 2200
64191198 Binary_Search_Tree E Nov. 4, 2019, 7:48 a.m. OK GNU C++11 TESTS 58 77 29798400 2200
65528126 luogu_bot5 E Nov. 22, 2019, 11:17 a.m. OK GNU C++11 TESTS 58 78 14438400 2200
60839109 twilight7 E Sept. 19, 2019, 10:12 a.m. OK GNU C++11 TESTS 57 78 19968000 2200
60918762 Llf0703 E Sept. 20, 2019, 9:34 a.m. OK GNU C++11 TESTS 58 93 14438400 2200
60822652 yjher E Sept. 19, 2019, 1:33 a.m. OK GNU C++11 TESTS 57 93 30412800 2200
64291478 lqz_t E Nov. 5, 2019, 7:11 a.m. OK GNU C++14 TESTS 58 140 8294400 2200
61895554 chhshcy E Oct. 5, 2019, 7:08 a.m. OK GNU C++14 TESTS 58 155 8908800 2200
60827494 melancholic_fat_otaku E Sept. 19, 2019, 5:03 a.m. OK GNU C++14 TESTS 57 155 16384000 2200
61787203 idxcalcal E Oct. 3, 2019, 2:47 p.m. OK GNU C++14 TESTS 58 155 31232000 2200
61186108 _HossamYehia_ E Sept. 23, 2019, 10:49 p.m. OK GNU C++14 TESTS 58 156 8294400 2200
61426227 VictoriaWang E Sept. 28, 2019, 1:15 p.m. OK GNU C++14 TESTS 58 156 8908800 2200
61823318 yyhslfw E Oct. 4, 2019, 3:27 a.m. OK GNU C++14 TESTS 58 156 15257600 2200
60806222 New_God E Sept. 18, 2019, 5:35 p.m. OK GNU C++14 TESTS 57 156 18636800 2200
61186191 _HossamYehia_ E Sept. 23, 2019, 10:53 p.m. OK GNU C++14 TESTS 58 171 8294400 2200
61714875 Owen_codeisking E Oct. 2, 2019, 12:18 p.m. OK GNU C++14 TESTS 58 171 8908800 2200
60798749 whzzt E Sept. 18, 2019, 4:58 p.m. OK GNU C++17 TESTS 57 124 15155200 2200
61254202 RNS_KSB E Sept. 25, 2019, 9:26 a.m. OK GNU C++17 TESTS 58 124 16896000 2200
61275313 Lezedary_sandwich E Sept. 25, 2019, 3:14 p.m. OK GNU C++17 TESTS 58 124 30105600 2200
60834041 201831990439 E Sept. 19, 2019, 8:14 a.m. OK GNU C++17 TESTS 57 155 43622400 2200
60952122 forget E Sept. 20, 2019, 10:40 p.m. OK GNU C++17 TESTS 58 171 6348800 2200
61830855 Yuryyy E Oct. 4, 2019, 6:31 a.m. OK GNU C++17 TESTS 58 171 8908800 2200
61352701 Jiengup E Sept. 27, 2019, 9:04 a.m. OK GNU C++17 TESTS 58 171 9728000 2200
60806341 wucstdio E Sept. 18, 2019, 5:36 p.m. OK GNU C++17 TESTS 57 171 9728000 2200
67959396 swust5120177231 E Dec. 30, 2019, 10:57 a.m. OK GNU C++17 TESTS 58 171 10752000 2200
61898988 zzyhuajuan E Oct. 5, 2019, 8:04 a.m. OK GNU C++17 TESTS 58 171 19456000 2200
65260568 serafimkoo E Nov. 17, 2019, 2:54 p.m. OK Java 11 TESTS 58 857 69836800 2200
60804389 uwi E Sept. 18, 2019, 5:25 p.m. OK Java 8 TESTS 57 265 9420800 2200
60816313 DarLam E Sept. 18, 2019, 8:27 p.m. OK Java 8 TESTS 57 311 23449600 2200
60806838 Taran_1407 E Sept. 18, 2019, 5:38 p.m. OK Java 8 TESTS 57 468 49356800 2200
60900367 tourist_plus_kan E Sept. 19, 2019, 8:58 p.m. OK Java 8 TESTS 58 499 85401600 2200
64698574 dalt E Nov. 11, 2019, 2:06 p.m. OK Java 8 TESTS 58 514 103321600 2200
60802945 AryssonFigueiredo E Sept. 18, 2019, 5:18 p.m. OK Java 8 TESTS 57 529 46182400 2200
61177649 4mda4mda E Sept. 23, 2019, 6:47 p.m. OK Java 8 TESTS 58 529 47820800 2200
60953116 fetetriste E Sept. 20, 2019, 11:52 p.m. OK Java 8 TESTS 58 607 44748800 2200
60808046 mikit E Sept. 18, 2019, 5:45 p.m. OK Java 8 TESTS 57 623 43110400 2200
60807091 barakraganosungam E Sept. 18, 2019, 5:40 p.m. OK Java 8 TESTS 57 623 62259200 2200
61303535 vjudge5 E Sept. 26, 2019, 6:12 a.m. OK MS C++ TESTS 58 171 45465600 2200
61302848 vjudge1 E Sept. 26, 2019, 5:51 a.m. OK MS C++ TESTS 58 186 45056000 2200
61303448 vjudge4 E Sept. 26, 2019, 6:10 a.m. OK MS C++ TESTS 58 202 46284800 2200
61821461 vjudge2 E Oct. 4, 2019, 2:30 a.m. OK MS C++ TESTS 58 233 44646400 2200
61859864 vjudge2 E Oct. 4, 2019, 3:03 p.m. OK MS C++ 2017 TESTS 58 264 16076800 2200
61835864 vjudge2 E Oct. 4, 2019, 8 a.m. OK MS C++ 2017 TESTS 58 374 16076800 2200
60831508 AleksanderBalobanov E Sept. 19, 2019, 7:07 a.m. OK MS C++ 2017 TESTS 57 483 45158400 2200
61451662 vjudge1 E Sept. 29, 2019, 3:25 a.m. OK MS C++ 2017 TESTS 58 577 19251200 2200
61324933 Z8N E Sept. 26, 2019, 1:34 p.m. OK MS C++ 2017 TESTS 58 577 19251200 2200
60817455 AlexanderL E Sept. 18, 2019, 9:03 p.m. OK MS C++ 2017 TESTS 57 592 9011200 2200
62060643 Ancient_mage E Oct. 7, 2019, 1:32 p.m. OK MS C++ 2017 TESTS 58 592 14233600 2200
67573669 43art E Dec. 24, 2019, 11:10 p.m. OK MS C++ 2017 TESTS 58 654 16896000 2200
61085936 alanM E Sept. 22, 2019, 6:21 p.m. OK MS C++ 2017 TESTS 58 717 23142400 2200
60801617 Prostoegor239 E Sept. 18, 2019, 5:11 p.m. OK MS C++ 2017 TESTS 57 717 26521600 2200
61376793 codershuvo E Sept. 27, 2019, 4:28 p.m. OK PyPy 3 TESTS 58 1138 52121600 2200
60939160 titia E Sept. 20, 2019, 4:26 p.m. OK Python 3 TESTS 58 1387 42291200 2200
61012394 dohduh E Sept. 21, 2019, 12:33 p.m. OK Python 3 TESTS 58 1653 85504000 2200
60947114 ValenKof E Sept. 20, 2019, 7:28 p.m. OK Rust TESTS 58 358 26419200 2200
60815486 yakamoto E Sept. 18, 2019, 8:06 p.m. OK Scala TESTS 57 748 31744000 2200
60809849 yakamoto E Sept. 18, 2019, 5:54 p.m. OK Scala TESTS 57 748 31744000 2200

remove filters

Back to search problems