Codeforces Round 582 (Div. 3)

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
1213 Codeforces Round 582 (Div. 3) FINISHED False 7200 170263487 Aug. 30, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7604 ) G Path Queries PROGRAMMING divide and conquer ds graphs sortings trees 2000

B"You are given a weighted tree consisting of n vertices. Recall that a tree is a connected graph without cycles. Vertices u_i and v_i are connected by an edge with weight w_i . You are given m queries. The i -th query is given as an integer q_i . In this query you need to calculate the number of pairs of vertices (u, v) ( u < v ) such that the maximum weight of an edge on a simple path between u and v doesn't exceed q_i . The first line of the input contains two integers n and m ( 1 <= n, m <= 2 cdot 10^5 ) -- the number of vertices in the tree and the number of queries. Each of the next n - 1 lines describes an edge of the tree. Edge i is denoted by three integers u_i , v_i and w_i -- the labels of vertices it connects ( 1 <= u_i, v_i <= n , u_i ne v_i ) and the weight of the edge ( 1 <= w_i <= 2 cdot 10^5 ). It is guaranteed that the given edges form a tree. The last line of the input contains m integers q_1, q_2, ... , q_m ( 1 <= q_i <= 2 cdot 10^5 ), where q_i is the maximum weight of an edge in the i -th query. Print m integers -- the answers to the queries. The i -th value should be equal to the number of pairs of vertices (u, v) ( u < v ) such that the maximum weight of an edge on a simple path between u and v doesn't exceed q_i . Queries are numbered from 1 to m in the order of the input. The picture shows the tree from the first example: "...

Tutorials

