結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー ttkkggwwttkkggww
提出日時 2022-05-03 10:38:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,311 ms / 5,000 ms
コード長 506 bytes
コンパイル時間 4,096 ms
コンパイル使用メモリ 254,320 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 01:33:59
合計ジャッジ時間 34,503 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,268 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 480 ms
6,944 KB
testcase_03 AC 920 ms
6,944 KB
testcase_04 AC 1,296 ms
6,940 KB
testcase_05 AC 1,292 ms
6,944 KB
testcase_06 AC 1,281 ms
6,940 KB
testcase_07 AC 1,280 ms
6,940 KB
testcase_08 AC 1,275 ms
6,940 KB
testcase_09 AC 1,311 ms
6,940 KB
testcase_10 AC 1,160 ms
6,944 KB
testcase_11 AC 1,217 ms
6,944 KB
testcase_12 AC 1,106 ms
6,940 KB
testcase_13 AC 1,172 ms
6,944 KB
testcase_14 AC 1,229 ms
6,944 KB
testcase_15 AC 1,092 ms
6,940 KB
testcase_16 AC 1,289 ms
6,944 KB
testcase_17 AC 1,288 ms
6,944 KB
testcase_18 AC 1,297 ms
6,944 KB
testcase_19 AC 1,300 ms
6,940 KB
testcase_20 AC 1,298 ms
6,940 KB
testcase_21 AC 1,286 ms
6,944 KB
testcase_22 AC 1,145 ms
6,940 KB
testcase_23 AC 1,223 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 27 ms
6,944 KB
testcase_26 AC 11 ms
6,944 KB
testcase_27 AC 8 ms
6,940 KB
testcase_28 AC 207 ms
6,940 KB
testcase_29 AC 101 ms
6,940 KB
testcase_30 AC 27 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
int n;
vector<ll> L;
ll k = 0;

void solve(){
	double l = 0,r = 1e18;
	for(int i = 0;i<1000;i++){
		double m = (l + r ) /2;
		ll cnt = 0;
		for(int j = 0 ;j<n;j++){
			cnt += L[j]/m;
		}
		if(cnt<k)r = m;
		else l = m;
	}
	printf("%.10lf\n",l);
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> n ;
	L = vector<ll>(n);
	for(auto &i:L)cin >> i;
	cin >> k;
	solve();
}
0