#include <bits/stdc++.h>
using namespace std;
#define file \
freopen("in.txt" , "r" , stdin); \
freopen("out.txt" , "w" , stdout);
typedef long long ll;
void test_case () {
int n , k;
cin >> n >> k;
ll sum = 0;
int a[n];
for (int i = 0;i < n;i ++) {
cin >> a[i];
}
for (int x = 1;x <= k;x *= 2) {
sum = 0;
for (int i = 0;i < n;i ++) {
sum += (a[i] / x);
}
if (sum %2 != 0) {
cout << "1";
return;
}
}
cout << "0";
}
int32_t main () {
// file
int TIME = clock();
int t = 1;
cin >> t;
while (t --) {
test_case();
}
cerr << "\nTime elapsed: " << (clock() - TIME) * 1000.0 / CLOCKS_PER_SEC << " ms\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
348 KB |
Output is correct |
2 |
Correct |
31 ms |
1392 KB |
Output is correct |
3 |
Correct |
31 ms |
1372 KB |
Output is correct |
4 |
Correct |
33 ms |
1256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
348 KB |
Output is correct |
2 |
Correct |
24 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
134 ms |
444 KB |
Output is correct |
2 |
Correct |
145 ms |
1060 KB |
Output is correct |
3 |
Correct |
132 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
170 ms |
456 KB |
Output is correct |
2 |
Correct |
211 ms |
2268 KB |
Output is correct |
3 |
Correct |
170 ms |
2132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
348 KB |
Output is correct |
2 |
Correct |
31 ms |
1364 KB |
Output is correct |
3 |
Correct |
31 ms |
1372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
37 ms |
348 KB |
Output is correct |
2 |
Correct |
35 ms |
1384 KB |
Output is correct |
3 |
Correct |
41 ms |
1260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
348 KB |
Output is correct |
2 |
Correct |
39 ms |
1368 KB |
Output is correct |