結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー parsee1053parsee1053
提出日時 2020-09-27 15:28:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 01:53:57
合計ジャッジ時間 8,075 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 204 ms
4,384 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 178 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 190 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 153 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 159 ms
4,376 KB
testcase_16 AC 175 ms
4,376 KB
testcase_17 AC 172 ms
4,380 KB
testcase_18 AC 171 ms
4,380 KB
testcase_19 AC 191 ms
4,376 KB
testcase_20 AC 186 ms
4,376 KB
testcase_21 AC 200 ms
4,376 KB
testcase_22 AC 159 ms
4,376 KB
testcase_23 AC 167 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 3 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n;
  cin >> n;
  vector<int> l(n);
  for (int i = 0; i < n; ++i) {
    cin >> l[i];
  }
  ll k;
  cin >> k;
  double ok = 0, ng = 1e9 + 1;
  for (int i = 0; i < 100; ++i) {
    double mid = (ok + ng) / 2.0;
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      cnt += (l[i] / mid);
    }
    if (k <= cnt) {
      ok = mid;
    } else {
      ng = mid;
    }
  }
  printf("%.15f\n", ok);
  return 0;
}
0