제출 #1005670

#제출 시각아이디문제언어결과실행 시간메모리
1005670vicvicFootball (info1cup20_football)C++11
100 / 100
224 ms2900 KiB
#include <iostream> using namespace std; int t; void solve () { long long int n, k, v[100005]; cin >> n >> k; long long s=0; for (int i=1;i<=n;i++) { cin >> v[i]; s+=v[i]; } while (k!=1 && s%2!=1) { s=0; for (int i=1;i<=n;i++) { v[i]/=2; s+=v[i]; } k/=2; } if (k==1 && s%2==1) { cout << 1; return; } if (k>1 && s%2==1) { cout << 1; return; } if (k==1 && s%2==0) { cout << 0; return; } return; } int main() { ios :: sync_with_stdio (0); cin.tie (nullptr); cin >> t; while (t--) { solve (); } 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...