# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1075033 | 2024-08-25T17:46:20 Z | raduv | Norela (info1cup18_norela) | C++17 | 14 ms | 432 KB |
#include <bits/stdc++.h> const int MAXM = 26; using namespace std; long long v[MAXM]; int main() { int n, m, q, bit, i, no, mn, mask, cmask; long long rez; scanf("%d%d", &n, &m); for( i = 0; i < m; i++ ){ scanf("%d", &q); while(q--){ scanf("%d", &bit); bit--; v[i] |= (1LL << bit); } } mn = m + 1; for( mask = 0; mask < (1 << m); mask++ ){ rez = no = 0; for( i = 0; i < m; i++ ){ if(mask & (1 << i)){ rez ^= v[i]; no++; } } if(rez == (1LL << n) - 1 && no < mn){ mn = no; cmask = mask; } } printf("%d\n", mn); for( i = 0; i < m; i++ ){ if(cmask & (1 << i)) printf("%d ", i + 1); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 348 KB | Output is correct |
2 | Correct | 14 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 12 ms | 348 KB | Output is correct |
5 | Correct | 14 ms | 348 KB | Output is correct |
6 | Incorrect | 13 ms | 344 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 348 KB | Output is correct |
2 | Correct | 14 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 12 ms | 348 KB | Output is correct |
5 | Correct | 14 ms | 348 KB | Output is correct |
6 | Incorrect | 13 ms | 344 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 348 KB | Output is correct |
2 | Correct | 14 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 12 ms | 348 KB | Output is correct |
5 | Correct | 14 ms | 348 KB | Output is correct |
6 | Incorrect | 13 ms | 344 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 348 KB | Output is correct |
2 | Correct | 14 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 12 ms | 348 KB | Output is correct |
5 | Correct | 14 ms | 348 KB | Output is correct |
6 | Incorrect | 13 ms | 344 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |