結果
問題 |
No.67 よくある棒を切る問題 (1)
|
ユーザー |
![]() |
提出日時 | 2016-04-29 21:37:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 508 ms |
コンパイル使用メモリ | 68,324 KB |
実行使用メモリ | 8,608 KB |
最終ジャッジ日時 | 2025-03-03 10:34:17 |
合計ジャッジ時間 | 5,457 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 RE * 22 |
ソースコード
#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[100000]; 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; }