結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 509 ms
49,168 KB
testcase_01 AC 499 ms
43,712 KB
testcase_02 AC 596 ms
43,956 KB
testcase_03 AC 557 ms
43,504 KB
testcase_04 AC 555 ms
43,964 KB
testcase_05 AC 550 ms
43,364 KB
testcase_06 AC 556 ms
43,572 KB
testcase_07 AC 557 ms
43,636 KB
testcase_08 AC 558 ms
43,512 KB
testcase_09 AC 557 ms
43,712 KB
testcase_10 AC 560 ms
43,508 KB
testcase_11 AC 1,593 ms
45,880 KB
testcase_12 AC 1,581 ms
46,260 KB
testcase_13 AC 1,838 ms
49,076 KB
testcase_14 AC 1,628 ms
45,876 KB
testcase_15 AC 1,728 ms
48,056 KB
testcase_16 AC 1,569 ms
45,752 KB
testcase_17 AC 1,751 ms
48,304 KB
testcase_18 AC 1,716 ms
46,772 KB
testcase_19 AC 1,757 ms
48,316 KB
testcase_20 AC 1,851 ms
48,816 KB
testcase_21 AC 1,709 ms
46,512 KB
testcase_22 AC 1,589 ms
45,880 KB
testcase_23 AC 1,590 ms
45,756 KB
testcase_24 AC 1,789 ms
48,816 KB
testcase_25 AC 1,858 ms
48,564 KB
testcase_26 AC 1,700 ms
46,136 KB
testcase_27 AC 1,654 ms
45,752 KB
testcase_28 AC 1,808 ms
48,820 KB
testcase_29 AC 1,825 ms
49,588 KB
testcase_30 AC 1,820 ms
49,336 KB
testcase_31 AC 1,856 ms
49,464 KB
testcase_32 AC 1,842 ms
49,204 KB
testcase_33 AC 1,842 ms
49,288 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 solve2(area):
    next_area = area
    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)
    if max_ind == 2:
        count += 1
    elif max_ind > 2:
        count += solve2(area[0:max_ind])

    if (area.shape[0] - max_ind) == 3:
        count += 1
    elif (area.shape[0] - max_ind) > 3:
        count += solve2(area[max_ind + 1: area.shape[0]])
    return count
    

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

print(solve2(data))
0