結果
問題 | No.1478 Simple Sugoroku |
ユーザー |
![]() |
提出日時 | 2021-04-16 20:34:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 478 ms |
コンパイル使用メモリ | 70,180 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-02 22:56:37 |
合計ジャッジ時間 | 2,803 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <iostream>#include <iomanip>using namespace std;typedef long long ll;int main(){int n, m;cin >> n >> m;int b[100005];for(int i = 0; i < m; i++) cin >> b[i];double ans = n - 1;ll s = 0;for(int i = m - 1; i > 0; i--){s += n - b[i];ans = min(ans, b[0] - 1 + m * 1.0 / (m - i) + s * 1.0 / (m - i));}cout << fixed << setprecision(15) << ans << endl;}