Submission #898735

# Submission time Handle Problem Language Result Execution time Memory
898735 2024-01-05T05:11:13 Z vjudge1 Magic Tree (CEOI19_magictree) C++17
0 / 100
34 ms 5420 KB
//In His Name
#include <bits/stdc++.h>
//#pragma GCC optimization("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
using namespace std;
#define ll long long
//#define int ll
typedef pair<int, int> pii;
#define F first
#define S second
#define pb push_back
#define bug(x) cout << "Ah shit , here we go again : " << x <<endl
#define all(x) x.begin() , x.end()
const int maxn = 1e5 + 10, MOD = 1e9 + 7 ;
const ll INF = 1e18 + 100;

int n , m , k , v[maxn] ,d[maxn] , w[maxn];
vector<int> adj[maxn];

int32_t main(){    
    ios_base::sync_with_stdio(false);
    cin.tie(0) , cout.tie(0);
    
    cin >> n >> m >> k;
    for(int i = 2 ; i <= n ; i++){
        int p;
        cin >> p;
        adj[p].pb(i);
    }
    int ans = 0;
    for(int i = 1 ; i <= m ; i++){
        cin >> v[i] >> d[i] >> w[i];
        ans += w[i];
    }    
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 4444 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 5420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 2908 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -