제출 #1306219

#제출 시각아이디문제언어결과실행 시간메모리
1306219zertiniiPolitical Development (BOI17_politicaldevelopment)C++20
0 / 100
97 ms196156 KiB
#include <bits/stdc++.h> using namespace std; #define ios ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr) #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin() + 1, (x).rend() #define fi first #define se second #define yes cout << "YES" << '\n' #define no cout << "NO" << '\n' #define int long long #define veci vector<int> #define skip continue #define sz size() #define pii pair<int,int> const int mod = 1e9 + 7; const int N = 52; const int inf = 1e18; void zertinii() { int n, m; cin >> n >> m; bool ok = false; veci a(n + 1); int c[n][n]; for(int i = 1;i <= n;i++) { cin >> a[i]; veci b(a[i] + 1); if(a[i] > 0) { ok = true; } for(int j = 1;j <= a[i];j++) { cin >> b[j]; c[i][b[j]] = 1; c[b[j]][i] = 1; } } if(m == 1) { cout << 1; return; } else { if(ok) { cout << 2; return; } else { cout << 1; return; } } for(int i = 1;i <= n;i++) { for(int j = i + 1;j <= n;j++) { if(!c[i][j]) { continue; } else { break; } for(int k = j + 1;k <= n;k++) { if(c[i][k] and c[j][k]) { cout << 3; return; } } } } if(ok) { cout << 2; } else { cout << 1; } } signed main() { ios; int t = 1; //cin >> t; while(t--) { zertinii(); } return 0; }
#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...