結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー shoshosho
提出日時 2020-02-14 15:15:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 627 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 162,440 KB
実行使用メモリ 13,088 KB
最終ジャッジ日時 2025-03-03 11:31:24
合計ジャッジ時間 11,266 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#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-12){
    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;
}
0