結果

問題 No.1650 Moving Coins
ユーザー c-yanc-yan
提出日時 2021-08-21 03:06:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 453 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,164 KB
最終ジャッジ日時 2024-04-22 12:21:46
合計ジャッジ時間 11,331 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 186 ms
25,856 KB
testcase_04 AC 149 ms
22,144 KB
testcase_05 AC 173 ms
24,576 KB
testcase_06 AC 192 ms
26,112 KB
testcase_07 AC 192 ms
26,240 KB
testcase_08 AC 316 ms
36,460 KB
testcase_09 AC 315 ms
34,348 KB
testcase_10 AC 327 ms
36,492 KB
testcase_11 AC 328 ms
35,528 KB
testcase_12 AC 271 ms
32,080 KB
testcase_13 AC 273 ms
32,288 KB
testcase_14 AC 317 ms
35,940 KB
testcase_15 AC 255 ms
30,424 KB
testcase_16 AC 341 ms
37,332 KB
testcase_17 AC 337 ms
36,808 KB
testcase_18 AC 360 ms
39,612 KB
testcase_19 AC 438 ms
43,628 KB
testcase_20 AC 447 ms
45,020 KB
testcase_21 AC 444 ms
45,164 KB
testcase_22 AC 453 ms
44,768 KB
testcase_23 AC 453 ms
44,904 KB
testcase_24 AC 194 ms
26,624 KB
testcase_25 AC 194 ms
26,368 KB
testcase_26 AC 217 ms
38,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

result = []
for i in range(N):
    if A[i] <= B[i]:
        continue
    for _ in range(A[i] - B[i]):
        result.append('%d L' % (i + 1))

for i in range(N - 1, -1, -1):
    if A[i] >= B[i]:
        continue
    for _ in range(B[i] - A[i]):
        result.append('%d R' % (i + 1))
print(len(result))
print(*result, sep='\n')
0