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>
using namespace std;
typedef long long int ll;
constexpr int N = 1e5;
ll a[N+9];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t,n,k;
cin >> t;
while(t--){
cin >> n >> k;
for (int x=1;x<=n;x++) cin>>a[x];
bool win=0;
while(k>=1){
ll suma = 0;
for (int x=1;x<=n;x++) suma+=a[x];
if (suma%2==1) win=1;
k/=2;
for (int x=1;x<=n;x++) a[x]=a[x]/2;
}
cout << win;
}
cout << '\n';
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... |