This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K; cin >> N >> K;
vector<bitset<3>> graph(N);
for (int i = 0; i < N; ++i) {
int D; cin >> D;
for (int j = 0; j < D; ++j) {
int x; cin >> x;
graph[i][x] = true;
}
}
int ans = 1;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
if (i == j || !graph[i][j]) continue;
ans = max(ans, 2);
bitset<3> x = graph[i];
x &= graph[j];
if (x.any()) {
ans = 3;
}
}
}
cout << ans << endl;
return 0;
}
# | 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... |