Spanning Tree with One Fixed Degree
1133F21900· candidate master3s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
4 5 11 21 31 42 33 4
Output
YES2 12 33 4
Sample 2of 3
Input
4 5 31 21 31 42 33 4
Output
YES1 21 34 1
Sample 3of 3
Input
4 4 31 21 42 33 4
Output
NO
58%
1133F2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…