結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー daleksprinterdaleksprinter
提出日時 2018-09-12 23:31:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 699 bytes
コンパイル時間 1,790 ms
コンパイル使用メモリ 163,672 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 00:35:14
合計ジャッジ時間 4,202 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 23 ms
6,940 KB
testcase_03 AC 42 ms
6,940 KB
testcase_04 AC 53 ms
6,944 KB
testcase_05 AC 52 ms
6,944 KB
testcase_06 AC 52 ms
6,940 KB
testcase_07 AC 59 ms
6,944 KB
testcase_08 AC 57 ms
6,944 KB
testcase_09 AC 56 ms
6,940 KB
testcase_10 AC 48 ms
6,944 KB
testcase_11 AC 49 ms
6,940 KB
testcase_12 AC 46 ms
6,940 KB
testcase_13 AC 52 ms
6,940 KB
testcase_14 AC 55 ms
6,940 KB
testcase_15 AC 48 ms
6,940 KB
testcase_16 AC 53 ms
6,940 KB
testcase_17 AC 53 ms
6,940 KB
testcase_18 AC 53 ms
6,940 KB
testcase_19 AC 57 ms
6,944 KB
testcase_20 AC 57 ms
6,940 KB
testcase_21 AC 57 ms
6,944 KB
testcase_22 AC 47 ms
6,940 KB
testcase_23 AC 51 ms
6,944 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 3 ms
6,940 KB
testcase_26 AC 2 ms
6,944 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 10 ms
6,944 KB
testcase_29 AC 6 ms
6,940 KB
testcase_30 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for(int i=a;i<b;i++)
#define int long long
const int inf = 100100100100100;
const int mod = 1000000007;


signed main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    cin >> n;
    int arr[n];
    rep(i,0,n) cin >> arr[i];
    int k;
    cin >> k;

    double left = 0;
    double right = 1e13;

    rep(i,0,100){
        double mid = (left + right)/2;

        int cnt = 0;
        rep(j,0,n){
            cnt += (int)(arr[j]/mid);
        }
        if(cnt >= k){
            left = mid;
        }else{
            right = mid;
        }

    }
    cout << fixed << setprecision(10) <<left << endl;



}
0