結果

問題 No.1896 Arrays and XOR Procedure 2
ユーザー HydruHydru
提出日時 2022-04-09 00:37:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 761 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 77,508 KB
最終ジャッジ日時 2024-05-06 10:12:22
合計ジャッジ時間 6,356 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 82 ms
77,184 KB
testcase_05 AC 79 ms
77,184 KB
testcase_06 WA -
testcase_07 AC 81 ms
77,184 KB
testcase_08 AC 84 ms
77,312 KB
testcase_09 AC 84 ms
77,244 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 82 ms
76,928 KB
testcase_13 WA -
testcase_14 AC 72 ms
77,232 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 66 ms
73,728 KB
testcase_29 AC 72 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

def max_ind(X):
    M=X[0]
    ind=0
    for i in range(1,len(X)):
        if M<X[i]:
            M,ind=X[i],ind
    return M,ind
max_A,ind_A = max_ind(A)

def len_bit(N):
    val=1
    count=0
    while(val<=N):
        val*=2
        count+=1
    return count

ans=[]

if len_bit(max_A)>len_bit(B[0]):
    ans.append((2,ind_A,0))
    B[0]^=max_A


bit_b=len_bit(B[0])
for i in range(N-1):
    if len_bit(A[i])==bit_b:
        ans.append((1,i,0))

if len_bit(A[N-1])<bit_b:
    ans.append((1,N,0))
    A[N-1]^=bit_b

max_A=A[N-1]

for i in range(1,N):
    if B[i]<max_A:
        ans.append((2,N-1,i))

ans.append((1,N-1,0))
print(len(ans))
for t,p,q in ans:
    print(t,p+1,q+1)
0