Submission #276938

#TimeUsernameProblemLanguageResultExecution timeMemory
276938thebesFootball (info1cup20_football)C++14
100 / 100
65 ms2168 KiB
#include <bits/stdc++.h>
using namespace std;

const int MN = 1e5+5;
int N, T, K, i, j, arr[MN], fl;
long long sm;

int main(){
    scanf("%d",&T);
    while(T--){
        scanf("%d%d",&N,&K);
        for(i=1;i<=N;i++){
            scanf("%d",&arr[i]);
        }
        fl = 0;
        for(j=0;(1<<j)<=K;j++){
            sm = 0;
            for(i=1;i<=N;i++){
                sm += (arr[i]/(1<<j));
            }
            if(sm&1){
                fl = 1;
                break;
            }
        }
        printf("%s",fl?"1":"0");
    }
    printf("\n");
    return 0;
}

Compilation message (stderr)

football.cpp: In function 'int main()':
football.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |     scanf("%d",&T);
      |     ~~~~~^~~~~~~~~
football.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |         scanf("%d%d",&N,&K);
      |         ~~~~~^~~~~~~~~~~~~~
football.cpp:13:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   13 |             scanf("%d",&arr[i]);
      |             ~~~~~^~~~~~~~~~~~~~
#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...