結果
問題 | No.67 よくある棒を切る問題 (1) |
ユーザー |
![]() |
提出日時 | 2021-10-21 22:19:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 226 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 4,661 ms |
コンパイル使用メモリ | 250,288 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-03-03 11:52:37 |
合計ジャッジ時間 | 10,249 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000 int main(){ int N; cin>>N; vector<long long> L(N); rep(i,N)cin>>L[i]; long long K; cin>>K; double ok = 0.0,ng = 1e10; rep(_,100){ double mid = (ok+ng)/2; long long sum = 0LL; rep(i,N){ sum += L[i] / mid; } if(sum >= K)ok = mid; else ng = mid; } cout<<fixed<<setprecision(10)<<ok<<endl; return 0; }