結果
| 問題 |
No.3297 Bake Cookies
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2025-10-14 03:38:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 443 ms / 2,000 ms |
| コード長 | 461 bytes |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 82,340 KB |
| 実行使用メモリ | 116,556 KB |
| 最終ジャッジ日時 | 2025-10-14 03:38:15 |
| 合計ジャッジ時間 | 11,748 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
import sys
input = sys.stdin.readline
from collections import Counter
N,M,T=map(int,input().split())
A=list(map(int,input().split()))
C=Counter(A)
OK=10**9
NG=0
while OK>NG+1:
mid=(OK+NG)//2
rest=0
ko=0
for i in range(1,N+1):
x=C[i]
if x==mid:
pass
elif x>mid:
rest+=x-mid
else:
ko+=(mid-x)//T
if rest<=ko:
OK=mid
else:
NG=mid
print(OK)
titia