Submission #1084391

#TimeUsernameProblemLanguageResultExecution timeMemory
1084391avighnaFirefighting (NOI20_firefighting)C++17
0 / 100
140 ms30028 KiB
#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 = 0;
  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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...