結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー ushitora_anqouushitora_anqou
提出日時 2017-12-28 09:44:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 944 bytes
コンパイル時間 2,173 ms
コンパイル使用メモリ 143,980 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-08-23 07:43:56
合計ジャッジ時間 62,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 998 ms
4,376 KB
testcase_03 AC 1,914 ms
4,780 KB
testcase_04 AC 2,630 ms
5,228 KB
testcase_05 AC 2,628 ms
5,052 KB
testcase_06 AC 2,623 ms
5,216 KB
testcase_07 AC 2,647 ms
5,204 KB
testcase_08 AC 2,648 ms
5,244 KB
testcase_09 AC 2,635 ms
5,200 KB
testcase_10 AC 2,355 ms
4,888 KB
testcase_11 AC 2,497 ms
5,176 KB
testcase_12 AC 2,258 ms
4,832 KB
testcase_13 AC 2,416 ms
5,144 KB
testcase_14 AC 2,502 ms
5,140 KB
testcase_15 AC 2,247 ms
5,004 KB
testcase_16 AC 2,627 ms
5,080 KB
testcase_17 AC 2,629 ms
5,212 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 52 ms
4,376 KB
testcase_26 AC 21 ms
4,376 KB
testcase_27 AC 14 ms
4,380 KB
testcase_28 AC 422 ms
4,376 KB
testcase_29 AC 210 ms
4,380 KB
testcase_30 AC 55 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
const int INF = 1 << 29;
const ll LINF = 1l << 61;
const ld PI = abs(acos(-1));
#define pq priotity_queue
#define mp make_pair
#define P pair
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define cbuf(buf, init) memset(buf, init, sizeof(buf))
#define modp(x, y) (((y) + (x) % (y)) % (y))
#define divd(x, y) (static_cast<double>(x) / static_cast<double>(y))

ll N, L[300000], K;

bool C(double l)
{
    ll s = 0;
    rep(i, 0, N){
        s += L[i] / l;
    }
    return s >= K;
}


int main()
{
    //
    cin >> N;
    rep(i, 0, N)    cin >> L[i];
    cin >> K;

    double lb = 0, ub = INF;
    rep(i, 0, 2000){
        double mid = (lb + ub) / 2;
        if(C(mid))
            lb = mid;
        else
            ub = mid;
    }
    cout << fixed << setprecision(14)  << lb << endl;
}
0