Submission #1318916

#TimeUsernameProblemLanguageResultExecution timeMemory
1318916dshfjkaFootball (info1cup20_football)C++20
100 / 100
20 ms552 KiB
#include <bits/stdc++.h> #define LL long long using namespace std; int main() { LL tc; scanf("%lld",&tc); while(tc--) { LL n,k; scanf("%lld %lld",&n,&k); LL arr[n+5]; for(LL a=1;a<=n;a++) { scanf("%lld",&arr[a]); } bool ans = 1; while(true){ LL tot = 0; for(LL a=1;a<=n;a++){ tot+=arr[a]; } if(tot%2==1){ ans = 1; break; } if(k==1){ ans = 0; break; } if(tot == 0){ ans = 0; break; } for(LL a=1;a<=n;a++){ arr[a]/=2; } k/=2; } if(ans){ printf("1"); } else{ printf("0"); } } }

Compilation message (stderr)

football.cpp: In function 'int main()':
football.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%lld",&tc);
      |     ~~~~~^~~~~~~~~~~~
football.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%lld %lld",&n,&k);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
football.cpp:15:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |             scanf("%lld",&arr[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...