結果
| 問題 |
No.1896 Arrays and XOR Procedure 2
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2022-04-09 04:44:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 2,000 ms |
| コード長 | 595 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 82,108 KB |
| 実行使用メモリ | 78,000 KB |
| 最終ジャッジ日時 | 2024-11-28 23:36:27 |
| 合計ジャッジ時間 | 6,482 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
import sys,math
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
check=max(max(A),max(B))
p=pow(2,29-format(check,'030b').index('1'))
for i in range(N):
A[i]=int(A[i]>=p)
B[i]=int(B[i]>=p)
ans=[]
if max(A)==0:
ind=B.index(1)
ans.append([0,0,ind])
for i in range(N):
if B[i]==0:
ans.append([1,0,i])
ans.append([0,0,0])
else:
ind=A.index(1)
for i in range(N):
if B[i]==0:
ans.append([1,ind,i])
for i in range(N):
if A[i]:
ans.append([0,i,0])
print(len(ans))
for i in ans:
print(*[j+1 for j in i])
ytft