結果

問題 No.68 よくある棒を切る問題 (2)
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2017-05-24 18:45:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,321 bytes
コンパイル時間 1,633 ms
コンパイル使用メモリ 171,184 KB
実行使用メモリ 14,492 KB
最終ジャッジ日時 2023-10-19 20:07:10
合計ジャッジ時間 6,666 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/




int N, L[101010], Q;
double ans[501010];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> L[i];
    
    priority_queue<double> qu;
    rep(i, 0, N) rep(j, 0, 501010 / N + 1){
        qu.push(1.0 * L[i] / (j + 1));
    }

    rep(i, 1, 501010) {
        ans[i] = qu.top(); qu.pop();
    }

    cin >> Q;
    rep(q, 0, Q) {
        int k; cin >> k;
        printf("%.10f\n", ans[k]);
    }
}
0