#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<20 && 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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
600 KB |
Output is correct |
2 |
Correct |
12 ms |
600 KB |
Output is correct |
3 |
Correct |
13 ms |
856 KB |
Output is correct |
4 |
Correct |
10 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
516 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
348 KB |
Output is correct |
2 |
Correct |
6 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
600 KB |
Output is correct |
2 |
Correct |
14 ms |
1112 KB |
Output is correct |
3 |
Correct |
21 ms |
1112 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
26 ms |
592 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
600 KB |
Output is correct |
2 |
Correct |
10 ms |
1508 KB |
Output is correct |
3 |
Correct |
14 ms |
1372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
624 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |