結果

問題 No.1031 いたずら好きなお姉ちゃん
ユーザー MNGOFMNGOF
提出日時 2020-04-26 20:15:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 635 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 56,140 KB
最終ジャッジ日時 2024-04-29 01:01:49
合計ジャッジ時間 61,300 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 514 ms
44,072 KB
testcase_01 AC 513 ms
43,948 KB
testcase_02 AC 518 ms
44,332 KB
testcase_03 AC 572 ms
44,072 KB
testcase_04 AC 578 ms
43,704 KB
testcase_05 AC 579 ms
43,800 KB
testcase_06 AC 580 ms
44,204 KB
testcase_07 AC 583 ms
43,820 KB
testcase_08 AC 578 ms
43,684 KB
testcase_09 AC 575 ms
44,076 KB
testcase_10 AC 576 ms
44,072 KB
testcase_11 AC 1,824 ms
45,736 KB
testcase_12 AC 1,836 ms
46,256 KB
testcase_13 AC 2,135 ms
48,816 KB
testcase_14 AC 1,903 ms
46,380 KB
testcase_15 AC 2,077 ms
47,908 KB
testcase_16 AC 1,835 ms
45,868 KB
testcase_17 AC 2,060 ms
48,552 KB
testcase_18 AC 1,973 ms
45,988 KB
testcase_19 AC 2,045 ms
48,180 KB
testcase_20 AC 2,128 ms
48,556 KB
testcase_21 AC 1,974 ms
46,512 KB
testcase_22 AC 1,812 ms
45,988 KB
testcase_23 AC 1,857 ms
46,376 KB
testcase_24 AC 2,076 ms
48,556 KB
testcase_25 AC 2,135 ms
49,068 KB
testcase_26 AC 2,019 ms
48,044 KB
testcase_27 AC 1,929 ms
46,252 KB
testcase_28 AC 2,137 ms
49,448 KB
testcase_29 AC 2,128 ms
48,744 KB
testcase_30 AC 2,145 ms
48,936 KB
testcase_31 AC 2,149 ms
49,320 KB
testcase_32 AC 2,133 ms
49,192 KB
testcase_33 AC 2,165 ms
49,072 KB
testcase_34 TLE -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def solve(area):
    next_area = np.array(area)
    if next_area.shape[0] <= 1:
        return 0
    count = 0
    while True:
        max_ind = np.argmax(next_area)
        min_ind = np.argmin(next_area)
        if max_ind == min_ind:
            break
        next_area = next_area[0:min_ind] if max_ind < min_ind else next_area[min_ind + 1: next_area.shape[0]]
        count += 1
    max_ind = np.argmax(area)
    count += solve(area[0:max_ind])
    count += solve(area[max_ind + 1: area.shape[0]])
    return count

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

print(solve(input_np))
0