제출 #986933

#제출 시각아이디문제언어결과실행 시간메모리
986933zsombor친구 (IOI14_friend)C++17
16 / 100
1 ms600 KiB
#include "friend.h" int findSample(int n, int c[], int h[], int p[]) { int ans = 0; for (int i = n - 1; i > 0; i--) { if (p[i] == 0) { c[h[i]] -= c[i]; ans += c[i]; } if (p[i] == 1) c[h[i]] += (c[i] > 0 ? c[i] : 0); if (p[i] == 2 && c[i] > c[h[i]]) c[h[i]] = c[i]; } return ans + (c[0] > 0 ? c[0] : 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...