#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
364 KB |
Output is correct |
2 |
Correct |
17 ms |
1388 KB |
Output is correct |
3 |
Correct |
17 ms |
1388 KB |
Output is correct |
4 |
Correct |
17 ms |
1388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
364 KB |
Output is correct |
2 |
Correct |
32 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
228 ms |
488 KB |
Output is correct |
2 |
Correct |
217 ms |
748 KB |
Output is correct |
3 |
Correct |
220 ms |
616 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
251 ms |
492 KB |
Output is correct |
2 |
Correct |
259 ms |
492 KB |
Output is correct |
3 |
Correct |
241 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
364 KB |
Output is correct |
2 |
Correct |
21 ms |
1388 KB |
Output is correct |
3 |
Correct |
17 ms |
1388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
364 KB |
Output is correct |
2 |
Correct |
18 ms |
1532 KB |
Output is correct |
3 |
Correct |
18 ms |
1388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
364 KB |
Output is correct |
2 |
Correct |
18 ms |
1388 KB |
Output is correct |