結果

問題 No.2702 Nand Nor Matrix
ユーザー 👑 rin204rin204
提出日時 2024-03-30 00:20:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 705 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 103,848 KB
最終ジャッジ日時 2024-03-30 00:21:17
合計ジャッジ時間 32,481 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 571 ms
76,384 KB
testcase_02 AC 522 ms
76,144 KB
testcase_03 AC 549 ms
76,128 KB
testcase_04 AC 547 ms
76,504 KB
testcase_05 AC 549 ms
76,380 KB
testcase_06 AC 571 ms
76,384 KB
testcase_07 AC 543 ms
76,380 KB
testcase_08 AC 544 ms
76,256 KB
testcase_09 AC 549 ms
76,768 KB
testcase_10 AC 543 ms
76,512 KB
testcase_11 AC 558 ms
76,128 KB
testcase_12 AC 537 ms
76,512 KB
testcase_13 AC 563 ms
76,256 KB
testcase_14 AC 539 ms
76,252 KB
testcase_15 AC 549 ms
76,256 KB
testcase_16 AC 479 ms
90,264 KB
testcase_17 AC 251 ms
100,860 KB
testcase_18 AC 428 ms
86,676 KB
testcase_19 AC 602 ms
85,236 KB
testcase_20 AC 279 ms
97,332 KB
testcase_21 AC 336 ms
83,976 KB
testcase_22 AC 285 ms
83,668 KB
testcase_23 AC 547 ms
78,556 KB
testcase_24 AC 492 ms
103,812 KB
testcase_25 AC 310 ms
83,680 KB
testcase_26 AC 359 ms
88,356 KB
testcase_27 AC 596 ms
94,748 KB
testcase_28 AC 519 ms
85,248 KB
testcase_29 AC 185 ms
85,288 KB
testcase_30 AC 631 ms
103,728 KB
testcase_31 AC 567 ms
77,056 KB
testcase_32 AC 160 ms
81,976 KB
testcase_33 AC 232 ms
94,816 KB
testcase_34 AC 513 ms
86,688 KB
testcase_35 AC 587 ms
90,228 KB
testcase_36 AC 654 ms
103,848 KB
testcase_37 AC 675 ms
103,848 KB
testcase_38 AC 668 ms
103,848 KB
testcase_39 AC 658 ms
103,848 KB
testcase_40 AC 694 ms
103,848 KB
testcase_41 AC 677 ms
103,848 KB
testcase_42 AC 676 ms
103,848 KB
testcase_43 AC 700 ms
103,848 KB
testcase_44 AC 672 ms
103,848 KB
testcase_45 AC 700 ms
103,848 KB
testcase_46 AC 702 ms
103,848 KB
testcase_47 AC 676 ms
103,848 KB
testcase_48 AC 705 ms
103,848 KB
testcase_49 AC 668 ms
103,848 KB
testcase_50 AC 670 ms
103,848 KB
testcase_51 AC 502 ms
75,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = [A[0]] + [int(input()) for _ in range(n - 1)]

jj = n + 1
for j in range(2, n):
    if A[j] == A[j - 1]:
        jj = j
        break

ii = n + 1
for i in range(2, n):
    if B[i] == B[i - 1]:
        ii = i
        break

Q = int(input())
for _ in range(Q):
    t, r, c = map(int, input().split())
    if r == 1:
        print(A[c - 1])
    elif c == 1:
        print(B[r - 1])
    elif r + c - 3 > t or A[1] != B[1] or r > ii or c > jj:
        if t % 2 == 0:
            print(0)
        else:
            print(1)
    else:
        print((r + c + A[1] + 1) % 2)
0