結果

問題 No.944 煎っぞ!
ユーザー ああいいああいい
提出日時 2022-03-13 22:27:21
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 534 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 99,448 KB
最終ジャッジ日時 2023-10-19 09:53:21
合計ジャッジ時間 9,109 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0