제출 #239637

#제출 시각아이디문제언어결과실행 시간메모리
239637super_j6친구 (IOI14_friend)C++14
100 / 100
42 ms2740 KiB
#include "friend.h" #include <iostream> #include <cstdio> #include <algorithm> #include <vector> using namespace std; #define endl '\n' #define ll long long #define pi pair<int, int> #define f first #define s second int findSample(int n, int a[], int p[], int b[]){ int ret = 0; for(int i = n - 1; i; i--){ switch(b[i]){ case 0: ret += a[i]; a[p[i]] = max(a[p[i]] - a[i], 0); break; case 1: a[p[i]] += a[i]; break; case 2: a[p[i]] = max(a[p[i]], a[i]); break; } } return ret + a[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...