結果
問題 | No.67 よくある棒を切る問題 (1) |
ユーザー |
![]() |
提出日時 | 2018-04-04 03:30:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,305 bytes |
コンパイル時間 | 933 ms |
コンパイル使用メモリ | 94,960 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 08:38:34 |
合計ジャッジ時間 | 8,455 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 RE * 22 |
ソースコード
# 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; }