이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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";
}
# | 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... |