結果
| 問題 | No.1031 いたずら好きなお姉ちゃん |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-26 22:46:46 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 559 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 549,092 KB |
| 最終ジャッジ日時 | 2026-09-25 22:40:33 |
| 合計ジャッジ時間 | 36,383 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 31 RE * 19 TLE * 1 |
ソースコード
def solve(area):
if len(area) <= 1:
return 0
count = 0
max_ind = area.index(max(area))
min_ind = max_ind
for i in reversed(range(max_ind)):
if area[min_ind] > area[i]:
min_ind = i
count += 1
min_ind = max_ind
for i in range(max_ind+1, len(area)):
if area[min_ind] > area[i]:
min_ind = i
count += 1
count += solve(area[0:max_ind])
count += solve(area[max_ind+1:len(area)])
return count
N = int(input())
data = (input().split())
print(solve(data))