제출 #1107599

#제출 시각아이디문제언어결과실행 시간메모리
1107599vjudge1Magic Tree (CEOI19_magictree)C++17
0 / 100
1125 ms1048576 KiB
/****************************************************** | '_ \ / _` |/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | (__| | | | | | (_| | | | | | .__/ \__,_|\___|_| |_| |_|\__,_|_| |_| |_| __| |____________________________________________ ,--. ,--. ,--. ,--. |oo | _ \ `. | oo | | oo| o o|~~ |(_) / ; | ~~ | | ~~|o o o o o |/\/\| '._,' |/\/\| |/\/\| __________________ ____________________________ ******************************************************/ #include <bits/stdc++.h> //#include "bigint.h" #define db(x) cerr << #x << ": " << x << endl #define print cerr << "Ah shit, here we go agian" << endl #define int long long int #define vii vector<int> #define pii pair<int ,int> #define vpi vector< pii > #define ff first #define ss second #define mp make_pair #define mod 1000000007 using namespace std; const int maxn = 1e5 + 100; int n, m, k; vector<int> adj[maxn], child[maxn]; int w[maxn], d[maxn]; map<int ,int> dp[maxn]; void solve(){ cin >> n >> m >> k; int dp[n + 10][k + 10] = {}; for(int i = 2 ;i <= n; i++){ int x; cin >> x; adj[x].push_back(i); adj[i].push_back(x); } int ans = 0; for(int i = 1 ;i <= m; i++){ int v; cin >> v; cin >> d[v] >> w[v]; ans += w[v]; } cout << ans << endl; } signed main(){ ios_base::sync_with_stdio(0), cin.tie(0) ,cout.tie(0); //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); int t = 1; /// cin >> t; while(t--){ solve(); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

magictree.cpp: In function 'void solve()':
magictree.cpp:45:6: warning: unused variable 'dp' [-Wunused-variable]
   45 |  int dp[n + 10][k + 10] = {};
      |      ^~
#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...