| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 467526 | LucaIlie | Norela (info1cup18_norela) | C11 | 17 ms | 268 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define MAX_M 24
long long spell[MAX_M];
int main() {
    int n, m, k, p, minUsedSpells, usedSpells, solMask, mask, i, j;
    long long xor;
    scanf( "%d%d", &n, &m );
    for ( i = 0; i < m; i++ ) {
        scanf( "%d", &k );
        spell[i] = 0;
        for ( j = 0; j < k; j++ ) {
            scanf( "%d", &p );
            spell[i] += (1 << (p - 1));
        }
    }
    minUsedSpells = n + 1;
    solMask = -1;
    for ( mask = 0; mask < (1 << m); mask++ ) {
        xor = 0;
        usedSpells = 0;
        for ( i = 0; i < m; i++ ) {
            if ( ((mask >> i) & 1) == 1 ) {
                xor = xor ^ spell[i];
                usedSpells++;
            }
        }
        if ( xor == (1 << n) - 1 ) {
            if ( usedSpells < minUsedSpells ) {
                minUsedSpells = usedSpells;
                solMask = mask;
            }
        }
    }
    printf( "%d\n", minUsedSpells );
    for ( i = 0; i < m; i++ ) {
        if ( ((solMask >> i) & 1) == 1 )
            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... | ||||
