Submission #1184327

#TimeUsernameProblemLanguageResultExecution timeMemory
1184327jasonic친구 (IOI14_friend)C++20
100 / 100
389 ms3660 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define fastIO cin.tie(0); ios::sync_with_stdio(false) int x[100005]; int y[100005]; int findSample(int N, int confidence[], int host[], int protocol[]) { for(int i = 0; i < N; i++) { x[i] = confidence[i]; y[i] = 0; cerr << i << ' ' << x[i] << ' ' << y[i] << endl; } for(int j = N-1; j > 0; j--) { int i = host[j]; if (protocol[j] == 0) { x[i] = x[i] + y[j]; y[i] = max(y[i] + x[j], y[i] + y[j]); } else if (protocol[j] == 1) { x[i] = max({x[i] + x[j], x[i] + y[j], y[i] + x[j]}); y[i] = y[i] + y[j]; } else if (protocol[j] == 2) { x[i] = max(x[i] + y[j], y[i] + x[j]); y[i] = y[i] + y[j]; } } return max(x[0], y[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...