結果

問題 No.1139 Slime Race
ユーザー tabae326tabae326
提出日時 2020-07-31 22:47:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 4,132 ms
コンパイル使用メモリ 166,252 KB
実行使用メモリ 4,856 KB
最終ジャッジ日時 2023-09-21 01:24:16
合計ジャッジ時間 4,165 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 69 ms
4,632 KB
testcase_11 AC 63 ms
4,624 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 68 ms
4,588 KB
testcase_15 AC 73 ms
4,380 KB
testcase_16 AC 81 ms
4,852 KB
testcase_17 AC 70 ms
4,636 KB
testcase_18 AC 56 ms
4,376 KB
testcase_19 AC 38 ms
4,376 KB
testcase_20 AC 37 ms
4,376 KB
testcase_21 AC 54 ms
4,380 KB
testcase_22 AC 68 ms
4,608 KB
testcase_23 AC 90 ms
4,592 KB
testcase_24 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll n, d;
    cin >> n >> d;
    vector<ll> x(n), v(n);
    rep(i, 0, n) cin >> x[i];
    rep(i, 0, n) cin >> v[i];
    double l = 0, r = 1e20;
    rep(itr, 0, 100) {
        double m = (l + r) / 2;
        double sum = 0;
        rep(i, 0, n) sum += v[i] * m;
        if(sum >= d) r = m;
        else l = m;
    }
    cerr << r << endl;
    cerr << r - (ll)r << endl;
    if(r - (ll)r < 1e-9) cout << (ll)r << endl;
    else cout << (ll)r + 1 << endl;
    return 0;
}
0