結果
| 問題 | No.1650 Moving Coins |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-20 22:37:06 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 578 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 80,920 KB |
| 実行使用メモリ | 126,480 KB |
| 最終ジャッジ日時 | 2026-09-16 05:23:36 |
| 合計ジャッジ時間 | 7,089 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 TLE * 1 -- * 18 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = list(range(n))
ans = 0
rec = []
while d:
for i in d:
if a[i] == b[i]:
d.pop(d.index(i))
continue
if d.index(i) != 0:
if a[d[d.index(i) - 1]] >= b[d[d.index(i)]]:
continue
if d.index(i) != len(d) - 1:
if a[d[d.index(i) + 1]] <= b[d[d.index(i)]]:
continue
for j in range(abs(a[i] - b[i])):
ans += 1
rec.append(str(i + 1) + ' ' + ('L' if a[i] > b[i] else 'R'))
d.pop(d.index(i))
print(ans)
print(*rec, sep='\n')