Submission #1077951

#TimeUsernameProblemLanguageResultExecution timeMemory
1077951raduvFootball (info1cup20_football)C++17
100 / 100
27 ms2140 KiB
#include <bits/stdc++.h>

using namespace std;
void solve(){
  int n, k, i, xornim, x, rez;
  scanf("%d%d", &n, &k);
  xornim = 0;
  for ( i = 0; i < n; i++ ){
    scanf("%d", &x);
    xornim ^= x;
  }
  rez = 0;
  for( i = 0; (1 << i) <= k; i++ ){
    if(xornim & (1 << i))
      rez = 1;
  }
  printf("%d", rez);
}
int main()
{
    int t;
    scanf("%d", &t);
    while(t--){
      solve();
    }
    return 0;
}

Compilation message (stderr)

football.cpp: In function 'void solve()':
football.cpp:6:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |   scanf("%d%d", &n, &k);
      |   ~~~~~^~~~~~~~~~~~~~~~
football.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d", &x);
      |     ~~~~~^~~~~~~~~~
football.cpp: In function 'int main()':
football.cpp:22:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     scanf("%d", &t);
      |     ~~~~~^~~~~~~~~~
#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...