結果
問題 |
No.67 よくある棒を切る問題 (1)
|
ユーザー |
![]() |
提出日時 | 2016-04-29 21:39:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 684 ms |
コンパイル使用メモリ | 68,252 KB |
実行使用メモリ | 17,208 KB |
最終ジャッジ日時 | 2025-03-03 10:34:27 |
合計ジャッジ時間 | 8,933 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 TLE * 1 -- * 20 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,n,0) #define REP(i,s,e) for (i = s; i < e; i++) #define rep(i,n) REP(i,0,n) #define INF 100000000 typedef long long ll; int main() { int i, n; double l, r; ll k; int L[200000]; cin >> n; rep (i,n) cin >> L[i]; cin >> k; l = 1e-10; r = 1000000000; while (l < r) { double m = (l+r) / 2; ll sum = 0; rep (i,n) sum += L[i]/m; if (sum < k) r = m-1e-11; else l = m+1e-11; } cout << fixed << setprecision(10) << r << endl; return 0; }