結果
問題 | No.67 よくある棒を切る問題 (1) |
ユーザー |
![]() |
提出日時 | 2018-05-31 19:12:41 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 241 ms / 5,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 1,651 ms |
コンパイル使用メモリ | 158,684 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-11-08 12:40:59 |
合計ジャッジ時間 | 7,932 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int,int> P; const ll MOD=1000000007; const ll INF=1000000010; const ll LINF=4000000000000000010LL; const int MAX=310; const double EPS=1e-9; int dx[4]={0,1,0,1}; int dy[4]={0,0,1,1}; double l[200010]; int main(){ int n;cin>>n; for(int i=0;i<n;i++)cin>>l[i]; ll k;cin>>k; double ok=0;double ng=INF; int cc=100; while(cc--){ double mid=(ng+ok)/2; ll c=0; for(int i=0;i<n;i++){ c+=floor(l[i]/mid); } if(c>=k){ ok=mid; }else{ ng=mid; } } printf("%.11f\n",ok); return 0; }