結果
| 問題 | No.1896 Arrays and XOR Procedure 2 |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2022-04-09 01:30:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 78,080 KB |
| 最終ジャッジ日時 | 2026-05-22 17:55:09 |
| 合計ジャッジ時間 | 5,870 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
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)
hir355