結果

問題 No.68 よくある棒を切る問題 (2)
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2017-05-24 18:50:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 1,316 bytes
コンパイル時間 3,040 ms
コンパイル使用メモリ 174,552 KB
実行使用メモリ 814,744 KB
最終ジャッジ日時 2023-10-19 20:10:34
合計ジャッジ時間 6,951 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> L[i];
    sort(L, L + N, greater<int>());
    
    vector<double> qu;
    rep(i, 0, N) rep(j, 0, 50000 - i){
        qu.push_back(1.0 * L[i] / (j + 1));
    }

    sort(qu.begin(), qu.end(), greater<double>());

    cin >> Q;
    rep(q, 0, Q) {
        int k; cin >> k;
        printf("%.12f\n", qu[k - 1]);
    }
}
0