結果

問題 No.3297 Bake Cookies
ユーザー moon17
提出日時 2025-10-10 21:50:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 203,768 KB
最終ジャッジ日時 2025-10-10 21:50:26
合計ジャッジ時間 8,168 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,t,*a=map(int,open(0).read().split())
def judge(x):
  d=[0]*n
  r=0
  for i in a:
    if d[i-1]+1<=x:
      d[i-1]+=1
    else:
      r+=1
  for i in d:
    if r<=0:
      break
    if i+t<=x:
      nr=(x-i)//t
      r-=nr
  return r<=0
ok,ng=1<<60,0
while abs(ok-ng)>1:
  mid=ok+ng>>1
  if judge(mid):
    ok=mid
  else:
    ng=mid
print(ok)
0