結果
| 問題 | No.67 よくある棒を切る問題 (1) |
| コンテスト | |
| ユーザー |
Ysmr_Ry
|
| 提出日時 | 2014-11-17 16:33:15 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 254 ms / 5,000 ms |
| コード長 | 527 bytes |
| 記録 | |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 40,320 KB |
| 実行使用メモリ | 7,220 KB |
| 最終ジャッジ日時 | 2026-07-06 15:23:24 |
| 合計ジャッジ時間 | 7,475 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)
typedef long long ll;
const int MAX_N = 200000;
ll N;
ll L[MAX_N];
ll K;
bool C( double x )
{
ll cnt = 0;
rep( i, N )
cnt += int(L[i]/x);
return cnt >= K;
}
int main()
{
scanf( "%lld", &N );
rep( i, N )
scanf( "%lld", L+i );
scanf( "%lld", &K );
double lb = 0, ub = 1e9;
rep( i, 1000 )
{
double mid = (lb+ub)/2;
if( C( mid ) )
lb = mid;
else
ub = mid;
}
printf( "%.9f\n", lb );
return 0;
}
Ysmr_Ry