結果
| 問題 | No.67 よくある棒を切る問題 (1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-18 01:22:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 192 ms / 5,000 ms |
| コード長 | 610 bytes |
| 記録 | |
| コンパイル時間 | 1,038 ms |
| コンパイル使用メモリ | 214,864 KB |
| 実行使用メモリ | 9,264 KB |
| 最終ジャッジ日時 | 2026-07-06 19:07:19 |
| 合計ジャッジ時間 | 7,100 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N; cin >> N;
using ld = long double;
vector<ld> L(N);
rep(i,N) cin >> L[i];
ll K; cin >> K;
auto f = [&](ld x) {
ll cnt = 0;
rep(i,N) cnt += floorl(L[i] / x);
return K <= cnt;
};
ld ok = 0.0, ng = 1e18;
int step = 100;
rep(_,step) {
ld mid = (ok + ng) * 0.5;
(f(mid) ? ok : ng) = mid;
}
cout << fixed << setprecision(20) << ok << endl;
}