結果
問題 | No.1650 Moving Coins |
ユーザー |
|
提出日時 | 2022-04-27 10:23:02 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 81,588 KB |
実行使用メモリ | 132,464 KB |
最終ジャッジ日時 | 2024-06-28 07:43:03 |
合計ジャッジ時間 | 8,760 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 4 WA * 9 RE * 11 |
ソースコード
N = int(input())A = list(map(int,input().split()))B = list(map(int,input().split()))ans = []left = 0while left < N:right = leftwhile right < N and A[right] < B[right]:right += 1for 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 + 1print(len(ans))for k,c in ans:print(k,c)