結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー satanicsatanic
提出日時 2016-05-14 05:05:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,349 ms / 5,000 ms
コード長 1,122 bytes
コンパイル時間 1,589 ms
コンパイル使用メモリ 166,580 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 23:43:48
合計ジャッジ時間 33,315 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,336 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 502 ms
6,940 KB
testcase_03 AC 962 ms
6,944 KB
testcase_04 AC 1,326 ms
6,944 KB
testcase_05 AC 1,330 ms
6,944 KB
testcase_06 AC 1,331 ms
6,944 KB
testcase_07 AC 1,332 ms
6,940 KB
testcase_08 AC 1,332 ms
6,940 KB
testcase_09 AC 1,333 ms
6,940 KB
testcase_10 AC 1,198 ms
6,944 KB
testcase_11 AC 1,266 ms
6,940 KB
testcase_12 AC 1,147 ms
6,940 KB
testcase_13 AC 1,241 ms
6,944 KB
testcase_14 AC 1,266 ms
6,940 KB
testcase_15 AC 1,134 ms
6,940 KB
testcase_16 AC 1,332 ms
6,940 KB
testcase_17 AC 1,327 ms
6,940 KB
testcase_18 AC 1,328 ms
6,944 KB
testcase_19 AC 1,346 ms
6,940 KB
testcase_20 AC 1,342 ms
6,944 KB
testcase_21 AC 1,349 ms
6,944 KB
testcase_22 AC 1,204 ms
6,944 KB
testcase_23 AC 1,272 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 28 ms
6,940 KB
testcase_26 AC 11 ms
6,940 KB
testcase_27 AC 8 ms
6,940 KB
testcase_28 AC 215 ms
6,940 KB
testcase_29 AC 108 ms
6,944 KB
testcase_30 AC 29 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define VAR(type, a) type a;std::cin>>a;
// VAR(int, x);
#define OUT(d) std::cout<<(d);
#define FOUT(d, n) std::cout<<std::fixed<<std::setprecision(n)<<(d);
#define SP std::cout<<" ";
#define ENDL std::cout<<"\n";
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& r:c)for(auto& i:r)std::cin>>i;
#define ALL(a) (a).begin(),(a).end()
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using ll = long long;

signed main(){
    INIT;
    VAR(ll, n);
    VEC(ll, l, n);
    VAR(ll, k);
    double left = 0, right = 1000000000;
    double mid;
    REP(i, 1000){
        mid = (left+right)/2;
        ll cnt = 0;
        REP(j, n){
            cnt += std::floor(l[j]/mid);
        }
        if(k<=cnt) left  = mid;
        else       right = mid;
    }
    FOUT(mid, 10)ENDL;
    return 0;
}
0