結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 沙耶花沙耶花
提出日時 2021-10-21 22:19:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 224 ms / 5,000 ms
コード長 544 bytes
コンパイル時間 4,520 ms
コンパイル使用メモリ 254,568 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 01:20:40
合計ジャッジ時間 10,507 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 82 ms
6,940 KB
testcase_03 AC 153 ms
6,940 KB
testcase_04 AC 191 ms
6,944 KB
testcase_05 AC 191 ms
6,944 KB
testcase_06 AC 194 ms
6,944 KB
testcase_07 AC 213 ms
6,940 KB
testcase_08 AC 214 ms
6,940 KB
testcase_09 AC 215 ms
6,944 KB
testcase_10 AC 173 ms
6,940 KB
testcase_11 AC 182 ms
6,944 KB
testcase_12 AC 165 ms
6,940 KB
testcase_13 AC 194 ms
6,940 KB
testcase_14 AC 203 ms
6,944 KB
testcase_15 AC 182 ms
6,940 KB
testcase_16 AC 189 ms
6,944 KB
testcase_17 AC 192 ms
6,940 KB
testcase_18 AC 190 ms
6,940 KB
testcase_19 AC 213 ms
6,940 KB
testcase_20 AC 213 ms
6,944 KB
testcase_21 AC 212 ms
6,944 KB
testcase_22 AC 171 ms
6,944 KB
testcase_23 AC 181 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 6 ms
6,944 KB
testcase_26 AC 3 ms
6,944 KB
testcase_27 AC 3 ms
6,940 KB
testcase_28 AC 36 ms
6,940 KB
testcase_29 AC 19 ms
6,944 KB
testcase_30 AC 7 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000

int main(){
	
	int N;
	cin>>N;
	
	vector<long long> L(N);
	rep(i,N)cin>>L[i];
	
	long long K;
	cin>>K;
	
	double ok = 0.0,ng = 1e10;
	rep(_,100){
		double mid = (ok+ng)/2;
		long long sum = 0LL;
		rep(i,N){
			sum += L[i] / mid;
		}
		if(sum >= K)ok = mid;
		else ng = mid;
	}
	cout<<fixed<<setprecision(10)<<ok<<endl;
	
	return 0;
}
0