# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1074390 | mindiyak | Friend (IOI14_friend) | C++14 | 12 ms | 5140 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 "friend.h"
#include <iostream>
#include <vector>
#include <set>
using namespace std;
vector<set<int>> friends(1005);
int findSample(int n,int confidence[],int host[],int protocol[]){
int type[3] = {0,0,0};
for(int i = 0;i<n;i++){
if (i == 0)continue;
if(protocol[i] == 0){
friends[host[i]].insert(i+1);
friends[i+1].insert(host[i]);
}else if(protocol[i] == 1){
for(int a:friends[host[i]]){
friends[i+1].insert(a);
friends[a].insert(i+1);
}
}else{
friends[host[i]].insert(i+1);
friends[i+1].insert(host[i]);
for(int a:friends[host[i]]){
friends[i+1].insert(a);
friends[a].insert(i+1);
}
}
# | 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... |