結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-25 23:39:31
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 849 bytes
コンパイル時間 808 ms
コンパイル使用メモリ 85,768 KB
実行使用メモリ 5,152 KB
最終ジャッジ日時 2023-09-06 04:44:36
合計ジャッジ時間 4,751 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
5,096 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 69 ms
4,956 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 89 ms
5,152 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 61 ms
4,800 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 75 ms
4,812 KB
testcase_16 AC 66 ms
5,096 KB
testcase_17 AC 65 ms
5,144 KB
testcase_18 AC 65 ms
5,108 KB
testcase_19 AC 86 ms
5,124 KB
testcase_20 AC 85 ms
5,112 KB
testcase_21 AC 86 ms
4,944 KB
testcase_22 AC 59 ms
4,836 KB
testcase_23 AC 62 ms
4,936 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>

using namespace std;



int main(){
   int N;
   cin >> N;
   long long L[N];
   for(int i=0;i<N;i++)cin>>L[i];
   long long K;
   cin >> K;
   double left=0;
   double right=1e9;
   while(left*(1+1e-9)<right&&left+1e-9<right){
      double mid=(left+right)/2;
      int cnt = 0;
      for( int i = 0 ; i < N; i++ ){
         cnt += (int) (L[i]/mid);
      }
      if( cnt >= K) {
         left = mid;
      }
      else{
         right = mid;
      }
   }

   printf("%.10f\n",left);
   return 0;
}
0