結果
問題 |
No.1896 Arrays and XOR Procedure 2
|
ユーザー |
|
提出日時 | 2022-04-08 22:27:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 82,352 KB |
実行使用メモリ | 77,692 KB |
最終ジャッジ日時 | 2024-11-28 13:09:44 |
合計ジャッジ時間 | 5,985 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 27 |
ソースコード
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)