Submission #525121

#TimeUsernameProblemLanguageResultExecution timeMemory
525121mjhmjh1104Firefighting (NOI20_firefighting)C++17
3 / 100
233 ms20256 KiB
#include <cstdio>
#include <vector>
#include <utility>
using namespace std;

int n;
long long k;
vector<pair<int, int>> adj[300006];

int main() {
    scanf("%d%lld", &n, &k);
    for (int i = 0; i < n - 1; i++) {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        a--, b--;
        adj[a].push_back({ b, c });
        adj[b].push_back({ a, c });
    }
    printf("%d\n", n);
    for (int i = 0; i < n; i++) printf("%d ", i + 1);
}

Compilation message (stderr)

Firefighting.cpp: In function 'int main()':
Firefighting.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d%lld", &n, &k);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
Firefighting.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d%d%d", &a, &b, &c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...