結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 531 ms
43,768 KB
testcase_01 AC 524 ms
43,776 KB
testcase_02 AC 533 ms
43,908 KB
testcase_03 AC 2,524 ms
43,768 KB
testcase_04 AC 2,602 ms
43,516 KB
testcase_05 AC 2,482 ms
44,028 KB
testcase_06 AC 2,516 ms
43,388 KB
testcase_07 AC 2,544 ms
43,656 KB
testcase_08 AC 2,492 ms
43,516 KB
testcase_09 AC 2,469 ms
43,780 KB
testcase_10 AC 2,513 ms
43,512 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
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


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

log = []
for i in range(N - 1):
    all_max = np.max(input_np[i:N])
    all_min = np.min(input_np[i:N])
    tmp_max = input_np[i] if input_np[i] > input_np[i+1] else input_np[i+1]
    tmp_min = input_np[i] if input_np[i] <= input_np[i+1] else input_np[i+1]
    tmp_log = []
    if [tmp_min, tmp_max] not in log:
        log.append([tmp_min, tmp_max])
        for k in range(i+2, N):
            if tmp_max < input_np[k]:
                tmp_max = input_np[k]
                if [tmp_min, tmp_max] in log:
                    break
                log.append([tmp_min, tmp_max])
            elif tmp_min > input_np[k]:
                tmp_min = input_np[k]
                if [tmp_min, tmp_max] in log:
                    break
                log.append([tmp_min, tmp_max])
            if (all_max == tmp_max) and (all_min == tmp_min):
                break
print(len(log))
0