結果
| 問題 | No.3758 Fan Meeting |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 23:48:39 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 35 ms / 2,000 ms |
| + 14µs | |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 350 ms |
| コンパイル使用メモリ | 80,604 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-10-09 23:48:46 |
| 合計ジャッジ時間 | 4,041 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cassert>
using namespace std;
int N,S,A[3<<17];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N>>S;
for(int i=0;i<N;i++)cin>>A[i];
sort(A,A+N);
int L=0,R=A[N-1];
while(R-L>1)
{
int T=(L+R)/2;
int r=S-1;
for(int i=N-1;i>=0&&A[i]>T;i-=T)
{
r-=A[i];
if(r<0)break;
}
if(r<0)L=T;
else R=T;
}
cout<<R<<endl;
}