結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー TAISA_TAISA_
提出日時 2018-05-31 19:12:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 243 ms / 5,000 ms
コード長 587 bytes
コンパイル時間 1,414 ms
コンパイル使用メモリ 160,656 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 00:29:37
合計ジャッジ時間 8,001 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 243 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 92 ms
6,944 KB
testcase_03 AC 170 ms
6,940 KB
testcase_04 AC 215 ms
6,940 KB
testcase_05 AC 214 ms
6,940 KB
testcase_06 AC 216 ms
6,940 KB
testcase_07 AC 239 ms
6,940 KB
testcase_08 AC 237 ms
6,944 KB
testcase_09 AC 237 ms
6,940 KB
testcase_10 AC 194 ms
6,940 KB
testcase_11 AC 205 ms
6,940 KB
testcase_12 AC 186 ms
6,940 KB
testcase_13 AC 217 ms
6,940 KB
testcase_14 AC 226 ms
6,944 KB
testcase_15 AC 203 ms
6,940 KB
testcase_16 AC 215 ms
6,940 KB
testcase_17 AC 214 ms
6,940 KB
testcase_18 AC 215 ms
6,940 KB
testcase_19 AC 237 ms
6,940 KB
testcase_20 AC 237 ms
6,940 KB
testcase_21 AC 236 ms
6,940 KB
testcase_22 AC 192 ms
6,944 KB
testcase_23 AC 206 ms
6,944 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 6 ms
6,940 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 3 ms
6,940 KB
testcase_28 AC 40 ms
6,940 KB
testcase_29 AC 20 ms
6,940 KB
testcase_30 AC 6 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-9;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
double l[200010];
int main(){
	int n;cin>>n;
	for(int i=0;i<n;i++)cin>>l[i];
	ll k;cin>>k;
	double ok=0;double ng=INF;
	int cc=100;
	while(cc--){
		double mid=(ng+ok)/2;
		ll c=0;
		for(int i=0;i<n;i++){
			c+=floor(l[i]/mid);
		}
		if(c>=k){
			ok=mid;
		}else{
			ng=mid;
		}
	}
	printf("%.11f\n",ok);
    return 0;
}
0