This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
bool sol(){
int n;
int k;
cin >> n;
cin >> k;
vector<int> a(n);
for(int i = 0; i < n; i++) cin >> a[i];
int acc = accumulate(a.begin(), a.end(), 0);
while(acc!=0){
if(acc&1) return 1;
for(int &i : a) i/=2;
acc = accumulate(a.begin(), a.end(), 0);
}
return 0;
}
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
cout.tie(0);
int t;
cin >> t;
for(int i = 0; i < t; i++){
cout << ((sol()) ? "1" : "0") ;//<< '\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... |