結果
問題 | No.1031 いたずら好きなお姉ちゃん |
ユーザー | MNGOF |
提出日時 | 2020-04-26 19:27:39 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 636 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 54,572 KB |
最終ジャッジ日時 | 2024-04-28 22:39:48 |
合計ジャッジ時間 | 67,128 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 521 ms
49,712 KB |
testcase_01 | AC | 514 ms
43,816 KB |
testcase_02 | AC | 541 ms
43,940 KB |
testcase_03 | AC | 610 ms
43,948 KB |
testcase_04 | AC | 617 ms
43,820 KB |
testcase_05 | AC | 623 ms
44,072 KB |
testcase_06 | AC | 626 ms
43,828 KB |
testcase_07 | AC | 631 ms
43,824 KB |
testcase_08 | AC | 609 ms
44,456 KB |
testcase_09 | AC | 610 ms
43,956 KB |
testcase_10 | AC | 592 ms
43,940 KB |
testcase_11 | AC | 2,077 ms
46,128 KB |
testcase_12 | AC | 2,105 ms
46,120 KB |
testcase_13 | AC | 2,423 ms
48,556 KB |
testcase_14 | AC | 2,167 ms
46,372 KB |
testcase_15 | AC | 2,307 ms
48,556 KB |
testcase_16 | AC | 2,078 ms
45,616 KB |
testcase_17 | AC | 2,321 ms
48,676 KB |
testcase_18 | AC | 2,281 ms
46,248 KB |
testcase_19 | AC | 2,389 ms
48,816 KB |
testcase_20 | AC | 2,448 ms
49,192 KB |
testcase_21 | AC | 2,270 ms
46,120 KB |
testcase_22 | AC | 2,056 ms
45,616 KB |
testcase_23 | AC | 2,124 ms
45,772 KB |
testcase_24 | AC | 2,400 ms
48,172 KB |
testcase_25 | AC | 2,425 ms
48,552 KB |
testcase_26 | AC | 2,290 ms
48,548 KB |
testcase_27 | AC | 2,165 ms
45,992 KB |
testcase_28 | AC | 2,441 ms
49,064 KB |
testcase_29 | AC | 2,451 ms
49,064 KB |
testcase_30 | AC | 2,437 ms
49,324 KB |
testcase_31 | AC | 2,415 ms
49,448 KB |
testcase_32 | AC | 2,419 ms
48,944 KB |
testcase_33 | AC | 2,459 ms
49,452 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 | -- | - |
ソースコード
import numpy as np N = int(input()) input_np = np.array(input().split()).astype(np.int32) def solve(area): next_area = np.array(area) if next_area.shape[0] == 0: 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 print(solve(input_np))