#include <bits/stdc++.h>
#ifdef local
#define debug(a...) qqbx(#a, a)
template <typename ...T> void qqbx(const char *s, T ...a) {
int cnt = sizeof...(T);
((std::cerr << "\033[1;32m(" << s << ") = (") , ... , (std::cerr << a << (--cnt ? ", " : ")\033[0m\n")));
}
#define pary(a...) danb(#a, a)
template <typename T> void danb(const char *s, T L, T R) {
std::cerr << "\033[1;32m[ " << s << " ] = [ ";
for (int f = 0; L != R; ++L) std::cerr << (f++ ? " " : "") << *L;
std::cerr << " ]\033[0m\n";
}
#else
#define debug(...) ((void)0)
#define pary(...) ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define pb emplace_back
using namespace std;
const int inf = 1e9, MOD = 1000000007, maxn = 2525, LG = 20;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int T;
cin >> T;
while (T--) {
int n, k;
cin >> n >> k;
int x, xs = 0;
for (int i = 0; i < n; i++) cin >> x, xs ^= x;
if (xs == 0) {
cout << 0;
} else {
xs = xs & -xs;
cout << (k >= xs);
}
}
cout << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
312 KB |
Output is correct |
2 |
Correct |
12 ms |
204 KB |
Output is correct |
3 |
Correct |
13 ms |
316 KB |
Output is correct |
4 |
Correct |
12 ms |
320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
332 KB |
Output is correct |
2 |
Correct |
8 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
396 KB |
Output is correct |
2 |
Correct |
23 ms |
332 KB |
Output is correct |
3 |
Correct |
23 ms |
368 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
36 ms |
372 KB |
Output is correct |
2 |
Correct |
38 ms |
380 KB |
Output is correct |
3 |
Correct |
33 ms |
352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
316 KB |
Output is correct |
2 |
Correct |
12 ms |
312 KB |
Output is correct |
3 |
Correct |
12 ms |
316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
312 KB |
Output is correct |
2 |
Correct |
12 ms |
312 KB |
Output is correct |
3 |
Correct |
12 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
316 KB |
Output is correct |
2 |
Correct |
12 ms |
312 KB |
Output is correct |