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.
Problems
B"You are given a weighted undirected connected graph consisting of n vertices and m edges. It is guaranteed that there are no self-loops or multiple edges in the given graph. Let's define the weight of the path consisting of k edges with indices e_1, e_2, ... , e_k as sum limits_{i=1}^{k}{w_{e_i}} - max limits_{i=1}^{k}{w_{e_i}} + min limits_{i=1}^{k}{w_{e_i}} , where w_i -- weight of the i -th edge in the graph. Your task is to find the minimum weight of the path from the 1 -st vertex to the i -th vertex for each i ( 2 <= i <= n ). The first line contains two integers n and m ( 2 <= n <= 2 cdot 10^5 ; 1 <= m <= 2 cdot 10^5 ) -- the number of vertices and the number of edges in the graph. Following m lines contains three integers v_i, u_i, w_i ( 1 <= v_i, u_i <= n ; 1 <= w_i <= 10^9 ; v_i neq u_i ) -- endpoints of the i -th edge and its weight respectively. Print n-1 integers -- the minimum weight of the path from 1 -st vertex to the i -th vertex for each i ( 2 <= i <= n ). "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
104343146 |
rainboy |
E |
Jan. 14, 2021, 4:27 p.m. |
OK |
GNU C11 |
TESTS |
61 |
1544 |
84787200 |
|
|
104347019 |
sher_wu |
E |
Jan. 14, 2021, 4:32 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
311 |
21094400 |
|
|
104373980 |
xryjr233 |
E |
Jan. 15, 2021, 2:53 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
639 |
34201600 |
|
|
104366059 |
Protagonist |
E |
Jan. 14, 2021, 9:23 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
655 |
33075200 |
|
|
104376031 |
DevourThemAll |
E |
Jan. 15, 2021, 3:54 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
655 |
79052800 |
|
|
104373726 |
skyRin |
E |
Jan. 15, 2021, 2:44 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
670 |
83763200 |
|
|
104376447 |
FluffyBunny |
E |
Jan. 15, 2021, 4:05 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
685 |
31744000 |
|
|
104344581 |
renshubing |
E |
Jan. 14, 2021, 4:28 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
701 |
38297600 |
|
|
104372507 |
prabowo |
E |
Jan. 15, 2021, 2:01 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
717 |
37683200 |
|
|
104373684 |
skyRin |
E |
Jan. 15, 2021, 2:43 a.m. |
OK |
GNU C++11 |
TESTS |
61 |
717 |
83763200 |
|
|
104353088 |
Yzm007 |
E |
Jan. 14, 2021, 5:14 p.m. |
OK |
GNU C++11 |
TESTS |
61 |
764 |
33382400 |
|
|
104373270 |
misir |
E |
Jan. 15, 2021, 2:29 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
655 |
42188800 |
|
|
104371588 |
PocoPoco |
E |
Jan. 15, 2021, 1:24 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
701 |
38195200 |
|
|
104371343 |
nandonathaniel |
E |
Jan. 15, 2021, 1:13 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
702 |
37785600 |
|
|
104372814 |
Implict |
E |
Jan. 15, 2021, 2:13 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
717 |
54988800 |
|
|
104369159 |
SuperJ6 |
E |
Jan. 14, 2021, 11:24 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
748 |
40652800 |
|
|
104375927 |
wmxwmx |
E |
Jan. 15, 2021, 3:51 a.m. |
OK |
GNU C++14 |
TESTS |
61 |
748 |
71168000 |
|
|
104351800 |
houguanli |
E |
Jan. 14, 2021, 5 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
779 |
67993600 |
|
|
104356299 |
elvahs |
E |
Jan. 14, 2021, 5:56 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
841 |
34713600 |
|
|
104346284 |
megatron10599 |
E |
Jan. 14, 2021, 4:30 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
951 |
24985600 |
|
|
104351046 |
Joysky |
E |
Jan. 14, 2021, 4:53 p.m. |
OK |
GNU C++14 |
TESTS |
61 |
967 |
89804800 |
|
|
104375255 |
albertxwz |
E |
Jan. 15, 2021, 3:31 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
343 |
18227200 |
|
|
104381578 |
LJL36 |
E |
Jan. 15, 2021, 6:07 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
373 |
18227200 |
|
|
104351810 |
CCoolGuang |
E |
Jan. 14, 2021, 5 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
467 |
80281600 |
|
|
104358927 |
ariloc |
E |
Jan. 14, 2021, 6:35 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
623 |
47718400 |
|
|
104353585 |
0375w |
E |
Jan. 14, 2021, 5:19 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
655 |
30924800 |
|
|
104374364 |
142 |
E |
Jan. 15, 2021, 3:06 a.m. |
OK |
GNU C++17 |
TESTS |
61 |
655 |
37785600 |
|
|
104349129 |
yyzs123 |
E |
Jan. 14, 2021, 4:38 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
670 |
31744000 |
|
|
104359066 |
Yellowgood |
E |
Jan. 14, 2021, 6:38 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
670 |
37478400 |
|
|
104355366 |
Lavine |
E |
Jan. 14, 2021, 5:43 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
670 |
38912000 |
|
|
104355445 |
Lakers_James |
E |
Jan. 14, 2021, 5:45 p.m. |
OK |
GNU C++17 |
TESTS |
61 |
670 |
38912000 |
|
|
104355425 |
Lakers_James |
E |
Jan. 14, 2021, 5:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
483 |
39936000 |
|
|
104362912 |
abhi2402 |
E |
Jan. 14, 2021, 7:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
530 |
41574400 |
|
|
104363874 |
Abraham |
E |
Jan. 14, 2021, 8:17 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
545 |
35532800 |
|
|
104368895 |
ScarletS |
E |
Jan. 14, 2021, 11:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
545 |
41574400 |
|
|
104352444 |
scol |
E |
Jan. 14, 2021, 5:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
560 |
39936000 |
|
|
104353154 |
PauloMiranda98 |
E |
Jan. 14, 2021, 5:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
560 |
43724800 |
|
|
104349485 |
MarcosK |
E |
Jan. 14, 2021, 4:40 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
560 |
59596800 |
|
|
104354550 |
Mr.Robot_28 |
E |
Jan. 14, 2021, 5:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
561 |
38092800 |
|
|
104371654 |
generic_placeholder_name |
E |
Jan. 15, 2021, 1:27 a.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
561 |
41574400 |
|
|
104375682 |
inszva |
E |
Jan. 15, 2021, 3:45 a.m. |
OK |
GNU C++17 (64) |
TESTS |
61 |
576 |
31027200 |
|
|
104353907 |
skittles1412 |
E |
Jan. 14, 2021, 5:23 p.m. |
OK |
Java 11 |
TESTS |
61 |
2667 |
112947200 |
|
|
104356760 |
skittles1412 |
E |
Jan. 14, 2021, 6:03 p.m. |
OK |
Java 11 |
TESTS |
61 |
2698 |
260608000 |
|
|
104338469 |
Dukkha |
E |
Jan. 14, 2021, 4:19 p.m. |
OK |
Java 11 |
TESTS |
61 |
2729 |
153497600 |
|
|
104363896 |
sarthakmanna |
E |
Jan. 14, 2021, 8:17 p.m. |
OK |
Java 11 |
TESTS |
61 |
2979 |
260505600 |
|
|
104363952 |
sarthakmanna |
E |
Jan. 14, 2021, 8:19 p.m. |
OK |
Java 11 |
TESTS |
61 |
2979 |
260608000 |
|
|
104358067 |
SecondThread |
E |
Jan. 14, 2021, 6:22 p.m. |
OK |
Java 11 |
TESTS |
61 |
2994 |
239308800 |
|
|
104365680 |
polyakoff |
E |
Jan. 14, 2021, 9:10 p.m. |
OK |
Java 8 |
TESTS |
61 |
2371 |
55296000 |
|
|
104370828 |
golions |
E |
Jan. 15, 2021, 12:46 a.m. |
OK |
Java 8 |
TESTS |
61 |
2433 |
72806400 |
|
|
104369945 |
hu_tao |
E |
Jan. 15, 2021, 12:03 a.m. |
OK |
Java 8 |
TESTS |
61 |
2464 |
84377600 |
|
|
104350114 |
hu_tao |
E |
Jan. 14, 2021, 4:45 p.m. |
OK |
Java 8 |
TESTS |
61 |
2464 |
84480000 |
|
|
104369933 |
hu_tao |
E |
Jan. 15, 2021, 12:02 a.m. |
OK |
Java 8 |
TESTS |
61 |
2496 |
73011200 |
|
|
104367280 |
hu_tao |
E |
Jan. 14, 2021, 10:07 p.m. |
OK |
Java 8 |
TESTS |
61 |
2636 |
73011200 |
|
|
104373906 |
qlf9 |
E |
Jan. 15, 2021, 2:51 a.m. |
OK |
Java 8 |
TESTS |
61 |
2698 |
75571200 |
|
|
104370923 |
flyman3046 |
E |
Jan. 15, 2021, 12:51 a.m. |
OK |
Java 8 |
TESTS |
61 |
2745 |
146841600 |
|
|
104370674 |
koboshi |
E |
Jan. 15, 2021, 12:38 a.m. |
OK |
Kotlin |
TESTS |
61 |
2558 |
83865600 |
|
|
104351268 |
pichulia |
E |
Jan. 14, 2021, 4:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
61 |
779 |
34406400 |
|
|
104360128 |
fairy_lettuce |
E |
Jan. 14, 2021, 6:56 p.m. |
OK |
.NET Core C# |
TESTS |
61 |
1902 |
73932800 |
|
|
104355355 |
fairy_lettuce |
E |
Jan. 14, 2021, 5:43 p.m. |
OK |
.NET Core C# |
TESTS |
61 |
2636 |
197529600 |
|
|
remove filters
Back to search problems