Submission #242314

#TimeUsernameProblemLanguageResultExecution timeMemory
242314SomeoneUnknownMagic Tree (CEOI19_magictree)C++14
3 / 100
55 ms768 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
    int V, f, md;
    scanf("%d %d %d", &V, &f, &md);
    int par[V+1];
    for(int i = 2; i <= V; i++){
        scanf("%d", &par[i]);
    }
    long long tal = 0;
    for(int i = 0; i < f; i++){
        int v, d, w;
        scanf("%d %d %d", &v, &d, &w);
        tal += w;
    }
    printf("%lld", tal);
}

Compilation message (stderr)

magictree.cpp: In function 'int main()':
magictree.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d", &V, &f, &md);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
magictree.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &par[i]);
         ~~~~~^~~~~~~~~~~~~~~
magictree.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d %d", &v, &d, &w);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...