# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
244614 | kimbj0709 | Political Development (BOI17_politicaldevelopment) | C++14 | 6 ms | 3072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define maxn 50050
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int no_of_people,k;
int no_of_input1;
int input;
cin >> no_of_people >> k;
vector<unordered_set<int> > adj(maxn);
bool can2 = 0;
for(int i=0;i<no_of_people;i++){
cin >> no_of_input1;
for(int j=0;j<no_of_input1;j++){
can2 = 1;
cin >> input;
adj[i].insert(input);
}
}
int ans = 1;
for(int i=0;i<no_of_people;i++){
for(int j=0;j<pow(2,adj[i].size());j++){
vector<int> temp;
if(__builtin_popcount(j)>=k){
continue;
}
int cnt = 0;
for(auto kk:adj[i]){
if(j&(1<<cnt)){
temp.push_back(kk);
}
cnt++;
}
temp.push_back(i);
for(int a=0;a<temp.size();a++){
for(int b=0;b<temp.size();b++){
if(a==b){
continue;
}
if(adj[a].count(b)==0){
goto cont;
}
}
}
ans = max(ans,(int)__builtin_popcount(j)+1);
cont : ;
}
}
cout << ans;
}
컴파일 시 표준 에러 (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... |