# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1062087 |
2024-08-16T18:39:30 Z |
pera |
Norela (info1cup18_norela) |
C++17 |
|
9 ms |
8424 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n , m;
cin >> n >> m;
long long M = (1LL << n) - 1;
vector<long long> v(m);
for(int i = 0;i < m;i ++){
int x;
cin >> x;
while(x--){
int y;
cin >> y;
--y;
v[i] |= (1LL << y);
}
}
vector<pair<long long , int>> u;
u.emplace_back(make_pair(0LL , 0));
for(int i = 0;i < m;i ++){
vector<pair<long long , int>> e;
for(auto [x , mask] : u){
e.emplace_back(make_pair(x ^ v[i] , mask | (1 << i)));
}
for(auto [x , mask] : e){
u.emplace_back(make_pair(x , mask));
}
}
long long best = M;
int best_mask = 0;
for(auto [x , mask] : u){
long long e = (~x & M);
long long o = best ^ e;
int bit = __lg(o & -o);
if(!(e >> bit & 1)){
best = e;
best_mask = mask;
}
}
cout << __builtin_popcount(best_mask) << endl;
for(int i = 0;i < m;i ++){
if(best_mask >> i & 1){
cout << i + 1 << " ";
}
}
cout << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
8424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
8424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
8424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
8424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |