제출 #366050

#제출 시각아이디문제언어결과실행 시간메모리
366050sobaFootball (info1cup20_football)C++14
100 / 100
47 ms2156 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll t, n , k; vector<int>v; cin >> t; while(t--) { cin >> n >> k ; v.clear(); v.resize(n); ll sum=0; for(int i = 0 ; i < n ; i++) { cin >> v[i]; sum+=v[i]; } if(sum&1) { cout <<1; continue; } while(k!=1&&sum%2==0) { for(int i = 0 ; i < n ; i++) { sum-=v[i]; v[i]/=2; sum+=v[i]; } k/=2; } if(k>1) { cout<< 1; continue; } if(sum&1) { cout <<1; continue; } cout << 0; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...