結果
| 問題 |
No.1650 Moving Coins
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-07 10:59:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 654 bytes |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 139,596 KB |
| 最終ジャッジ日時 | 2024-06-12 01:34:41 |
| 合計ジャッジ時間 | 11,408 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 23 |
ソースコード
N = int(input())
A = list(map(int, input().split())) + [10 ** 9]
B = list(map(int, input().split()))
stack = []
ans = []
for i in range(N):
now_pos = A[i]
to_pos = B[i]
move = abs(now_pos - to_pos)
if A[i + 1] > to_pos:
if now_pos < to_pos:
direction = "R"
else:
direction = "L"
for _ in range(move):
ans.append((i + 1, direction))
while stack:
ind, move = stack.pop()
for _ in range(move):
ans.append((ind + 1, "R"))
else:
stack.append((i, move))
if ans:
for row in ans:
print(*row)
else:
print(0)