結果

問題 No.1478 Simple Sugoroku
ユーザー dekomori_sanaedekomori_sanae
提出日時 2021-09-17 15:44:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 1,154 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 84,028 KB
実行使用メモリ 4,744 KB
最終ジャッジ日時 2023-09-12 04:22:33
合計ジャッジ時間 5,124 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 40 ms
4,608 KB
testcase_14 AC 39 ms
4,652 KB
testcase_15 AC 40 ms
4,608 KB
testcase_16 AC 40 ms
4,728 KB
testcase_17 AC 39 ms
4,560 KB
testcase_18 AC 39 ms
4,556 KB
testcase_19 AC 40 ms
4,744 KB
testcase_20 AC 40 ms
4,560 KB
testcase_21 AC 39 ms
4,564 KB
testcase_22 AC 40 ms
4,616 KB
testcase_23 AC 40 ms
4,744 KB
testcase_24 AC 40 ms
4,696 KB
testcase_25 AC 40 ms
4,612 KB
testcase_26 AC 39 ms
4,656 KB
testcase_27 AC 40 ms
4,560 KB
testcase_28 AC 28 ms
4,628 KB
testcase_29 AC 31 ms
4,564 KB
testcase_30 AC 31 ms
4,712 KB
testcase_31 AC 31 ms
4,744 KB
testcase_32 AC 32 ms
4,744 KB
testcase_33 AC 34 ms
4,620 KB
testcase_34 AC 33 ms
4,564 KB
testcase_35 AC 34 ms
4,676 KB
testcase_36 AC 35 ms
4,620 KB
testcase_37 AC 37 ms
4,560 KB
testcase_38 AC 37 ms
4,560 KB
testcase_39 AC 37 ms
4,716 KB
testcase_40 AC 36 ms
4,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
  
int main() {
    ll n, m;
    cin >> n >> m;

    vl b(m);
    rep(i, m) {
        cin >> b[i];
    }
    vl c(m+1);
    rep(i, m) {
        c[i+1] = c[i] + b[m - 1 - i];
    }

    double ans = n-1;
    exrep(i, 1, m) {
        double x = b[0] - 1 + ((double)m / (double)i) + n - ((double)c[i] / (double)i);
        chmin(ans, x);
    }

    exout(ans);
    re0;
}
0