結果

問題 No.1896 Arrays and XOR Procedure 2
ユーザー ytftytft
提出日時 2022-04-09 04:44:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 613 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 78,864 KB
最終ジャッジ日時 2023-08-19 08:41:30
合計ジャッジ時間 9,189 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,268 KB
testcase_01 AC 71 ms
71,384 KB
testcase_02 AC 71 ms
71,324 KB
testcase_03 AC 109 ms
78,636 KB
testcase_04 AC 108 ms
78,720 KB
testcase_05 AC 108 ms
78,772 KB
testcase_06 AC 108 ms
78,224 KB
testcase_07 AC 108 ms
78,360 KB
testcase_08 AC 110 ms
78,648 KB
testcase_09 AC 109 ms
78,472 KB
testcase_10 AC 109 ms
78,264 KB
testcase_11 AC 110 ms
78,584 KB
testcase_12 AC 112 ms
78,468 KB
testcase_13 AC 111 ms
78,864 KB
testcase_14 AC 108 ms
78,544 KB
testcase_15 AC 109 ms
78,464 KB
testcase_16 AC 108 ms
78,424 KB
testcase_17 AC 108 ms
78,616 KB
testcase_18 AC 107 ms
78,324 KB
testcase_19 AC 92 ms
76,584 KB
testcase_20 AC 115 ms
78,016 KB
testcase_21 AC 91 ms
76,856 KB
testcase_22 AC 112 ms
78,368 KB
testcase_23 AC 110 ms
78,044 KB
testcase_24 AC 113 ms
78,320 KB
testcase_25 AC 110 ms
78,380 KB
testcase_26 AC 113 ms
77,996 KB
testcase_27 AC 112 ms
78,424 KB
testcase_28 AC 104 ms
78,532 KB
testcase_29 AC 105 ms
78,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0