結果
問題 |
No.1650 Moving Coins
|
ユーザー |
|
提出日時 | 2022-04-27 10:20:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 64,512 KB |
最終ジャッジ日時 | 2024-06-28 07:42:52 |
合計ジャッジ時間 | 5,173 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 TLE * 1 -- * 1 |
other | -- * 24 |
ソースコード
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((j,"R")) if right < N: for j in range(A[right],B[right],-1): ans.append((j,"L")) left = right print(len(ans)) for k,c in ans: print(k,c)