結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mukadenodaioumukadenodaiou
提出日時 2018-04-04 03:30:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,360 ms / 5,000 ms
コード長 1,305 bytes
コンパイル時間 1,014 ms
コンパイル使用メモリ 95,488 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 00:28:17
合計ジャッジ時間 32,697 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,360 ms
6,816 KB
testcase_01 AC 3 ms
6,820 KB
testcase_02 AC 511 ms
6,940 KB
testcase_03 AC 969 ms
6,940 KB
testcase_04 AC 1,322 ms
6,944 KB
testcase_05 AC 1,336 ms
6,940 KB
testcase_06 AC 1,323 ms
6,944 KB
testcase_07 AC 1,339 ms
6,940 KB
testcase_08 AC 1,341 ms
6,940 KB
testcase_09 AC 1,339 ms
6,944 KB
testcase_10 AC 1,178 ms
6,944 KB
testcase_11 AC 1,253 ms
6,944 KB
testcase_12 AC 1,149 ms
6,940 KB
testcase_13 AC 1,235 ms
6,940 KB
testcase_14 AC 1,289 ms
6,944 KB
testcase_15 AC 1,152 ms
6,944 KB
testcase_16 AC 1,322 ms
6,944 KB
testcase_17 AC 1,322 ms
6,940 KB
testcase_18 AC 1,322 ms
6,940 KB
testcase_19 AC 1,336 ms
6,940 KB
testcase_20 AC 1,345 ms
6,940 KB
testcase_21 AC 1,336 ms
6,944 KB
testcase_22 AC 1,201 ms
6,940 KB
testcase_23 AC 1,262 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 29 ms
6,940 KB
testcase_26 AC 12 ms
6,940 KB
testcase_27 AC 9 ms
6,940 KB
testcase_28 AC 220 ms
6,940 KB
testcase_29 AC 111 ms
6,944 KB
testcase_30 AC 31 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
using namespace std;
typedef long long int ll;
const int N = 1000000;
const int mod = 1000000007;
const int INF = 1 << 30;
#define rep(i,n) for(int i=(ll)0;i<(ll)n;++i)
#define ALL(x) x.begin(),x.end()
#define pp pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define fix(n) fixed<<setprecision(n)
ll ppow(ll x, ll n) {
	ll ans = 1;
	while (n > 0) {
		if ((n & 1) == 1)ans = ans * x;
		x = x * x;
		n >>= 1;
		ans %= mod;
	}
	return ans;
}
bool f(ll n) {
	bool b = 1;
	for (int i = 2; i <= sqrt(n);++i)if (n%i == 0)b = 0;
	return b;
}
string YN(bool b) { return(b ? "YES" : "NO"); }
string yn(bool b) { return(b ? "Yes" : "No"); }
int main() {
	double l = 0.0, r = 1000000000.0,m;
	ll n,v[200020],ct,k;
	cin >> n;
	rep(i,n)cin >> v[i];
	cin >> k;
	rep(i, 1000) {
		ct = 0;
		m = (l + r) / 2;
		rep(i, n)ct += v[i] / m;
		if (ct < k)r = m;
		else l = m;
	}
	cout <<fix(15)<< m << endl;
	return 0;
}
0