結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー autumn-eelautumn-eel
提出日時 2017-12-16 12:43:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 164,040 KB
実行使用メモリ 4,604 KB
最終ジャッジ日時 2023-08-21 09:07:13
合計ジャッジ時間 7,807 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
4,400 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 152 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 155 ms
4,480 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 132 ms
4,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 131 ms
4,376 KB
testcase_16 AC 152 ms
4,400 KB
testcase_17 AC 152 ms
4,384 KB
testcase_18 AC 152 ms
4,380 KB
testcase_19 AC 155 ms
4,536 KB
testcase_20 AC 156 ms
4,380 KB
testcase_21 AC 155 ms
4,376 KB
testcase_22 AC 137 ms
4,400 KB
testcase_23 AC 144 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
4,380 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

int L[200000];
int main(){
	int n;scanf("%d",&n);
	rep(i,n)scanf("%d",&L[i]);
	int k;scanf("%d",&k);
	double l=0,r=1e9;
	rep(i,100){
		double t=(l+r)/2;
		int cnt=0;
		rep(j,n)cnt+=L[j]/t;
		if(cnt>=k)l=t;
		else r=t;
	}
	printf("%.12lf\n",l);
}
0