結果
| 問題 | No.944 煎っぞ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-13 22:27:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 98,560 KB |
| 最終ジャッジ日時 | 2024-09-19 06:05:24 |
| 合計ジャッジ時間 | 8,693 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 34 |
ソースコード
N = int(input())
a = list(map(int,input().split()))
def calc(x):
count = 0
now = 0
left = 0
while left < N:
right = left
while right < N and now + a[right] <= x:
now += a[right]
right += 1
if now < x:
return 0
now = 0
count += 1
left = right
return count
ans = 0
Sum = 0
S = sum(a)
M = max(a)
for i in a:
Sum += i
if Sum > S // 2:break
if Sum < M:continue
t = calc(Sum)
if t > ans:
ans = t
print(ans)