Submission #1128402

#TimeUsernameProblemLanguageResultExecution timeMemory
1128402stdfloatPolitical Development (BOI17_politicaldevelopment)C++20
16 / 100
330 ms312532 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, k; cin >> n >> k; vector<int> E[n]; vector<vector<bool>> vis(n, vector<bool>(n)); for (int i = 0; i < n; i++) { int d; cin >> d; while (d--) { int y; cin >> y; vis[i][y] = true; E[i].push_back(y); } } int mx = 1; for (int i = 0; i < n; i++) { for (auto j : E[i]) { if (!vis[j][i]) continue; mx = max(mx, 2); for (auto k : E[i]) if (vis[k][i] && vis[k][j]) mx = max(mx, 3); } } cout << mx; }
#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...