# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
845021 | M_W_13 | Football (info1cup20_football) | C++17 | 34 ms | 3420 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 <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int n, k;
cin >> n >> k;
int log = 0;
while (1 << log < k) {
log++;
}
if (1 << log > k) {
log--;
}
int klasy[n];
int potegi[n][log + 1];
for (int x = 0; x < n; x++) {
cin >> klasy[x];
for (int l = 0; l < log + 1; l++) {
if (klasy[x] % (1 << l) == 0) {
potegi[x][l] = klasy[x]/(1 << l);
}
else {
potegi[x][l] = 0;
}
}
}
int suma;
for (int l = 0; l < log + 1; l++) {
suma = 0;
for (int x = 0; x < n; x++) {
suma += potegi[x][l];
}
if (suma % 2 == 1) {
cout << "1";
break;
}
}
if (suma % 2 == 0) {
cout << "0";
}
}
return 0;
}
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... |