結果
| 問題 |
No.1031 いたずら好きなお姉ちゃん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-26 22:53:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 747 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 97,640 KB |
| 最終ジャッジ日時 | 2024-11-18 19:56:51 |
| 合計ジャッジ時間 | 142,544 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 TLE * 20 |
ソースコード
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))