Problems
 
 
# Name    
A
standard input/output
1 s, 256 MB
Submit  x24992
B
standard input/output
1 s, 256 MB
Submit  x22474
C
standard input/output
1 s, 256 MB
Submit  x21452
D
standard input/output
1.5 s, 256 MB
Submit  x5237
E1
standard input/output
3.5 s, 512 MB
Submit  x2548
E2
standard input/output
3.5 s, 512 MB
Submit  x1686
F
standard input/output
4.5 s, 768 MB
Submit  x540
Complete problemset
 
 
 
 
Questions about problems
 
 
  Question Answer
2022-08-13 18:33:33
Announcement
Problem D. Empty Graph
*****
The length of the shortest path between u and v is the minimum possible sum of weights of edges on the path between u and v
2022-08-13 18:24:25
Announcement
Problem D. Empty Graph
*****
Please, notice that the diameter of graph equals to the maximum d(u, v) for each u < v, where d(u, v) is the length of the shortest path between u and v.

Let's consider the second test case. For example, we can replace the first and the second elements of the array with 10^9, so the resulting array will be [10^9, 10^9, 84].

d(1, 2) = 168 (path 1 -> 3 -> 2)
d(1, 3) = 84 (path 1 -> 3)
d(2, 3) = 84 (path 2 -> 3)

So, the diameter will be equal to max(168, 84, 84) = 168.