제출 #297718

#제출 시각아이디문제언어결과실행 시간메모리
297718peti1234친구 (IOI14_friend)C++17
100 / 100
35 ms1528 KiB
#include <bits/stdc++.h> using namespace std; int findSample(int n, int con[], int h[], int p[]) { int sum=0; for (int i=n-1; i>0; i--) { int a=h[i], b=p[i], c=con[i]; if (b==2) con[a]=max(con[a], c); if (b==1) con[a]+=c; if (b==0) sum+=c, con[a]=max(0, con[a]-c); } return sum+con[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...