結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー yuusanlondonyuusanlondon
提出日時 2021-03-12 21:48:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 117,932 KB
最終ジャッジ日時 2024-04-22 12:41:54
合計ジャッジ時間 10,252 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 37 ms
52,156 KB
testcase_02 AC 37 ms
51,968 KB
testcase_03 AC 37 ms
51,840 KB
testcase_04 WA -
testcase_05 AC 37 ms
51,584 KB
testcase_06 WA -
testcase_07 AC 37 ms
52,096 KB
testcase_08 AC 37 ms
52,096 KB
testcase_09 AC 38 ms
51,968 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 38 ms
51,968 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 38 ms
51,712 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 111 ms
103,936 KB
testcase_23 AC 61 ms
77,696 KB
testcase_24 AC 58 ms
75,008 KB
testcase_25 AC 119 ms
104,704 KB
testcase_26 AC 140 ms
116,988 KB
testcase_27 AC 125 ms
104,192 KB
testcase_28 AC 145 ms
117,232 KB
testcase_29 AC 78 ms
88,528 KB
testcase_30 AC 65 ms
80,128 KB
testcase_31 AC 144 ms
117,528 KB
testcase_32 AC 73 ms
86,784 KB
testcase_33 AC 49 ms
63,360 KB
testcase_34 AC 81 ms
90,496 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 AC 38 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0