結果

問題 No.1896 Arrays and XOR Procedure 2
ユーザー tktk_snsntktk_snsn
提出日時 2022-04-08 22:51:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-05-06 08:32:30
合計ジャッジ時間 20,204 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 632 ms
12,160 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 623 ms
11,904 KB
testcase_09 AC 619 ms
11,904 KB
testcase_10 AC 617 ms
11,776 KB
testcase_11 AC 629 ms
11,776 KB
testcase_12 AC 616 ms
11,776 KB
testcase_13 AC 906 ms
12,288 KB
testcase_14 AC 899 ms
12,160 KB
testcase_15 AC 893 ms
12,160 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 121 ms
11,392 KB
testcase_19 AC 56 ms
11,136 KB
testcase_20 AC 193 ms
11,648 KB
testcase_21 AC 56 ms
11,136 KB
testcase_22 AC 306 ms
11,520 KB
testcase_23 AC 325 ms
11,648 KB
testcase_24 AC 325 ms
11,776 KB
testcase_25 AC 317 ms
11,520 KB
testcase_26 AC 332 ms
11,648 KB
testcase_27 AC 315 ms
11,648 KB
testcase_28 AC 479 ms
11,264 KB
testcase_29 AC 506 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = []
while True:
    a = max(A)
    i = A.index(a)
    b = min(B)
    j = B.index(b)

    if a < b:
        break

    if a == b:
        ans.append((1, i + 1, j + 1))
        A[i] = 0
    else:
        ans.append((2, i + 1, j + 1))
        ans.append((1, i + 1, j + 1))
        ans.append((2, i + 1, j + 1))
        A[i] = b
        B[j] = a


print(len(ans))
for t in ans:
    print(*t)
0