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;
#define st first
#define nd second
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll q;
cin>>q;
string wynik="";
while(q--)
{
ll n,k;
cin>>n>>k;
vector<ll>a(n);
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
ll x=1;
bool p=false;
for(ll i=0;i<40 && x<=k;i++)
{
ll w=0;
for(ll j=0;j<n;j++)
{
w+=a[j]/x;
}
if(w%2==1)
{
p=true;
break;
}
x*=2;
}
if(p)
{
wynik+='1';
}
else
{
wynik+='0';
}
}
cout<<wynik<<endl;
}
# | 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... |