제출 #421010

#제출 시각아이디문제언어결과실행 시간메모리
421010faresbasbs친구 (IOI14_friend)C++14
0 / 100
1 ms332 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; vector<int> graph[1001]; bool seen[1001]; int dfs(int curr , int tag){ seen[curr] = 1; int ret = 0; if(tag == 0){ ret = 1; } for(auto i : graph[curr]){ if(seen[i]){ continue; } ret += dfs(i,1-tag); } return ret; } int findSample(int n , int confidence[] , int host[] , int protocol[]){ for(int i = 1 ; i < n ; i += 1){ if(protocol[i] == 1){ graph[host[i]].push_back(i); graph[i].push_back(host[i]); }else{ for(auto j : graph[host[i]]){ graph[i].push_back(j); graph[j].push_back(i); } } } int num = dfs(1,0); return max(num,n-num); }
#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...