Submission #1183591

#TimeUsernameProblemLanguageResultExecution timeMemory
1183591jasonicFriend (IOI14_friend)C++20
0 / 100
1 ms328 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; } for(int j = N-1; j > 0; j--) { int i = host[j]; if(protocol[j] == 1) {x[i] = x[i] + y[j]; y[i] = max(y[i] + x[j], y[i] + y[j]);} else if(protocol[j] == 2) {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] == 3) {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...