結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mukadenodaioumukadenodaiou
提出日時 2018-04-04 03:30:06
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,305 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 96,336 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-08 15:37:03
合計ジャッジ時間 7,225 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 516 ms
4,376 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 28 ms
4,380 KB
testcase_26 AC 11 ms
4,376 KB
testcase_27 AC 8 ms
4,380 KB
testcase_28 AC 221 ms
4,376 KB
testcase_29 AC 110 ms
4,376 KB
testcase_30 AC 30 ms
4,380 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[100000],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