結果
| 問題 | No.68 よくある棒を切る問題 (2) | 
| コンテスト | |
| ユーザー |  184 | 
| 提出日時 | 2014-11-16 23:57:08 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 589 bytes | 
| コンパイル時間 | 802 ms | 
| コンパイル使用メモリ | 63,040 KB | 
| 実行使用メモリ | 17,992 KB | 
| 最終ジャッジ日時 | 2024-12-31 22:56:10 | 
| 合計ジャッジ時間 | 67,735 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 10 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
using namespace std;
typedef long long ll;
int main()
{
	int n, q;
	cin >> n;
	vector<int> l(n);
	rep(i,n) cin >> l[i];
	cin >> q;
	vector<int> k(q);
	rep(i,q) cin >> k[i];
	
	rep(j,q){
		double hi=1e9+1, lw=0;
		rep(xx,120){
	  	double md= (hi + lw) /2.0;
			ll w=0;
			rep(zz,n){
				w += l[zz] / md;
			}
			if(w >=k[j]) lw=md; else hi=md;
		}
		printf("%.12f\n",lw);
	}
	
	return 0;
}
            
            
            
        