結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー yuusanlondonyuusanlondon
提出日時 2021-03-12 22:43:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 117,640 KB
最終ジャッジ日時 2024-04-22 14:03:38
合計ジャッジ時間 9,912 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 39 ms
51,584 KB
testcase_02 AC 39 ms
51,712 KB
testcase_03 AC 37 ms
51,840 KB
testcase_04 AC 38 ms
51,880 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 37 ms
51,968 KB
testcase_09 AC 37 ms
51,840 KB
testcase_10 AC 37 ms
51,968 KB
testcase_11 WA -
testcase_12 AC 36 ms
51,840 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 35 ms
51,968 KB
testcase_16 WA -
testcase_17 AC 36 ms
51,712 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 116 ms
103,552 KB
testcase_23 AC 62 ms
78,080 KB
testcase_24 AC 60 ms
75,648 KB
testcase_25 AC 120 ms
104,576 KB
testcase_26 AC 139 ms
117,408 KB
testcase_27 AC 121 ms
104,064 KB
testcase_28 AC 146 ms
117,484 KB
testcase_29 AC 79 ms
88,320 KB
testcase_30 AC 66 ms
81,408 KB
testcase_31 AC 141 ms
117,436 KB
testcase_32 AC 76 ms
86,656 KB
testcase_33 AC 50 ms
64,256 KB
testcase_34 AC 83 ms
90,368 KB
testcase_35 AC 129 ms
104,448 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
  c.append((a[i],i))
c.sort()
b=[0]*n
for i in range(n):
  b[c[i][1]]=i
ans=0
pointer=0
if b[n-1]!=n-1:
  ans+=1
for i in range(n-2,-1,-1):
  if pointer>=i:
      break
  if b[i]+1!=b[i+1]:
    if b[i+1]==pointer:
      pointer+=1
    else:
      ans+=1
print(ans)
0