結果

問題 No.1650 Moving Coins
ユーザー brthyyjpbrthyyjp
提出日時 2021-08-21 14:45:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 130,548 KB
最終ジャッジ日時 2024-04-23 06:01:35
合計ジャッジ時間 8,048 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,316 KB
testcase_01 AC 33 ms
53,620 KB
testcase_02 AC 33 ms
52,772 KB
testcase_03 AC 114 ms
84,696 KB
testcase_04 AC 108 ms
78,792 KB
testcase_05 AC 127 ms
84,116 KB
testcase_06 AC 137 ms
84,024 KB
testcase_07 AC 134 ms
86,788 KB
testcase_08 AC 174 ms
106,264 KB
testcase_09 AC 162 ms
103,296 KB
testcase_10 AC 167 ms
107,008 KB
testcase_11 AC 183 ms
105,644 KB
testcase_12 AC 152 ms
92,592 KB
testcase_13 AC 160 ms
92,832 KB
testcase_14 AC 176 ms
103,384 KB
testcase_15 AC 157 ms
91,072 KB
testcase_16 AC 210 ms
108,980 KB
testcase_17 AC 190 ms
109,648 KB
testcase_18 AC 202 ms
114,540 KB
testcase_19 AC 214 ms
130,548 KB
testcase_20 AC 197 ms
130,076 KB
testcase_21 AC 224 ms
121,748 KB
testcase_22 AC 233 ms
115,096 KB
testcase_23 AC 224 ms
115,612 KB
testcase_24 AC 101 ms
78,992 KB
testcase_25 AC 117 ms
79,880 KB
testcase_26 AC 116 ms
108,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans1 = []
ans2 = []
m = 0
for i, (a, b) in enumerate(zip(A, B)):
    d = a-b
    if d < 0:
        ans1 += [(i+1, 'R')]*abs(d)
    elif d > 0:
        ans2 += [(i+1, 'L')]*abs(d)
    m += abs(d)
print(m)
ans1.reverse()
for k, c in ans1:
    print(k, c)
for k, c in ans2:
    print(k, c)
0