結果
| 問題 |
No.1650 Moving Coins
|
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2021-08-20 21:52:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 201 ms / 2,000 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 131,752 KB |
| 最終ジャッジ日時 | 2024-10-14 03:23:24 |
| 合計ジャッジ時間 | 8,000 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=[]
s=[]
for i in range(n):
if a[i]<b[i]:
s.append('R')
else:
s.append('L')
for i in range(n):
if s[i]=='L':
for j in range(a[i]-b[i]):
ans.append(' '.join([str(i+1),'L']))
for i in range(n-1,-1,-1):
if s[i]=='R':
for j in range(b[i]-a[i]):
ans.append(' '.join([str(i+1),'R']))
print(len(ans))
for i in ans:
print(i)
yuusanlondon