結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
shoshosho
|
| 提出日時 | 2020-02-14 15:10:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 627 bytes |
| コンパイル時間 | 2,238 ms |
| コンパイル使用メモリ | 161,212 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-03 11:31:13 |
| 合計ジャッジ時間 | 6,452 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 10 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const int INF = 1000000;
const double PI=3.14159265359;
int main(){
ll n;cin>>n;
ll l[n];rep(i,0,n)cin>>l[i];
ll k;cin>>k;
lb ok=0,ng=1e6;
while(ng-ok>1e-12){
lb mid=(ok+ng)/2;
ll sum=0;
rep(i,0,n)sum+=l[i]/mid;
if(sum>=k)ok=mid;
else ng=mid;
}
out(setprecision(12)<<ok);
return 0;
}
shoshosho