結果
問題 |
No.3297 Bake Cookies
|
ユーザー |
|
提出日時 | 2025-10-05 13:46:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 126 ms / 2,000 ms |
コード長 | 636 bytes |
コンパイル時間 | 1,644 ms |
コンパイル使用メモリ | 197,552 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-05 13:47:06 |
合計ジャッジ時間 | 5,302 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,M,T; cin >> N >> M >> T; vector<long long> C(N); for(int i=0; i<M; i++){ int c; cin >> c; C.at(c-1)++; } long long low = -1,high = T*M+9; while(high-low > 1){ long long mid = (high+low)/2; long long now = 0; for(auto c : C){ long long over = c-mid; if(over <= 0) now -= abs(over)/T; else now += over; } if(now > 0) low = mid; else high = mid; } cout << high << endl; }