結果

問題 No.1650 Moving Coins
ユーザー 👑 H20H20
提出日時 2021-08-20 22:51:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 123,316 KB
最終ジャッジ日時 2024-04-22 05:49:32
合計ジャッジ時間 7,826 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,840 KB
testcase_01 AC 38 ms
51,968 KB
testcase_02 AC 37 ms
51,840 KB
testcase_03 AC 79 ms
76,160 KB
testcase_04 AC 82 ms
76,544 KB
testcase_05 AC 83 ms
76,200 KB
testcase_06 AC 90 ms
76,320 KB
testcase_07 AC 84 ms
76,412 KB
testcase_08 AC 137 ms
103,424 KB
testcase_09 AC 127 ms
103,424 KB
testcase_10 AC 134 ms
103,680 KB
testcase_11 AC 149 ms
104,192 KB
testcase_12 AC 120 ms
91,520 KB
testcase_13 AC 126 ms
91,776 KB
testcase_14 AC 146 ms
103,680 KB
testcase_15 AC 114 ms
89,088 KB
testcase_16 AC 156 ms
106,112 KB
testcase_17 AC 155 ms
104,924 KB
testcase_18 AC 170 ms
105,080 KB
testcase_19 AC 163 ms
123,132 KB
testcase_20 AC 163 ms
123,316 KB
testcase_21 AC 174 ms
122,500 KB
testcase_22 AC 176 ms
121,404 KB
testcase_23 AC 182 ms
121,664 KB
testcase_24 AC 66 ms
75,776 KB
testcase_25 AC 76 ms
76,032 KB
testcase_26 AC 121 ms
108,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
L = []
R = []
ans = 0
for i in range(N):
    if A[i]>B[i]:
        L.append(i)
    if A[i]<B[i]:
        R.append(i)
    ans += abs(A[i]-B[i])
R.reverse()
print(ans)
for l in L:
    for _ in range(abs(A[l]-B[l])):
        print(str(l+1)+" L")
for r in R:
    for _ in range(abs(A[r]-B[r])):
        print(str(r+1)+" R")
0