結果

問題 No.1650 Moving Coins
ユーザー mesame3993
提出日時 2021-10-06 11:05:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 82,896 KB
実行使用メモリ 114,184 KB
最終ジャッジ日時 2024-07-23 02:44:41
合計ジャッジ時間 8,549 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = []
for i in range(n):
	if A[i] <= B[i]:
		continue
	for _ in range(A[i] - B[i]):
		ans.append('{} L'.format(i+1))
for i in range(n-1, -1, -1):
	if A[i] >= B[i]:
		continue
	for _ in range(B[i] - A[i]):
		ans.append('{} R'.format(i+1))

print(len(ans))
for i in range(len(ans)):
	print(ans[i])
0