結果

問題 No.2036 Max Middle
ユーザー とりゐとりゐ
提出日時 2022-08-12 22:16:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 116,632 KB
最終ジャッジ日時 2023-10-24 10:25:28
合計ジャッジ時間 3,120 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,484 KB
testcase_01 AC 37 ms
53,484 KB
testcase_02 AC 37 ms
53,484 KB
testcase_03 AC 37 ms
53,484 KB
testcase_04 AC 37 ms
53,484 KB
testcase_05 AC 38 ms
53,484 KB
testcase_06 AC 37 ms
53,484 KB
testcase_07 AC 37 ms
53,484 KB
testcase_08 AC 74 ms
92,348 KB
testcase_09 AC 96 ms
104,336 KB
testcase_10 AC 109 ms
104,272 KB
testcase_11 AC 99 ms
112,772 KB
testcase_12 AC 92 ms
110,392 KB
testcase_13 AC 111 ms
104,696 KB
testcase_14 AC 44 ms
60,104 KB
testcase_15 AC 43 ms
60,084 KB
testcase_16 AC 110 ms
104,568 KB
testcase_17 AC 84 ms
104,584 KB
testcase_18 AC 96 ms
116,632 KB
testcase_19 AC 91 ms
110,740 KB
testcase_20 AC 100 ms
112,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))

gt=[]
for i in range(n-1):
  if a[i]<a[i+1]:
    gt.append(i)

m=len(gt)
tmp=n-2
ans=0
for i in range(m):
  ans+=tmp
  tmp-=1
  ans-=gt[i]

print(ans)
0