結果

問題 No.2036 Max Middle
ユーザー AEnAEn
提出日時 2022-12-16 17:22:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 82,008 KB
実行使用メモリ 120,588 KB
最終ジャッジ日時 2024-04-27 17:55:51
合計ジャッジ時間 3,302 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,180 KB
testcase_01 AC 33 ms
53,660 KB
testcase_02 AC 34 ms
53,608 KB
testcase_03 AC 33 ms
52,196 KB
testcase_04 AC 33 ms
52,876 KB
testcase_05 AC 31 ms
52,824 KB
testcase_06 AC 31 ms
52,768 KB
testcase_07 AC 33 ms
52,380 KB
testcase_08 AC 78 ms
96,172 KB
testcase_09 AC 97 ms
104,944 KB
testcase_10 AC 104 ms
111,820 KB
testcase_11 AC 94 ms
113,436 KB
testcase_12 AC 93 ms
118,676 KB
testcase_13 AC 107 ms
112,552 KB
testcase_14 AC 39 ms
62,368 KB
testcase_15 AC 39 ms
61,524 KB
testcase_16 AC 101 ms
112,440 KB
testcase_17 AC 83 ms
113,088 KB
testcase_18 AC 87 ms
118,216 KB
testcase_19 AC 98 ms
120,540 KB
testcase_20 AC 97 ms
120,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

s = []
p, q = 0, 0
for i in range(N-1):
    s.append('<'if A[i+1]>A[i] else '>')

res = 0
id = 0
for i in range(N-1):
    if s[i]=='>':
        res += i-id
        id += 1
print(res)
0