Submission #332236

#TimeUsernameProblemLanguageResultExecution timeMemory
332236evpipisFootball (info1cup20_football)C++11
100 / 100
57 ms2068 KiB
#include <bits/stdc++.h> using namespace std; const int len = 1e5+5; int arr[len]; int main(){ int t; scanf("%d", &t); while (t--){ int n, k; scanf("%d %d", &n, &k); for (int i = 0; i < n; i++) scanf("%d", &arr[i]); int ans = 0; for (int po = 1; po <= k; po*=2){ int sum = 0; for (int i = 0; i < n; i++) sum ^= (arr[i]/po)%2; if (sum) ans = 1; } printf("%d", ans); } 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:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |         scanf("%d %d", &n, &k);
      |         ~~~~~^~~~~~~~~~~~~~~~~
football.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   14 |             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...