Submission #244611

#TimeUsernameProblemLanguageResultExecution timeMemory
244611kimbj0709Political Development (BOI17_politicaldevelopment)C++14
16 / 100
290 ms18808 KiB
#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; //cout << input << " "; adj[i].insert(input); } //cout << "\n"; //cout << "-----------\n"; } for(int i=0;i<no_of_people;i++){ for(auto l:adj[i]){ for(auto j:adj[l]){ //cout << i << " " << j << "--\n"; if(j!=i&&adj[i].count(j)!=0){ cout << min(k,(int)3); return 0; } } } } if(can2==1){ cout << min(k,(int)2); } else{ cout << min(k,(int)1); } }
#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...