結果

問題 No.1650 Moving Coins
ユーザー NoneNone
提出日時 2021-09-30 04:34:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 133,696 KB
最終ジャッジ日時 2023-09-24 07:20:06
合計ジャッジ時間 15,456 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,364 KB
testcase_01 AC 76 ms
70,840 KB
testcase_02 AC 75 ms
71,112 KB
testcase_03 AC 204 ms
98,636 KB
testcase_04 AC 184 ms
93,368 KB
testcase_05 AC 197 ms
96,916 KB
testcase_06 AC 220 ms
99,868 KB
testcase_07 AC 210 ms
100,352 KB
testcase_08 AC 243 ms
114,000 KB
testcase_09 AC 304 ms
112,216 KB
testcase_10 AC 233 ms
115,796 KB
testcase_11 AC 257 ms
115,472 KB
testcase_12 AC 227 ms
101,956 KB
testcase_13 AC 229 ms
101,652 KB
testcase_14 AC 253 ms
110,988 KB
testcase_15 AC 227 ms
101,264 KB
testcase_16 AC 263 ms
119,592 KB
testcase_17 AC 262 ms
115,104 KB
testcase_18 AC 284 ms
120,568 KB
testcase_19 AC 274 ms
133,696 KB
testcase_20 AC 297 ms
133,496 KB
testcase_21 AC 286 ms
127,132 KB
testcase_22 AC 285 ms
130,376 KB
testcase_23 AC 288 ms
130,328 KB
testcase_24 AC 175 ms
99,648 KB
testcase_25 AC 201 ms
99,844 KB
testcase_26 AC 158 ms
109,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
res=[]
for i in range(N):
    a,b=A[i],B[i]
    if a>b:
        for _ in range(a-b):
            res.append((i+1,"L"))
        A[i]=B[i]
for i in range(N)[::-1]:
    a,b=A[i],B[i]
    if a<b:
        for _ in range(b-a):
            res.append((i+1,"R"))
        A[i]=B[i]
print(len(res))
for k,c in res:
    print(k,c)
0