結果

問題 No.3183 Swap or Rotate
ユーザー ゼット
提出日時 2025-06-20 22:44:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 76,740 KB
最終ジャッジ日時 2025-06-20 22:44:24
合計ジャッジ時間 3,094 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
count=0
result=[]
P=[i for i in range(N)]
while True:
  if A[0]>A[1] and A[0]!=N-1:
    A[0],A[1]=A[1],A[0]
    result.append('S')
    count+=1
  result.append('R')
  count+=1
  A=A[1:]+A[0:1]
  if P==A:
    print(*result,sep='')
    exit()
  if count>20000:
    p=[1]
    print(p[1])
  
0