結果

問題 No.1650 Moving Coins
ユーザー ntudantuda
提出日時 2021-09-05 17:15:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 113,436 KB
最終ジャッジ日時 2023-08-23 14:15:21
合計ジャッジ時間 13,365 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,248 KB
testcase_01 AC 70 ms
71,544 KB
testcase_02 AC 71 ms
71,444 KB
testcase_03 AC 214 ms
101,712 KB
testcase_04 AC 169 ms
94,808 KB
testcase_05 AC 192 ms
99,112 KB
testcase_06 AC 204 ms
102,364 KB
testcase_07 AC 211 ms
102,792 KB
testcase_08 AC 280 ms
110,960 KB
testcase_09 AC 279 ms
109,852 KB
testcase_10 AC 279 ms
111,884 KB
testcase_11 AC 291 ms
111,064 KB
testcase_12 AC 259 ms
104,776 KB
testcase_13 AC 268 ms
105,816 KB
testcase_14 AC 293 ms
109,424 KB
testcase_15 AC 253 ms
104,584 KB
testcase_16 AC 294 ms
110,400 KB
testcase_17 AC 283 ms
110,680 KB
testcase_18 AC 302 ms
113,436 KB
testcase_19 AC 287 ms
112,556 KB
testcase_20 AC 284 ms
112,456 KB
testcase_21 AC 298 ms
112,852 KB
testcase_22 AC 305 ms
113,144 KB
testcase_23 AC 304 ms
112,984 KB
testcase_24 AC 192 ms
102,308 KB
testcase_25 AC 198 ms
102,052 KB
testcase_26 AC 147 ms
109,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = []
for i in range(N):
    if B[i] < A[i]:
        dif = A[i] - B[i] 
        ans += [[i+1,"L"] for _ in range(dif)]
for i in reversed(range(N)):
    if B[i] > A[i]:
        dif = B[i] - A[i] 
        ans += [[i+1,"R"] for _ in range(dif)]
print(len(ans))
for a in ans:
    print(*a)
0