結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2022-12-20 19:16:19 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 675 bytes |
| コンパイル時間 | 1,387 ms |
| コンパイル使用メモリ | 149,888 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-03-03 12:05:10 |
| 合計ジャッジ時間 | 29,005 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
using namespace std;
long long N, K;
vector<long double> L;
bool solve(long double X){
long long cnt=0;
for (int i=0; i<N; i++) cnt += floor(L[i]/X);
return cnt >= K;
}
int main(){
cin >> N;
L.resize(N);
for (int i=0; i<N; i++) cin >> L[i];
cin >> K;
long double l=0, r=1e9, c;
for (int i=0; i<50; i++){
c = (l+r)/2;
if (solve(c)) l=c;
else r=c;
}
cout << setprecision(18) << l << endl;
return 0;
}
srjywrdnprkt