結果

問題 No.2036 Max Middle
ユーザー asumo0729asumo0729
提出日時 2022-08-12 22:07:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 987 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 118,856 KB
最終ジャッジ日時 2023-10-24 10:13:02
合計ジャッジ時間 3,108 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
61,112 KB
testcase_01 AC 49 ms
61,112 KB
testcase_02 AC 49 ms
61,112 KB
testcase_03 AC 48 ms
61,112 KB
testcase_04 AC 48 ms
61,112 KB
testcase_05 WA -
testcase_06 AC 49 ms
61,112 KB
testcase_07 AC 49 ms
61,112 KB
testcase_08 AC 90 ms
91,892 KB
testcase_09 AC 118 ms
112,636 KB
testcase_10 AC 120 ms
118,092 KB
testcase_11 AC 116 ms
114,476 KB
testcase_12 AC 114 ms
113,000 KB
testcase_13 AC 121 ms
118,084 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 115 ms
118,720 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 115 ms
112,644 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
from heapq import heapify, heappop, _heapify_max, heappush
from bisect import bisect_left, bisect_right
import math
import itertools
import copy

stdin=sys.stdin
#sys.setrecursionlimit(10 ** 7)
## import pypyjit
## pypyjit.set_param('max_unroll_recursion=-1')

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
inf = float('inf')
mod = 10 ** 9 + 7
mod = 998244353
eps = 1e-9
sortkey1 = itemgetter(0)
sortkey2 = lambda x: (x[0], x[1])



###############################################################

N = ip()
A = lp()
B = []
for i in range(N - 1):
    if A[i] < A[i + 1]:
        B.append(1)
    else:
        B.append(0)
B = B[::-1]
ans = 0
last = 0
for i in range(1, N - 1):
    if B[i] == 1:
        ans += i - last
        last += 1
print(ans)
0