結果
| 問題 | No.3183 Swap or Rotate |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-06-20 23:32:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 1,000 ms |
| + 845µs | |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 265 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 85,788 KB |
| 最終ジャッジ日時 | 2026-07-12 16:10:26 |
| 合計ジャッジ時間 | 3,754 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
from collections import deque
N = int(input())
A = deque(map(int, input().split()))
ans = []
while A != deque([*range(N)]):
if 0 not in (A[0], A[1]) and A[0] > A[1]:
A[0], A[1] = A[1], A[0]
ans.append("S")
else:
A.append(A.popleft())
ans.append("R")
print(*ans, sep="")