結果

問題 No.3297 Bake Cookies
コンテスト
ユーザー Kohei
提出日時 2026-08-17 21:06:26
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 641 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 236 ms
コンパイル使用メモリ 95,828 KB
実行使用メモリ 116,352 KB
最終ジャッジ日時 2026-08-17 21:06:34
合計ジャッジ時間 7,565 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def kiriage(a, b): return (a+b-1)//b
N, M, T = map(int, input().split())
A = list(map(int, input().split()))
cnt = [0]*N
for a in A:
    cnt[a - 1] += 1

def solve(m): # m分以内に全て焼けるか?
    total = 0
    for c in cnt:
        if c > m:
            # c - m 枚を別オーブンに委託
            total -= c - m
        elif c == m:
            # このオーブン内で需給が簡潔
            pass
        else:
            total += kiriage(m - c, T)
    return total >= 0

ok = 10**18
ng = 0
while abs(ok - ng) != 1:
    mid = (ok + ng)//2
    if solve(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0