結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
to10to10to10to
|
| 提出日時 | 2019-04-09 16:43:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 655 bytes |
| コンパイル時間 | 1,560 ms |
| コンパイル使用メモリ | 162,544 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-03 11:24:23 |
| 合計ジャッジ時間 | 6,470 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
int N,K;
double L[200010];
bool C(double x){//長さxの紐をK本作れるか
int ret = 0;
rep(i,N){
ret += floor(L[i]/x);
}
return ret >= K;
}
int main(){
cin >> N;
rep(i,N){
cin >> L[i];
}
cin >> K;
double ok = 0, ng = 1000000000;
while(!(ng-ok <= 1e-9 || ng-ok <= ok*1e-9)){
double mid = (ok+ng)/2;
if(C(mid)){
ok = mid;
}else{
ng = mid;
}
}
cout << fixed << setprecision(10) << ok << endl;
}
to10to10to10to