This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef int in;
#define f first
#define s second
#define pb push_back
#define pp push
#define ceil(x) NEVER USE CEIL
#define sqrt(x) (int)(sqrt(x))
int arr[1000010];
in main()
{
ios_base::sync_with_stdio(0);
int tc=1;
cin>>tc;
while(tc--)
{
int n,k,sum;
cin>>n>>k;
for(int i=0;i<n;i++)
cin>>arr[i];
int ans=0;
for(int i=0;(1<<i)<=k;i++){
sum=0;
for(int j=0;j<n;j++)
sum+=arr[j];
if(sum%2){
ans=1;
break;
}
for(int j=0;j<n;j++)
arr[j]/=2;
}
cout<<ans;
}
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... |