Submission #689886

# Submission time Handle Problem Language Result Execution time Memory
689886 2023-01-29T16:48:20 Z divad Norela (info1cup18_norela) C++14
0 / 100
1 ms 320 KB
#include <bits/stdc++.h>
#define NMAX 62
#define MMAX 26
using namespace std;
int n,m,q,x,ans;
bitset<NMAX> b[MMAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    for(int i = 1; i <= m; i++){
        cin >> q;
        for(int j = 1; j <= q; j++){
            cin >> x;
            b[i][x] = 1;
        }
    }
    for(int i = 0; i < (1<<m); i++){
        bitset<NMAX> all;
        for(int j = 0; j < m; j++){
            if(i&(1<<j)){
                all ^= b[j+1];
            }
        }
        if(all.count() == n){
            ans = i;
            break;
        }
    }
    cout << __builtin_popcount(ans) << "\n";
    for(int j = 0; j < m; j++){
        if(ans&(1<<j)){
            cout << j+1 << " ";
        }
    }
    return 0;
}

Compilation message

norela.cpp: In function 'int main()':
norela.cpp:27:24: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |         if(all.count() == n){
      |            ~~~~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -