제출 #115760

#제출 시각아이디문제언어결과실행 시간메모리
115760RezwanArefin01친구 (IOI14_friend)C++17
100 / 100
31 ms2688 KiB
#include "friend.h" #define max(a, b) ((a) > (b) ? (a) : (b)) int findSample(int n, int val[], int host[], int typ[]){ int ans = 0; for(int i = n - 1; i >= 1; --i) { int &A = val[host[i]], &B = val[i]; if(typ[i] == 0) ans += B, A = max(0, A - B); if(typ[i] == 1) A += B; if(typ[i] == 2) A = max(A, B); } return ans + val[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...