結果

問題 No.1650 Moving Coins
ユーザー lloyzlloyz
提出日時 2021-12-20 22:49:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 124,772 KB
最終ジャッジ日時 2023-10-13 19:36:17
合計ジャッジ時間 10,746 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,860 KB
testcase_01 AC 91 ms
71,876 KB
testcase_02 AC 91 ms
71,768 KB
testcase_03 AC 212 ms
89,012 KB
testcase_04 AC 210 ms
86,732 KB
testcase_05 AC 216 ms
88,276 KB
testcase_06 AC 226 ms
89,744 KB
testcase_07 AC 224 ms
89,652 KB
testcase_08 AC 237 ms
110,716 KB
testcase_09 AC 235 ms
107,876 KB
testcase_10 AC 245 ms
110,596 KB
testcase_11 AC 269 ms
110,244 KB
testcase_12 AC 250 ms
96,572 KB
testcase_13 AC 242 ms
96,636 KB
testcase_14 AC 260 ms
106,432 KB
testcase_15 AC 237 ms
95,312 KB
testcase_16 AC 275 ms
114,492 KB
testcase_17 AC 282 ms
114,452 KB
testcase_18 AC 278 ms
119,888 KB
testcase_19 AC 272 ms
124,772 KB
testcase_20 AC 274 ms
123,472 KB
testcase_21 AC 293 ms
123,320 KB
testcase_22 AC 294 ms
123,452 KB
testcase_23 AC 298 ms
123,468 KB
testcase_24 AC 178 ms
88,612 KB
testcase_25 AC 204 ms
89,224 KB
testcase_26 AC 172 ms
123,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

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

ANS = deque()
for i in range(n):
    if A[i] < B[i]:
        cnt = B[i] - A[i]
        for j in range(cnt):
            ANS.appendleft((i + 1, 'R'))
    elif A[i] > B[i]:
        cnt = A[i] - B[i]
        for j in range(cnt):
            ANS.append((i + 1, 'L'))

print(len(ANS))
for ind, direction in ANS:
    print(ind, direction)
0