結果
| 問題 | No.3183 Swap or Rotate |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-06-20 21:28:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 79 ms / 1,000 ms |
| + 293µs | |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 95,848 KB |
| 実行使用メモリ | 83,648 KB |
| 最終ジャッジ日時 | 2026-07-12 14:49:29 |
| 合計ジャッジ時間 | 3,402 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
op=""
i=a.index(n-1)
for p in reversed(range(n)):
i=a.index(p)
if i==p:
continue
for _ in range(p):
if a[0]==p:
op+="S"
a[0],a[1]=a[1],a[0]
op+="R"
a=a[1:]+a[:1]
while a[-1]!=n-1:
op+="R"
a=a[1:]+a[:1]
print(op)
sasa8uyauya