답안 #242297

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
242297 2020-06-27T08:26:29 Z dantoh000 Magic Tree (CEOI19_magictree) C++14
3 / 100
71 ms 5632 KB
#include <bits/stdc++.h>
using namespace std;
int n,m,k;
int p[100005];
vector<int> G[100005];
long long ans = 0;
int dp1[100005], dp2[100005];
int main(){
    scanf("%d%d%d",&n,&m,&k);
    for (int i = 2; i <= n; i++){
        scanf("%d",&p[i]);
        G[p[i]].push_back(i);
    }
    for (int i = 0; i < m; i++){
        int v,d,w;
        scanf("%d%d%d",&v,&d,&w);
        ans += w;
    }
    printf("%lld",ans);
    //dfs(1,-1);
    //printf("%d",dp1[];
}

Compilation message

magictree.cpp: In function 'int main()':
magictree.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d",&n,&m,&k);
     ~~~~~^~~~~~~~~~~~~~~~~~~
magictree.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&p[i]);
         ~~~~~^~~~~~~~~~~~
magictree.cpp:16: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);
         ~~~~~^~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 2688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 45 ms 4480 KB Output is correct
2 Correct 40 ms 5632 KB Output is correct
3 Correct 62 ms 3712 KB Output is correct
4 Correct 53 ms 3580 KB Output is correct
5 Correct 67 ms 3840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 2688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 71 ms 4608 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 2688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 3072 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 2688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 2688 KB Output isn't correct
2 Halted 0 ms 0 KB -