Submission #736310

#TimeUsernameProblemLanguageResultExecution timeMemory
736310keta_tsimakuridzeFootball (info1cup20_football)C++14
100 / 100
89 ms2604 KiB
#include<bits/stdc++.h> #define f first #define s second #define int long long #define pii pair<int,int> using namespace std; const int N = 2e5 + 5, mod = 1e9 + 7; // ! int t, a[N]; map<int,int> f; string ans = ""; main(){ cin >> t; while(t--){ int n, k; cin >> n >> k; int c = 0; f.clear(); for(int i = 1; i <= n; i++) { cin >> a[i]; c += a[i] / k; ++f[a[i] % k]; } while(true) { int c = 0; for(int i = 1; i <= n; i++) c += a[i] % 2; if(k == 1 || c % 2) { ans += (char)(c % 2 + '0'); break; } else { k /= 2; for(int i = 1; i <= n; i++) a[i] /= 2; } } } cout << ans; }

Compilation message (stderr)

football.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
#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...