結果

問題 No.1896 Arrays and XOR Procedure 2
ユーザー ああいいああいい
提出日時 2022-04-08 22:27:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-05-06 07:59:37
合計ジャッジ時間 6,210 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 WA -
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 66 ms
71,808 KB
testcase_04 AC 85 ms
77,184 KB
testcase_05 AC 84 ms
77,184 KB
testcase_06 AC 71 ms
72,704 KB
testcase_07 AC 83 ms
77,184 KB
testcase_08 AC 86 ms
77,184 KB
testcase_09 AC 84 ms
77,312 KB
testcase_10 AC 84 ms
77,440 KB
testcase_11 AC 84 ms
77,312 KB
testcase_12 AC 83 ms
77,184 KB
testcase_13 AC 80 ms
76,800 KB
testcase_14 AC 80 ms
76,800 KB
testcase_15 AC 78 ms
76,672 KB
testcase_16 AC 80 ms
76,672 KB
testcase_17 AC 76 ms
76,544 KB
testcase_18 AC 66 ms
69,760 KB
testcase_19 AC 56 ms
64,384 KB
testcase_20 AC 84 ms
77,056 KB
testcase_21 AC 56 ms
64,384 KB
testcase_22 AC 87 ms
76,800 KB
testcase_23 AC 86 ms
77,020 KB
testcase_24 AC 88 ms
77,312 KB
testcase_25 AC 85 ms
76,800 KB
testcase_26 AC 86 ms
76,872 KB
testcase_27 AC 87 ms
76,928 KB
testcase_28 AC 68 ms
71,936 KB
testcase_29 AC 70 ms
72,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

S = 0
for a in A:
    S |= a
mask = 1 << (len(bin(S)) - 3)
index = -1
for i in range(N):
    if A[i] & mask:
        index = i
        break
ans = []
for j in range(N):
    if mask & B[j] == 0:
        ans.append((2,index + 1,j + 1))
        B[j] ^= A[index]
for j in range(N):
    if mask & A[j]:
        ans.append((1,j + 1,N))
print(len(ans))
for t,p,q in ans:
    print(t,p,q)
0