結果

問題 No.1031 いたずら好きなお姉ちゃん
ユーザー MNGOF
提出日時 2020-04-26 19:51:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 568 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 49,576 KB
最終ジャッジ日時 2024-11-17 21:33:37
合計ジャッジ時間 29,014 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other AC * 1 RE * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def solve(area):
    if area.shape[0] <= 1:
        return 0
    count = solve_max(area)
    count += solve_min(area) - 1
    max_ind = np.argmax(area)
    min_ind = np.argmin(area)
    left_ind = min_ind if min_ind < max_ind else max_ind
    right_ind = min_ind if min_ind > max_ind else max_ind
    count += solve(area[0:left_ind])
    count += solve(area[left_ind+1: right_ind])
    count += solve(area[right_ind+1:area.shape[0]])
    return count


N = int(input())
input_np = np.array(input().split()).astype(np.int32)

print(solve(input_np))
0