結果
| 問題 | No.944 煎っぞ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-15 12:36:42 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 835 bytes |
| 記録 | |
| コンパイル時間 | 582 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 36,060 KB |
| 最終ジャッジ日時 | 2026-03-24 02:16:51 |
| 合計ジャッジ時間 | 116,046 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 4 TLE * 27 |
ソースコード
import copy
def isOneTypeInList(list):
for t in list:
if list.count(t) <= 1:
return False
return True
def roast(list, i):
l = copy.deepcopy(list)
j = l.pop(i)
k = l.pop(i)
l.insert(i,j+k)
return l
def loop(list):
if len(list) <= 1:
return len(list)
elif isOneTypeInList(list):
return len(list)
elif len(list) == 2:
return 1
else:
minIndex = list.index(min(list))
if minIndex == 0:
return loop(roast(list, minIndex))
elif minIndex == len(list) - 1:
return loop(roast(list, minIndex - 1))
else:
f = loop(roast(list, minIndex))
b = loop(roast(list, minIndex - 1))
return max(f,b)
n = input()
beans = list(map(int, input().split()))
print(loop(beans))