結果

問題 No.68 よくある棒を切る問題 (2)
ユーザー はまやんはまやん
提出日時 2017-05-24 18:52:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 660 ms / 5,000 ms
コード長 1,323 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 173,584 KB
実行使用メモリ 69,356 KB
最終ジャッジ日時 2024-09-19 16:24:49
合計ジャッジ時間 13,934 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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, 500000 / (i + 1)){
        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