161702025-04-09 07:04:56BencuLámpákcpp17Wrong answer 0/100123ms2724 KiB
#include <bits/stdc++.h>

using namespace std;
long long k,n,q;

int main()
{
    ifstream f("be.in");
    cin>>n>>k>>q;
    int a[100001]={0};
    for (int i=2; i<=n; i++) cin>>a[i];
    for (int z=1; z<=q; z++) {
        int b[100001],s=0;
        for (int i=1; i<=n; i++) {
            cin>>b[i];
            if (b[i]==1) s++;
        }
        if (s%2==0) {
            if (b[2]==1) cout<<(b[1]+k)%2<<endl;
            else cout<<b[1]<<endl;
        }
        else {
            if (b[2]==1) cout<<(b[1]+s/2+1)%2<<endl;
                else cout<<(b[1]+s/2)%2<<endl;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms564 KiB
2Wrong answer1ms568 KiB
subtask20/15
3Wrong answer3ms676 KiB
4Wrong answer37ms1216 KiB
5Wrong answer108ms2100 KiB
subtask30/10
6Wrong answer2ms564 KiB
7Wrong answer2ms748 KiB
8Wrong answer2ms756 KiB
9Wrong answer2ms564 KiB
10Wrong answer2ms564 KiB
subtask40/30
11Wrong answer43ms916 KiB
12Wrong answer43ms1104 KiB
13Wrong answer43ms1048 KiB
14Wrong answer43ms1108 KiB
15Wrong answer43ms1076 KiB
16Wrong answer43ms1076 KiB
17Wrong answer43ms1108 KiB
subtask50/45
18Wrong answer97ms1852 KiB
19Wrong answer97ms1844 KiB
20Wrong answer98ms2040 KiB
21Wrong answer97ms1956 KiB
22Wrong answer98ms1844 KiB
23Wrong answer120ms2616 KiB
24Wrong answer123ms2708 KiB
25Wrong answer123ms2616 KiB
26Wrong answer122ms2724 KiB
27Accepted122ms2712 KiB
28Wrong answer90ms1592 KiB
29Wrong answer90ms1696 KiB