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>
#define endl '\n'
using namespace std;
const int MAXN = 100000;
int a[MAXN + 5];
int main()
{
ios :: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int T;
cin >> T;
while (T--)
{
int N, K;
cin >> N >> K;
long long S = 0;
for (int i = 1; i <= N; ++ i)
{
cin >> a[i];
S += a[i];
}
while (S % 2 == 0 and K != 1)
{
K /= 2;
S = 0;
for (int i = 1; i <= N; ++ i)
{
a[i] /= 2;
S += a[i];
}
}
if (S % 2 == 1) cout << 1;
else cout << 0;
}
cout << endl;
return 0;
}
# | 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... |