제출 #447586

#제출 시각아이디문제언어결과실행 시간메모리
447586LucaIlieFootball (info1cup20_football)C11
100 / 100
37 ms1988 KiB
#include <stdio.h>

int main() {
    int t, n, k, a, xor, max, p2, i;

    scanf( "%d", &t );
    while ( t-- ) {
        scanf( "%d%d", &n, &k );
        xor = 0;
        max = 0;
        for ( i = 0; i < n; i++ ) {
            scanf( "%d", &a );
            xor ^= a;
            max = a > max ? a : max;
        }
        p2 = 2;
        while ( p2 <= k && (xor & (p2 - 1)) == 0 )
            p2 *= 2;
        if ( (xor & (p2 - 1)) > 0 && p2 / 2 <= max )
            printf( "1" );
        else
            printf( "0" );
    }

    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

football.c: In function 'main':
football.c:6:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf( "%d", &t );
      |     ^~~~~~~~~~~~~~~~~
football.c:8:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |         scanf( "%d%d", &n, &k );
      |         ^~~~~~~~~~~~~~~~~~~~~~~
football.c:12:13: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |             scanf( "%d", &a );
      |             ^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...