結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー oevloevl
提出日時 2019-03-21 22:46:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 215 ms / 5,000 ms
コード長 506 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 166,220 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 00:38:11
合計ジャッジ時間 7,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 215 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 81 ms
6,940 KB
testcase_03 AC 152 ms
6,940 KB
testcase_04 AC 185 ms
6,940 KB
testcase_05 AC 188 ms
6,940 KB
testcase_06 AC 184 ms
6,944 KB
testcase_07 AC 207 ms
6,940 KB
testcase_08 AC 207 ms
6,940 KB
testcase_09 AC 207 ms
6,940 KB
testcase_10 AC 168 ms
6,940 KB
testcase_11 AC 177 ms
6,940 KB
testcase_12 AC 160 ms
6,948 KB
testcase_13 AC 191 ms
6,940 KB
testcase_14 AC 200 ms
6,940 KB
testcase_15 AC 179 ms
6,940 KB
testcase_16 AC 185 ms
6,940 KB
testcase_17 AC 184 ms
6,940 KB
testcase_18 AC 185 ms
6,940 KB
testcase_19 AC 207 ms
6,940 KB
testcase_20 AC 211 ms
6,940 KB
testcase_21 AC 212 ms
6,940 KB
testcase_22 AC 166 ms
6,940 KB
testcase_23 AC 176 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 6 ms
6,940 KB
testcase_26 AC 3 ms
6,940 KB
testcase_27 AC 3 ms
6,940 KB
testcase_28 AC 35 ms
6,940 KB
testcase_29 AC 21 ms
6,940 KB
testcase_30 AC 6 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)
#define rem(i, m, n) for (int i = m; i >= n; --i)
typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<ll> L(N);
  rep(i, 0, N) cin >> L[i];
  ll K;
  cin >> K;
  double ok = 0;
  double ng = 1e11;
  double mid;
  rep(i, 0, 100) {
    mid = (ok + ng) / 2;
    ll cnt = 0;
    rep(j, 0, N) cnt += L[j] / mid;
    if(cnt >= K) ok = mid;
    else ng = mid;
  }
  printf("%.12lf\n", mid);
  return 0;
}
0