167452025-05-12 08:16:34BencuLámpákcpp17Wrong answer 0/100120ms1940 KiB
#include <bits/stdc++.h>

using namespace std;
long long k,n,q;
struct Bencu {
    int jel;
}L[100001];
long long kar[100001];
int main()
{
    ifstream f("be.in");
    cin>>n>>k>>q;
    for (int i=2; i<=n; i++) cin>>kar[i];
    for (int z=1; z<=q; z++) {
        long long b[100001],s=0;
        for (int i=1; i<=n; i++) {
            cin>>b[i];
            if (b[i]==1 && i>2) s++;
        }
        //cout<<s<<" - ";
        if (s%2==0) {
            if (b[2]==1) {
                cout<<(k+b[1])%2<<endl;
            }
            else {
                cout<<b[1]<<endl;
            }
        }
        else {
            if (b[2]==0) {
                cout<<(b[1]+k/2)%2<<endl;
            }
            else {
                int m;
                if (k%2==0) m=k/2;
                else m=k/2+1;
                cout<<(b[1]+m)%2<<endl;
            }
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer1ms500 KiB
subtask20/15
3Wrong answer3ms500 KiB
4Wrong answer37ms564 KiB
5Accepted104ms1840 KiB
subtask30/10
6Wrong answer1ms316 KiB
7Wrong answer1ms508 KiB
8Wrong answer1ms508 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms392 KiB
subtask40/30
11Accepted41ms428 KiB
12Wrong answer41ms428 KiB
13Wrong answer41ms420 KiB
14Wrong answer41ms316 KiB
15Wrong answer41ms500 KiB
16Wrong answer39ms316 KiB
17Wrong answer41ms424 KiB
subtask50/45
18Wrong answer93ms564 KiB
19Wrong answer94ms772 KiB
20Wrong answer94ms564 KiB
21Wrong answer94ms576 KiB
22Wrong answer94ms1012 KiB
23Wrong answer118ms1852 KiB
24Wrong answer120ms1724 KiB
25Wrong answer119ms1844 KiB
26Wrong answer119ms1940 KiB
27Wrong answer119ms1900 KiB
28Wrong answer87ms392 KiB
29Wrong answer86ms508 KiB