Submission #392877

#TimeUsernameProblemLanguageResultExecution timeMemory
392877Aldas25Friend (IOI14_friend)C++14
16 / 100
1 ms332 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define REP(n) FOR(O, 1, (n)) #define f first #define s second #define pb push_back typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pii> vii; const int MAXN = 100100; int n; int conf[MAXN], h[MAXN], prot[MAXN]; int sub2 () { int ret = 0; FOR(i, 0, n-1) ret += conf[i]; return ret; } int sub3 () { int ret = 0; FOR(i, 0, n-1) ret = max(ret, conf[i]); return ret; } int findSample(int N,int confidence[],int host[],int protocol[]){ n = N; FOR(i, 0, n-1) conf[i] = confidence[i]; FOR(i, 1, n-1) h[i] = host[i], prot[i] = protocol[i]; bool is2 = true; bool is3 = true; FOR(i, 1, n-1) { if (protocol[i] != 1) is2 = false; if (protocol[i] != 2) is3 = false; } if (is2) return sub2(); else if (is3) return sub3(); else return sub3(); }
#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...