結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2018-05-30 16:31:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 603 bytes |
| コンパイル時間 | 1,424 ms |
| コンパイル使用メモリ | 163,988 KB |
| 実行使用メモリ | 12,704 KB |
| 最終ジャッジ日時 | 2025-03-03 11:12:58 |
| 合計ジャッジ時間 | 14,196 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 29 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
15 | main(){
| ^~~~
ソースコード
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
double INF = 1e30;
double EPS = 1e-10;
int MOD = 1e9+7;
ll countup(double len,vector<int> &V){
ll cnt = 0;
for(auto i:V){
cnt += floor(1.*i / len);
}
return cnt;
}
main(){
ll N,K;
cin >> N;
vector<int> V(N);
rep(i,N)cin >> V[i];
cin >> K;
double ok = EPS,ng = INF;
while(abs(ok - ng) > EPS){
double mid = (ok + ng) / 2;
if(countup(mid,V) >= K)ok = mid;
else ng = mid;
}
printf("%.9lf\n",ok);
}
Bantako