結果

問題 No.1139 Slime Race
ユーザー tabae326tabae326
提出日時 2020-07-31 22:43:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 519 bytes
コンパイル時間 1,481 ms
コンパイル使用メモリ 167,848 KB
実行使用メモリ 12,048 KB
最終ジャッジ日時 2023-09-21 01:18:33
合計ジャッジ時間 8,237 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

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;
    while(r - l > 1) {
        ll m = l + (r - l) / 2;
        double sum = 0;
        rep(i, 0, n) sum += v[i] * m;
        if(sum >= d) r = m;
        else l = m;
    }
    cout << (ll)r << endl;
    return 0;
}
0