結果
| 問題 | No.67 よくある棒を切る問題 (1) | 
| コンテスト | |
| ユーザー |  TAISA_ | 
| 提出日時 | 2018-05-31 19:12:41 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 254 ms / 5,000 ms | 
| コード長 | 587 bytes | 
| コンパイル時間 | 1,363 ms | 
| コンパイル使用メモリ | 155,820 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2025-03-03 11:13:47 | 
| 合計ジャッジ時間 | 8,036 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 30 | 
ソースコード
#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;
}
            
            
            
        