結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
wait_sushi
|
| 提出日時 | 2018-09-14 20:40:05 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 545 ms |
| コンパイル使用メモリ | 64,288 KB |
| 実行使用メモリ | 8,612 KB |
| 最終ジャッジ日時 | 2025-03-03 11:19:29 |
| 合計ジャッジ時間 | 7,137 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 29 |
ソースコード
#include <iostream>
#include<math.h>
using namespace std;
int N,K,i=0;
float L[300000];
void nibutan(float s,float t);
bool f(float x);
int main(){
//float s,t;
cin>>N;
for(int j=0;j<N;j++){
cin>>L[j];
}
cin>>K;
nibutan(0.000000001,1000000000);
}
void nibutan(float s,float t){
float ng = s, ok = t;
while (i<100) {
float mid = (ng + ok) / 2;
(f(mid) ? ok : ng) = mid;
// cout<<mid<<endl;
i++;
}
cout << ok << endl;
}
bool f(float x){
int s=0;
for(int j=0;j<N;j++){
s+=L[j]/x;
}
if(K>s)return true;
else return false;
}
wait_sushi