結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
cormoran
|
| 提出日時 | 2016-02-18 22:44:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,397 bytes |
| コンパイル時間 | 650 ms |
| コンパイル使用メモリ | 77,960 KB |
| 実行使用メモリ | 12,320 KB |
| 最終ジャッジ日時 | 2025-03-03 10:28:10 |
| 合計ジャッジ時間 | 13,270 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 29 |
ソースコード
#include<iostream>
#include<vector>
#include<cassert>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<tuple>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef ll int__;
#define rep(i,j) for(int__ i=0;i<(int__)(j);i++)
#define repeat(i,j,k) for(int__ i=(j);i<(int__)(k);i++)
#define all(v) v.begin(),v.end()
template<typename T>
ostream& operator << (ostream &os , const vector<T> &v){
rep(i,v.size()) os << v[i] << (i!=v.size()-1 ? " " : "\n"); return os;
}
template<typename T>
istream& operator >> (istream &is , vector<T> &v){
rep(i,v.size()) is >> v[i]; return is;
}
#ifdef DEBUG
void debug(){ cerr << endl; }
#endif
template<class F,class...R>
void debug(const F &car,const R&... cdr){
#ifdef DEBUG
cerr << car << " "; debug(cdr...);
#endif
}
ll calc(vector<int> &L,double len){
int ans = 0;
for(int l : L){
ans += l / len;
}
return ans;
}
bool solve(){
ll N; cin >> N;
vector<int> L(N); cin >> L;
ll K; cin >> K;
double d = 0, u = 1LL << 60;
while(u - d > 10e-10){
double m = (d + u) / 2;
if(calc(L, m) >= K) d = m;
else u = m;
}
printf("%.19f\n", d);
return false;
}
int main()
{
ios::sync_with_stdio(false);
while(solve());
return 0;
}
cormoran