# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1074945 | raduv | Norela (info1cup18_norela) | C++17 | 15 ms | 436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
const int MAXM = 24;
const int MAXN = 60;
using namespace std;
long long v[MAXM];
signed 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] |= (1 << bit);
}
}
mn = m + 1;
cmask = 0;
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(__builtin_popcount(rez) == n && 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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |