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 int long long
using namespace std;
int32_t main()
{
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
vector<int>v(n);
int cnt1=0, cnt2=0, cnt4=0;
for(int i=0;i<n;i++){
cin>>v[i];
cnt1+=v[i]/1;
cnt2+=v[i]/2;
cnt4+=v[i]/4;
}
int f=0;
if((cnt1)%2)f=1;
else if(k>=2&&(cnt2)%2)f=1;
else if(k>=4&&(cnt4)%2)f=1;
else if(n==1&&v[0]<=k) f=1;
if(f) cout<<1;
else cout<<0;
}
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... |