제출 #388683

#제출 시각아이디문제언어결과실행 시간메모리
388683AlmaFootball (info1cup20_football)C++14
0 / 100
32 ms360 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t, n, a, k, total;
    cin >> t;
    while (t--) {
        cin >> n >> k;
        total = 0;
        for (int i = 0; i < n; i++) {
            cin >> a;
            total += a;
        }
        if (n == 1) {
            if (total % 2 == 1) cout << 1;
            else if (k == 1) cout << total % 2;
            else if (total % 4 == 0) cout << 0;
            else cout << 1;
        } else {
            if (total % 2 != 0) cout << 1;
        }
    }
    cout << '\n';
    return 0;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…