#include <bits/stdc++.h>
typedef long long ll;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n, k;
std::cin >> n >> k;
std::vector<std::vector<std::pair<ll, ll>>> adj(n + 1);
ll min_w = 1e15;
for (ll i = 0, u, v, w; i < n - 1; ++i) {
std::cin >> u >> v >> w;
adj[u].push_back({v, w});
adj[v].push_back({u, w});
min_w = std::min(min_w, w);
}
if (k < min_w) {
std::cout << n << '\n';
for (ll i = 1; i <= n; ++i) {
std::cout << i << ' ';
}
std::cout << '\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
127 ms |
25316 KB |
Output is correct |
2 |
Correct |
120 ms |
31944 KB |
Output is correct |
3 |
Correct |
45 ms |
11860 KB |
Output is correct |
4 |
Correct |
140 ms |
31060 KB |
Output is correct |
5 |
Correct |
0 ms |
456 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
128 ms |
25232 KB |
Output is correct |
2 |
Incorrect |
68 ms |
16208 KB |
Unexpected end of file - int32 expected |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
604 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
110 ms |
22384 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |