結果
問題 |
No.67 よくある棒を切る問題 (1)
|
ユーザー |
![]() |
提出日時 | 2015-03-09 02:20:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 560 bytes |
コンパイル時間 | 490 ms |
コンパイル使用メモリ | 59,844 KB |
実行使用メモリ | 8,612 KB |
最終ジャッジ日時 | 2025-03-03 10:17:31 |
合計ジャッジ時間 | 4,141 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 17 |
ソースコード
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; typedef long long ll; int N, L[200010]; ll K; bool func(double x) { int cnt=0; for(int i=0;i<N;++i) cnt+=(int)(L[i]/x); return cnt>=K; } int main() { while (cin>>N) { for(int i=0;i<N;++i) cin>>L[i]; cin>>K; double lb=0, ub=1e11; for(int $=0;$<100;++$) { double x=(ub+lb)*0.5; if (func(x)) lb=x; else ub=x; } printf("%.10f\n", lb); } }