제출 #297241

#제출 시각아이디문제언어결과실행 시간메모리
297241arayi친구 (IOI14_friend)C++17
100 / 100
37 ms2680 KiB
#include <bits/stdc++.h> #include "friend.h" #define ad push_back using namespace std; int pat; int findSample(int n,int sz[],int host[],int pr[]) { for(int i = n - 1; i > 0; i--) { if(pr[i] == 0) { pat += sz[i]; sz[host[i]] = max(0, sz[host[i]] - sz[i]); } else if(pr[i] == 1) sz[host[i]] += sz[i]; else { sz[host[i]] = max(0, sz[host[i]] - sz[i]); sz[host[i]] += sz[i]; } } return pat + sz[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...