結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー chocoruskchocorusk
提出日時 2018-09-28 12:04:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 639 bytes
コンパイル時間 832 ms
コンパイル使用メモリ 84,412 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 00:36:37
合計ジャッジ時間 5,081 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
6,812 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 54 ms
6,944 KB
testcase_03 AC 100 ms
6,944 KB
testcase_04 AC 117 ms
6,944 KB
testcase_05 AC 115 ms
6,940 KB
testcase_06 AC 116 ms
6,940 KB
testcase_07 AC 137 ms
6,940 KB
testcase_08 AC 137 ms
6,944 KB
testcase_09 AC 137 ms
6,940 KB
testcase_10 AC 104 ms
6,940 KB
testcase_11 AC 110 ms
6,944 KB
testcase_12 AC 101 ms
6,940 KB
testcase_13 AC 125 ms
6,940 KB
testcase_14 AC 130 ms
6,940 KB
testcase_15 AC 118 ms
6,944 KB
testcase_16 AC 117 ms
6,940 KB
testcase_17 AC 115 ms
6,940 KB
testcase_18 AC 115 ms
6,944 KB
testcase_19 AC 137 ms
6,940 KB
testcase_20 AC 137 ms
6,944 KB
testcase_21 AC 137 ms
6,944 KB
testcase_22 AC 105 ms
6,940 KB
testcase_23 AC 110 ms
6,948 KB
testcase_24 AC 3 ms
6,944 KB
testcase_25 AC 6 ms
6,944 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 3 ms
6,944 KB
testcase_28 AC 25 ms
6,944 KB
testcase_29 AC 13 ms
6,944 KB
testcase_30 AC 6 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n;
	cin>>n;
	double l[200000];
	for(int i=0; i<n; i++) cin>>l[i];
	ll k;
	cin>>k;
	double x1=0, x2=1.0e9;
	for(int t=0; t<100; t++){
		double x=(x1+x2)/2;
		ll ct=0;
		for(int i=0; i<n; i++){
			ct+=((ll)(l[i]/x));
		}
		if(ct>=k) x1=x;
		else x2=x;
	}
	printf("%.10lf\n", x1);
	return 0;
}
0