結果

問題 No.1650 Moving Coins
ユーザー ああいいああいい
提出日時 2022-04-27 10:23:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 129,092 KB
最終ジャッジ日時 2023-09-10 16:32:43
合計ジャッジ時間 11,926 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,312 KB
testcase_01 AC 71 ms
71,436 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 231 ms
111,592 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 RE -
testcase_14 WA -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 WA -
testcase_19 AC 247 ms
129,092 KB
testcase_20 RE -
testcase_21 WA -
testcase_22 RE -
testcase_23 WA -
testcase_24 AC 164 ms
99,652 KB
testcase_25 RE -
testcase_26 AC 147 ms
109,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = []
left = 0
while left < N:
    right = left
    while right < N and A[right] < B[right]:
        right += 1
    for i in reversed(range(left,right)):
        for j in range(A[i],B[i]):
            ans.append((i + 1,"R"))
    if right < N:
        for j in range(A[right],B[right],-1):
            ans.append((i + 1,"L"))
    left = right + 1
print(len(ans))
for k,c in ans:
    print(k,c)

        
0