結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2024-11-06 21:10:56 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,148 bytes |
| コンパイル時間 | 3,240 ms |
| コンパイル使用メモリ | 276,004 KB |
| 実行使用メモリ | 20,400 KB |
| 最終ジャッジ日時 | 2025-03-03 12:15:31 |
| 合計ジャッジ時間 | 16,086 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 29 |
ソースコード
#include <bits/stdc++.h>
// #include<bits/extc++.h>
#define endl '\n'
#define eps 1e-16
#define pb push_back
#define eb emplace_back
#define debug(x) cerr<<#x<<": "<<x<<'\n';
// using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair <ll,ll>;
using pii = pair <int,int>;
using ull = unsigned long long;
const int N = 1e6 + 5, MOD = 1e9 + 7;
mt19937_64 rnd (chrono::steady_clock::now().time_since_epoch().count());
int n;
ll k, a[N];
bool ck(ld x)
{
ll have = 0;
if(x-0<eps) return true;
for(int i=1;i<=n;i++) have += (ll)floor(a[i]*1.0/x);
return have >= k;
}
void isac()
{
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
cin>>k;
ld l = eps, r = 1e10;
while(l+eps<r)
{
ld mid = (l + r)/2;
if(ck(mid)) l = mid;
else r = mid;
}
cout<<fixed<<setprecision(15)<<l<<'\n';
}
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T = 1;
// cin >> T;
while (T--) isac();
return 0;
}
/*
Zena youth together.
Such a pretty name.
There will be a long story.
Time will tell all.
*/
vjudge1