結果
問題 |
No.3297 Bake Cookies
|
ユーザー |
|
提出日時 | 2025-10-05 13:57:46 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 640 bytes |
コンパイル時間 | 2,737 ms |
コンパイル使用メモリ | 281,720 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-10-05 13:58:07 |
合計ジャッジ時間 | 7,380 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 6 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll =long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll N,M,T; cin>>N>>M>>T; vector<ll> A(N,0); for(ll i=0;i<M;i++){ ll a; cin>>a; A[a-1]++; } sort(A.begin(),A.end()); ll L=0,R=1e18; while(R-L>1){ ll mid=(R+L)/2; ll z=0; ll d=0; for(int i=0;i<N;i++){ if(A[i]<=mid){ d+=(mid-A[i])/T; } else{ z+=A[i]-mid; } } if(z<=d)R=mid; else L=mid; } cout<<R<<"\n"; }