結果
| 問題 |
No.1650 Moving Coins
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-08-20 21:46:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 520 bytes |
| コンパイル時間 | 448 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 121,496 KB |
| 最終ジャッジ日時 | 2024-10-14 03:09:40 |
| 合計ジャッジ時間 | 9,944 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 TLE * 1 -- * 7 |
ソースコード
import sys
input = sys.stdin.readline
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ANS=[]
while A!=B:
for i in range(N):
if A[i]<B[i]:
while A[i]<B[i] and (i+1==N or A[i+1]!=A[i]+1):
ANS.append((i+1,"R"))
A[i]+=1
elif A[i]>B[i]:
while A[i]>B[i] and (i==0 or A[i-1]!=A[i]-1):
ANS.append((i+1,"L"))
A[i]-=1
print(len(ANS))
for x,y in ANS:
print(x,y)
titia