# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
736310 | keta_tsimakuridze | Football (info1cup20_football) | C++14 | 89 ms | 2604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |