結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 548 ms
51,572 KB
testcase_01 AC 536 ms
43,996 KB
testcase_02 AC 518 ms
44,632 KB
testcase_03 AC 2,524 ms
44,368 KB
testcase_04 AC 2,575 ms
44,244 KB
testcase_05 AC 2,473 ms
44,256 KB
testcase_06 AC 2,536 ms
44,244 KB
testcase_07 AC 2,551 ms
44,440 KB
testcase_08 AC 2,498 ms
44,112 KB
testcase_09 AC 2,479 ms
44,248 KB
testcase_10 AC 2,536 ms
44,496 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:
        tmp_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
                tmp_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
                tmp_log.append([tmp_min, tmp_max])
            if (all_max == tmp_max) and (all_min == tmp_min):
                break
    for tmp_value in tmp_log:
        log.append(tmp_value)
print(len(log))
0