제출 #845869

#제출 시각아이디문제언어결과실행 시간메모리
845869samekkkFootball (info1cup20_football)C++14
26 / 100
20 ms2128 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(a,b) for (int a = 0; a < (b); ++a) #define pb push_back #define all(t) t.begin(), t.end() const int max_N = 1e5+5; int t = 0, n = 0, k = 0; ll sum = 0; int A[max_N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; while(t--) { cin >> n >> k; rep(i,n) cin >> A[i]; sum = 0; rep(i,n) sum += A[i]; if (sum % 2 == 1) { cout << "1"; continue; } if (k == 1) { cout << "0"; continue; } sum = 0; rep(i,n) sum += A[i] % 2; if (sum % 2 == 0) cout << "1"; else 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...