結果
| 問題 | No.67 よくある棒を切る問題 (1) | 
| コンテスト | |
| ユーザー |  shoshosho | 
| 提出日時 | 2020-02-14 15:16:30 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 173 ms / 5,000 ms | 
| コード長 | 627 bytes | 
| コンパイル時間 | 1,466 ms | 
| コンパイル使用メモリ | 163,108 KB | 
| 実行使用メモリ | 8,608 KB | 
| 最終ジャッジ日時 | 2025-03-03 11:31:30 | 
| 合計ジャッジ時間 | 6,256 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 30 | 
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const int INF = 1000000;
const double PI=3.14159265359;
int main(){
  ll n;cin>>n;
  ll l[n];rep(i,0,n)cin>>l[i];
  ll k;cin>>k;
  lb ok=0,ng=1e9;
  while(ng-ok>1e-10){
    lb mid=(ok+ng)/2;
    ll sum=0;
    rep(i,0,n)sum+=l[i]/mid;
    if(sum>=k)ok=mid;
    else ng=mid;
  }
  out(setprecision(12)<<ok);
  return 0;
}
            
            
            
        