제출 #525419

#제출 시각아이디문제언어결과실행 시간메모리
525419dron_rpFootball (info1cup20_football)C++14
50 / 100
189 ms556 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int t; cin >> t; while (t--){ int n, k, x; cin >> n >> k; if (k == 1){ ll sum = 0; for (int i = 0; i<n; i++){ cin >> x; sum += x; } cout << (sum%2 == 0 ? "0" : "1"); } else if (n == 1){ cin >> n; if (n%2 == 1){ cout << "1"; } else{ while (n%2 == 0 && k != 1){ n/=2; k/=2; } if (k == 1){ cout << (n%2 == 0 ? "0" : "1"); } else if (n%2 == 1){ cout << "1"; } else{ cout << "0"; } } } else{ cout << "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...