結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー h_nosonh_noson
提出日時 2016-04-29 21:40:02
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 711 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 67,968 KB
実行使用メモリ 14,008 KB
最終ジャッジ日時 2024-04-15 05:28:51
合計ジャッジ時間 9,807 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 63 ms
5,376 KB
testcase_03 AC 117 ms
5,376 KB
testcase_04 AC 139 ms
5,376 KB
testcase_05 AC 140 ms
5,376 KB
testcase_06 AC 139 ms
5,376 KB
testcase_07 AC 161 ms
5,376 KB
testcase_08 AC 162 ms
5,376 KB
testcase_09 AC 161 ms
5,376 KB
testcase_10 AC 125 ms
5,376 KB
testcase_11 AC 134 ms
5,376 KB
testcase_12 AC 119 ms
5,376 KB
testcase_13 AC 148 ms
5,376 KB
testcase_14 AC 153 ms
5,376 KB
testcase_15 AC 136 ms
5,376 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;

#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000

typedef long long ll;

int main() {
    int i, n;
    double l, r;
    ll k;
    int L[200000];
    cin >> n;
    rep (i,n) cin >> L[i];
    cin >> k;
    l = 1e-10; r = 1000000000;
    while (l < r) {
        double m = (l+r) / 2;
        ll sum = 0;
        rep (i,n) sum += L[i]/m;
        if (sum < k)
            r = m-1e-10;
        else
            l = m+1e-10;
    }
    cout << fixed << setprecision(10) << r << endl;
    return 0;
}
0