結果
| 問題 | No.1425 Yet Another Cyclic Shifts Sorting |
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2021-03-12 21:48:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 249 bytes |
| 記録 | |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 82,024 KB |
| 実行使用メモリ | 117,404 KB |
| 最終ジャッジ日時 | 2024-10-14 12:09:19 |
| 合計ジャッジ時間 | 9,688 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 26 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
b.append((a[i],i))
b.sort()
ans=0
pointer=0
for i in range(n-2,-1,-1):
if b[i][1]+1!=b[i+1][1]:
if b[i+1][1]==pointer:
pointer+=1
else:
ans+=1
print(ans)
yuusanlondon