# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
332535 | 2020-12-02T19:52:25 Z | dolphingarlic | April Fools (LMIO17_faktai) | C++14 | 354 ms | 492 KB |
#include <bits/stdc++.h> using namespace std; bitset<200> bs[20]; int main() { int n, m; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { int k; scanf("%d", &k); for (int j = 0; j < k; j++) { int f; scanf("%d", &f); bs[f - 1][i] = 1; } } int lb = n, ub = 0; for (int mask = 0; mask < (1 << m); mask++) { bitset<200> cov; bool good = true; for (int i = 0; i < m; i++) if (mask & (1 << i)) { if ((cov & bs[i]).count()) { good = false; break; } cov |= bs[i]; } if (good && cov.count() == n) { lb = min(lb, __builtin_popcount(mask)); ub = max(ub, __builtin_popcount(mask)); } } printf("%d %d", lb, ub); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 1 ms | 364 KB | Output is correct |
7 | Correct | 1 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 67 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 96 ms | 364 KB | Output is correct |
5 | Correct | 75 ms | 364 KB | Output is correct |
6 | Correct | 1 ms | 364 KB | Output is correct |
7 | Correct | 1 ms | 364 KB | Output is correct |
8 | Correct | 1 ms | 364 KB | Output is correct |
9 | Correct | 1 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 354 ms | 492 KB | Output is correct |
2 | Correct | 127 ms | 492 KB | Output is correct |
3 | Correct | 97 ms | 492 KB | Output is correct |
4 | Correct | 85 ms | 364 KB | Output is correct |
5 | Correct | 97 ms | 364 KB | Output is correct |
6 | Correct | 111 ms | 492 KB | Output is correct |
7 | Correct | 94 ms | 492 KB | Output is correct |
8 | Correct | 1 ms | 364 KB | Output is correct |
9 | Correct | 67 ms | 364 KB | Output is correct |
10 | Correct | 1 ms | 364 KB | Output is correct |
11 | Correct | 96 ms | 364 KB | Output is correct |
12 | Correct | 75 ms | 364 KB | Output is correct |
13 | Correct | 1 ms | 364 KB | Output is correct |
14 | Correct | 1 ms | 364 KB | Output is correct |
15 | Correct | 1 ms | 364 KB | Output is correct |
16 | Correct | 1 ms | 364 KB | Output is correct |
17 | Correct | 1 ms | 364 KB | Output is correct |
18 | Correct | 1 ms | 364 KB | Output is correct |
19 | Correct | 1 ms | 364 KB | Output is correct |