結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー betit0919betit0919
提出日時 2019-08-18 19:58:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 202 ms / 5,000 ms
コード長 983 bytes
コンパイル時間 1,128 ms
コンパイル使用メモリ 105,268 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 00:45:13
合計ジャッジ時間 7,023 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 199 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 78 ms
6,940 KB
testcase_03 AC 145 ms
6,944 KB
testcase_04 AC 196 ms
6,944 KB
testcase_05 AC 198 ms
6,944 KB
testcase_06 AC 199 ms
6,940 KB
testcase_07 AC 202 ms
6,944 KB
testcase_08 AC 199 ms
6,940 KB
testcase_09 AC 197 ms
6,944 KB
testcase_10 AC 177 ms
6,940 KB
testcase_11 AC 183 ms
6,940 KB
testcase_12 AC 170 ms
6,944 KB
testcase_13 AC 184 ms
6,940 KB
testcase_14 AC 192 ms
6,940 KB
testcase_15 AC 169 ms
6,944 KB
testcase_16 AC 194 ms
6,940 KB
testcase_17 AC 199 ms
6,940 KB
testcase_18 AC 198 ms
6,944 KB
testcase_19 AC 199 ms
6,944 KB
testcase_20 AC 202 ms
6,940 KB
testcase_21 AC 198 ms
6,940 KB
testcase_22 AC 179 ms
6,940 KB
testcase_23 AC 188 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 34 ms
6,944 KB
testcase_29 AC 17 ms
6,940 KB
testcase_30 AC 6 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>
#include <iterator>
#include <functional>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N;
  cin>>N;
  vector<long double> L(N);
  REP(i,N)cin>>L[i];
  ll K;
  cin>>K;
  long double high=10000000000000000,low=0;
  long double mid;

  REP(loop,200){
    ll cnt=0;
    mid=(high+low)/2.0;
    REP(i,N){
      cnt+=ll(L[i]/mid);
    }
    if(cnt>=K){
      low=mid;
    }else{
      high=mid;
    }
  }
  cout<<setprecision(15)<<mid<<endl;
}
0