結果

問題 No.2702 Nand Nor Matrix
ユーザー 鴨志田卓鴨志田卓
提出日時 2024-04-09 01:14:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 790 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 195,604 KB
実行使用メモリ 6,952 KB
最終ジャッジ日時 2024-04-09 01:15:44
合計ジャッジ時間 10,165 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 58 ms
6,948 KB
testcase_02 AC 55 ms
6,948 KB
testcase_03 AC 58 ms
6,948 KB
testcase_04 AC 62 ms
6,948 KB
testcase_05 AC 61 ms
6,944 KB
testcase_06 AC 58 ms
6,944 KB
testcase_07 AC 60 ms
6,944 KB
testcase_08 AC 59 ms
6,944 KB
testcase_09 AC 60 ms
6,944 KB
testcase_10 AC 60 ms
6,944 KB
testcase_11 AC 59 ms
6,944 KB
testcase_12 AC 59 ms
6,948 KB
testcase_13 AC 60 ms
6,948 KB
testcase_14 AC 60 ms
6,944 KB
testcase_15 AC 57 ms
6,944 KB
testcase_16 AC 76 ms
6,948 KB
testcase_17 AC 37 ms
6,948 KB
testcase_18 AC 60 ms
6,948 KB
testcase_19 AC 100 ms
6,948 KB
testcase_20 AC 36 ms
6,944 KB
testcase_21 AC 47 ms
6,944 KB
testcase_22 AC 34 ms
6,948 KB
testcase_23 AC 87 ms
6,944 KB
testcase_24 AC 75 ms
6,944 KB
testcase_25 AC 40 ms
6,944 KB
testcase_26 AC 51 ms
6,944 KB
testcase_27 AC 111 ms
6,948 KB
testcase_28 AC 83 ms
6,944 KB
testcase_29 AC 15 ms
6,944 KB
testcase_30 AC 103 ms
6,944 KB
testcase_31 AC 86 ms
6,944 KB
testcase_32 AC 9 ms
6,944 KB
testcase_33 AC 28 ms
6,944 KB
testcase_34 AC 81 ms
6,948 KB
testcase_35 AC 92 ms
6,944 KB
testcase_36 AC 122 ms
6,948 KB
testcase_37 AC 118 ms
6,944 KB
testcase_38 AC 117 ms
6,944 KB
testcase_39 AC 125 ms
6,944 KB
testcase_40 AC 118 ms
6,948 KB
testcase_41 AC 118 ms
6,944 KB
testcase_42 AC 117 ms
6,944 KB
testcase_43 AC 118 ms
6,948 KB
testcase_44 AC 118 ms
6,948 KB
testcase_45 AC 119 ms
6,944 KB
testcase_46 AC 119 ms
6,944 KB
testcase_47 AC 117 ms
6,948 KB
testcase_48 AC 121 ms
6,944 KB
testcase_49 AC 118 ms
6,944 KB
testcase_50 AC 116 ms
6,952 KB
testcase_51 AC 80 ms
6,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

const int N = 2e5 + 10;

int n, w, h, a[N], b[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i ++) {
        cin >> a[i];
    }

    for(int i = 2; i <= n; i ++) {
        cin >> b[i];
    }

    if(a[2] == b[2]) {
        for(w = 2; w < n && a[w] != a[w + 1]; w ++);
        for(h = 2; h < n && b[h] != b[h + 1]; h ++);
    }

    int q;
    cin >> q;
    for(int i = 1; i <= q; i ++) {
        long long t;
        int x, y;
        cin >> t >> x >> y;
        if(x == 1) cout << a[y] << "\n";
        else if(y == 1) cout << b[x] << "\n";
        else if(x <= h && y <= w && t >= x + y - 3) cout << ((a[2] ^ (x + y - 3)) & 1) << "\n";
        else cout << (t & 1) << "\n";
    }
}
0