제출 #133693

#제출 시각아이디문제언어결과실행 시간메모리
133693antimirage친구 (IOI14_friend)C++14
0 / 100
2 ms376 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; int findSample(int n,int c[],int p[],int t[]){ int ans = 0; for (int i = n - 1; i >= 0; i--) { if (t[i] == 0) { c[p[i]] = max(0, c[p[i]] - c[i]); ans += c[i]; } else if (t[i] == 1) { c[p[i]] += c[i]; } else { c[p[i]] = max( c[p[i]], c[i] ); } } return ans + c[0]; }
#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...