Submission #50810

#TimeUsernameProblemLanguageResultExecution timeMemory
50810Just_Solve_The_ProblemFriend (IOI14_friend)C++11
0 / 100
8 ms5976 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; #define pb push_back #define sz(s) (int)s.size() #define pii pair < int, int > #define fr first #define sc second #define mk make_pair #define all(s) s.begin(), s.end() const int N = (int)1e5 + 7; const int smN = (int)1e3 + 7; vector < int > gr[N]; int c[N]; void addedge(int a, int b) { gr[a].pb(b); gr[b].pb(a); } int findSample(int n, int confidence[], int host[], int protocol[]){ for (int i = 0; i < n; i++) c[i] = confidence[i]; for (int i = 1; i < n; i++) { if (protocol[i] == 0 || protocol[i] == 2) { addedge(host[i], i); } if (protocol[i] == 1 || protocol[i] == 2) { for (int to : gr[host[i]]) { addedge(to, i); } } } int ans = 0; for (int i = 0; i < n; i++) { ans = max(ans, c[i]); } return ans; }
#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...