結果

問題 No.1896 Arrays and XOR Procedure 2
ユーザー hir355hir355
提出日時 2022-04-09 01:30:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 1,278 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 78,280 KB
最終ジャッジ日時 2023-08-19 05:27:31
合計ジャッジ時間 9,578 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,280 KB
testcase_01 AC 72 ms
71,148 KB
testcase_02 AC 73 ms
71,068 KB
testcase_03 AC 103 ms
77,900 KB
testcase_04 AC 102 ms
78,280 KB
testcase_05 AC 107 ms
78,280 KB
testcase_06 AC 103 ms
77,996 KB
testcase_07 AC 107 ms
78,228 KB
testcase_08 AC 104 ms
78,260 KB
testcase_09 AC 102 ms
78,252 KB
testcase_10 AC 102 ms
78,168 KB
testcase_11 AC 106 ms
78,188 KB
testcase_12 AC 100 ms
78,188 KB
testcase_13 AC 100 ms
78,272 KB
testcase_14 AC 102 ms
78,124 KB
testcase_15 AC 99 ms
78,068 KB
testcase_16 AC 98 ms
77,896 KB
testcase_17 AC 98 ms
77,948 KB
testcase_18 AC 93 ms
76,892 KB
testcase_19 AC 90 ms
76,844 KB
testcase_20 AC 108 ms
77,784 KB
testcase_21 AC 90 ms
76,412 KB
testcase_22 AC 105 ms
77,992 KB
testcase_23 AC 107 ms
78,056 KB
testcase_24 AC 105 ms
78,048 KB
testcase_25 AC 101 ms
77,888 KB
testcase_26 AC 103 ms
77,992 KB
testcase_27 AC 103 ms
78,008 KB
testcase_28 AC 96 ms
77,948 KB
testcase_29 AC 98 ms
78,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = max(a)
mi = a.index(x)
bt = -1
while x > 0:
    x >>= 1
    bt += 1
ans = []
for i in range(n):
    if b[i] & (1 << bt):
        continue
    ans.append((2, mi + 1, i + 1))
    b[i] ^= a[mi]
for i in range(n):
    if a[i] & (1 << bt):
        ans.append((1, i + 1, 1))
        a[i] ^= b[0]
print(len(ans))
for row in ans:
    print(*row)
0