結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー | goodbaton |
提出日時 | 2015-07-31 20:19:02 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,004 bytes |
コンパイル時間 | 524 ms |
コンパイル使用メモリ | 71,428 KB |
実行使用メモリ | 12,612 KB |
最終ジャッジ日時 | 2023-09-24 22:38:18 |
合計ジャッジ時間 | 14,055 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
ソースコード
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <cstring> typedef long long ll; using namespace std; #define mod 1000000009 #define INF 10000000 #define LLINF 2000000000000000000LL #define SIZE 10001 int n,l[200000]; bool check(double p,int k){ ll cc=0; for(int i=0;i<n;i++) cc+=(int)(l[i]/p); return cc>=k; } int main(){ int q,k; scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&l[i]); scanf("%d",&q); double l=0,r=1e9,mid; for(int i=0;i<q;i++){ scanf("%d",&k); l=0; r=1e9; for(int i=0;i<100;i++){ mid = (l+r)/2; if(check(mid,k)){ l = mid; }else{ r = mid; } } printf("%.10lf\n",mid); } return 0; }