結果
| 問題 |
No.3297 Bake Cookies
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-05 13:45:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 624 bytes |
| コンパイル時間 | 1,605 ms |
| コンパイル使用メモリ | 197,372 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-10-05 13:45:52 |
| 合計ジャッジ時間 | 3,465 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 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);
while(M--){
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;
}