Codeforces Round #582 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
61404831 Alice123 G Sept. 28, 2019, 6:40 a.m. OK Clang++17 Diagnostics TESTS 71 1263 7065600 2000
61365607 Alice123 G Sept. 27, 2019, 1:25 p.m. OK Clang++17 Diagnostics TESTS 71 1309 36659200 2000
66188623 LaSWeeG G Dec. 2, 2019, 3:31 p.m. OK FPC TESTS 71 795 27238400 2000
66189293 LaSWeeG G Dec. 2, 2019, 3:46 p.m. OK FPC TESTS 71 811 27238400 2000
65253576 LaSWeeG G Nov. 17, 2019, 12:45 p.m. OK FPC TESTS 71 2323 26726400 2000
66188133 LaSWeeG G Dec. 2, 2019, 3:21 p.m. OK FPC TESTS 71 2480 26726400 2000
60329526 yugao G Sept. 10, 2019, 4:52 a.m. OK GNU C++11 TESTS 71 109 13619200 2000
60441418 ILoLy G Sept. 12, 2019, 12:39 p.m. OK GNU C++11 TESTS 71 109 42598400 2000
62392264 LuciferX07 G Oct. 12, 2019, 3:09 a.m. OK GNU C++11 TESTS 71 124 7884800 2000
63954296 Last_diary G Nov. 1, 2019, 12:04 a.m. OK GNU C++11 TESTS 71 124 8294400 2000
60487136 wcrkonjac G Sept. 13, 2019, 1:03 p.m. OK GNU C++11 TESTS 71 124 9011200 2000
68111017 Xing_Ling G Jan. 3, 2020, 9:32 a.m. OK GNU C++11 TESTS 71 124 10342400 2000
59978984 ningyuheng G Sept. 4, 2019, 7:23 a.m. OK GNU C++11 TESTS 71 124 11980800 2000
62407397 luogu_bot4 G Oct. 12, 2019, 9:24 a.m. OK GNU C++11 TESTS 71 124 13619200 2000
62406857 luogu_bot5 G Oct. 12, 2019, 9:14 a.m. OK GNU C++11 TESTS 71 124 13619200 2000
64372352 Dream-chasing_Juvenile G Nov. 6, 2019, 2:44 p.m. OK GNU C++11 TESTS 71 124 14438400 2000
63953767 Last_diary G Oct. 31, 2019, 11:35 p.m. OK GNU C++14 TESTS 71 108 8294400 2000
59938801 luogu_bot3 G Sept. 3, 2019, 10:36 a.m. OK GNU C++14 TESTS 71 124 17510400 2000
60050348 Lezedary_sandwich G Sept. 4, 2019, 11:54 p.m. OK GNU C++14 TESTS 71 156 7270400 2000
67293169 kal013 G Dec. 20, 2019, 4:09 p.m. OK GNU C++14 TESTS 71 187 17305600 2000
59837837 tjd229 G Sept. 1, 2019, 5:33 a.m. OK GNU C++14 TESTS 71 202 12800000 2000
64757067 Deobrah G Nov. 12, 2019, 5:23 p.m. OK GNU C++14 TESTS 71 233 7987200 2000
60391130 onlystar G Sept. 11, 2019, 1:20 p.m. OK GNU C++14 TESTS 71 233 13619200 2000
59941977 201801090150 G Sept. 3, 2019, 11:46 a.m. OK GNU C++14 TESTS 71 234 15257600 2000
59850897 wucstdio G Sept. 1, 2019, 11:29 a.m. OK GNU C++14 TESTS 71 249 6348800 2000
61883320 huyhuy G Oct. 5, 2019, 1:51 a.m. OK GNU C++14 TESTS 71 249 6451200 2000
59938512 qiyue G Sept. 3, 2019, 10:29 a.m. OK GNU C++17 TESTS 71 124 18534400 2000
60474270 nickluo G Sept. 13, 2019, 7:14 a.m. OK GNU C++17 TESTS 71 140 8499200 2000
59938702 qiyue G Sept. 3, 2019, 10:34 a.m. OK GNU C++17 TESTS 71 140 15360000 2000
59925298 1946037404 G Sept. 3, 2019, 3:27 a.m. OK GNU C++17 TESTS 71 202 13619200 2000
60068643 swustfang G Sept. 5, 2019, 10:14 a.m. OK GNU C++17 TESTS 71 218 42496000 2000
60196848 slzxchy G Sept. 7, 2019, 2:24 a.m. OK GNU C++17 TESTS 71 233 11980800 2000
60056489 swust5120170583 G Sept. 5, 2019, 4:33 a.m. OK GNU C++17 TESTS 71 233 15360000 2000
59837933 Patti G Sept. 1, 2019, 5:37 a.m. OK GNU C++17 TESTS 71 234 10444800 2000
61928093 Star-Platinum G Oct. 5, 2019, 3:19 p.m. OK GNU C++17 TESTS 71 234 11980800 2000
60954380 nuanxin G Sept. 21, 2019, 1:28 a.m. OK GNU C++17 TESTS 71 234 13619200 2000
60453123 smtcoder G Sept. 12, 2019, 4:46 p.m. OK Go TESTS 71 1232 14336000 2000
59916680 dioji G Sept. 2, 2019, 7:35 p.m. OK Go TESTS 71 1247 16281600 2000
66510850 KulikAlex G Dec. 8, 2019, 4:30 p.m. OK Java 11 TESTS 71 670 19456000 2000
59906133 xodiac G Sept. 2, 2019, 3:26 p.m. OK Java 8 TESTS 71 374 8192000 2000
59977629 p_unit G Sept. 4, 2019, 6:45 a.m. OK Java 8 TESTS 71 390 22937600 2000
59888255 In_The_Name_Of_Love G Sept. 2, 2019, 9:07 a.m. OK Java 8 TESTS 71 405 8192000 2000
59912385 TheSawan G Sept. 2, 2019, 5:44 p.m. OK Java 8 TESTS 71 405 8294400 2000
60604104 ykt836 G Sept. 15, 2019, 8:51 a.m. OK Java 8 TESTS 71 420 16998400 2000
59912188 Jarik G Sept. 2, 2019, 5:39 p.m. OK Java 8 TESTS 71 421 11980800 2000
60503239 hasan5788 G Sept. 13, 2019, 7:51 p.m. OK Java 8 TESTS 71 436 6758400 2000
60502602 alireza_sh G Sept. 13, 2019, 7:28 p.m. OK Java 8 TESTS 71 436 6758400 2000
59900928 marcose18 G Sept. 2, 2019, 1:39 p.m. OK Java 8 TESTS 71 452 18534400 2000
61676050 _rdv_ G Oct. 1, 2019, 8:39 p.m. OK Java 8 TESTS 71 483 16179200 2000
59928812 Spheniscine G Sept. 3, 2019, 5:54 a.m. OK Kotlin TESTS 71 779 33177600 2000
59928470 Spheniscine G Sept. 3, 2019, 5:40 a.m. OK Kotlin TESTS 71 795 33177600 2000
59929683 Spheniscine G Sept. 3, 2019, 6:26 a.m. OK Kotlin TESTS 71 841 33177600 2000
60035856 yakamoto G Sept. 4, 2019, 4:45 p.m. OK Kotlin TESTS 71 904 19763200 2000
66312231 vjudge2 G Dec. 5, 2019, 11:50 a.m. OK MS C++ TESTS 71 218 7987200 2000
64072989 vjudge1 G Nov. 2, 2019, 8:01 a.m. OK MS C++ TESTS 71 218 7987200 2000
62174012 vjudge3 G Oct. 9, 2019, 2:57 a.m. OK MS C++ TESTS 71 234 10444800 2000
66308842 vjudge1 G Dec. 5, 2019, 10:36 a.m. OK MS C++ TESTS 71 249 10444800 2000
66296921 vjudge2 G Dec. 5, 2019, 4:59 a.m. OK MS C++ TESTS 71 249 10444800 2000
60956259 vjudge5 G Sept. 21, 2019, 2:50 a.m. OK MS C++ TESTS 71 249 22425600 2000
60715190 vjudge1 G Sept. 17, 2019, 10:18 a.m. OK MS C++ TESTS 71 265 9625600 2000
60713839 vjudge4 G Sept. 17, 2019, 9:41 a.m. OK MS C++ TESTS 71 265 9625600 2000
69888656 vjudge1 G Jan. 31, 2020, 9:10 a.m. OK MS C++ TESTS 71 265 10444800 2000
60713806 vjudge5 G Sept. 17, 2019, 9:40 a.m. OK MS C++ TESTS 71 280 9625600 2000
61044670 dzcixy G Sept. 22, 2019, 3:32 a.m. OK MS C++ 2017 TESTS 71 296 34508800 2000
66523189 vjudge1 G Dec. 9, 2019, 1:44 a.m. OK MS C++ 2017 TESTS 71 311 7987200 2000
68635990 vjudge5 G Jan. 12, 2020, 5:49 a.m. OK MS C++ 2017 TESTS 71 327 9625600 2000
68635838 ganyu G Jan. 12, 2020, 5:45 a.m. OK MS C++ 2017 TESTS 71 342 9625600 2000
66430788 vjudge4 G Dec. 7, 2019, 2:40 a.m. OK MS C++ 2017 TESTS 71 343 10444800 2000
59874588 WoodMachine G Sept. 1, 2019, 9:53 p.m. OK MS C++ 2017 TESTS 71 748 5632000 2000
68878153 SendThemToHell G Jan. 15, 2020, 5:41 p.m. OK MS C++ 2017 TESTS 71 748 8294400 2000
60129419 Falca G Sept. 5, 2019, 4:44 p.m. OK MS C++ 2017 TESTS 71 779 9420800 2000
64528063 Gareton G Nov. 8, 2019, 2:26 p.m. OK MS C++ 2017 TESTS 71 810 8806400 2000
59960111 dimasidorenko G Sept. 3, 2019, 5:40 p.m. OK MS C++ 2017 TESTS 71 826 7270400 2000
68997042 YESMAths G Jan. 17, 2020, 5:50 p.m. OK PyPy 2 TESTS 71 1481 66867200 2000
59958295 anujsingh14 G Sept. 3, 2019, 5 p.m. OK PyPy 2 TESTS 71 1512 49971200 2000
59957688 iamprayush G Sept. 3, 2019, 4:47 p.m. OK PyPy 2 TESTS 71 1575 50995200 2000
59959389 iamprayush G Sept. 3, 2019, 5:24 p.m. OK PyPy 2 TESTS 71 1652 50176000 2000
59879198 macleChen G Sept. 2, 2019, 3:18 a.m. OK PyPy 3 TESTS 71 1481 48537600 2000
61266466 neterukun G Sept. 25, 2019, 12:53 p.m. OK PyPy 3 TESTS 71 2090 44851200 2000
59842554 tjake G Sept. 1, 2019, 7:58 a.m. OK PyPy 3 TESTS 71 2105 80384000 2000
59842600 tjake G Sept. 1, 2019, 7:59 a.m. OK PyPy 3 TESTS 71 2136 80384000 2000
59842576 tjake G Sept. 1, 2019, 7:59 a.m. OK PyPy 3 TESTS 71 2152 80691200 2000
59842285 tjake G Sept. 1, 2019, 7:50 a.m. OK PyPy 3 TESTS 71 2168 76492800 2000
59842493 tjake G Sept. 1, 2019, 7:56 a.m. OK PyPy 3 TESTS 71 2214 80588800 2000
59842620 tjake G Sept. 1, 2019, 8 a.m. OK PyPy 3 TESTS 71 2215 77414400 2000
59842642 tjake G Sept. 1, 2019, 8:01 a.m. OK Python 3 TESTS 71 1887 69939200 2000
60045029 smart_hard G Sept. 4, 2019, 7:58 p.m. OK Python 3 TESTS 71 2418 48128000 2000
60044973 smart_hard G Sept. 4, 2019, 7:57 p.m. OK Python 3 TESTS 71 2511 48128000 2000
59859028 beemax G Sept. 1, 2019, 2:34 p.m. OK Python 3 TESTS 71 2526 46592000 2000
60036824 kshitij_sodani G Sept. 4, 2019, 5:02 p.m. OK Python 3 TESTS 71 2620 52633600 2000
60148315 gazaan G Sept. 6, 2019, 2:08 a.m. OK Scala TESTS 71 1730 61542400 2000

remove filters

Back to search problems