# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1017209 | n3rm1n | Friend (IOI14_friend) | C++17 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define endl '\n'
#include "friend.h"
using namespace std;
vector < int > g[1005];
int cnt[4];
int findSample(int n, int confidence[], int host[], int protocol[])
{
for (int i = 1; i < n; ++ i)
g[host[i]].push_back(i);
for (int i = 1; i < n; ++ i)
{
cnt[protocol[i]] ++;
}
if(cnt[1] == n-1)
{
long long curr = 0, ans = 0;
for (int i = 0; i < n; ++ i)
{
curr = confidence[i];
for (int j = 0; j < g[i].size(); ++ j)
curr += confidence[g[i][j]];
ans = max(ans, curr);
}
return ans;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |