結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 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 1 ms
4,380 KB
testcase_10 AC 56 ms
4,900 KB
testcase_11 AC 49 ms
4,684 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 55 ms
4,628 KB
testcase_15 WA -
testcase_16 AC 68 ms
4,692 KB
testcase_17 AC 56 ms
4,580 KB
testcase_18 AC 46 ms
4,376 KB
testcase_19 AC 32 ms
4,376 KB
testcase_20 AC 30 ms
4,376 KB
testcase_21 AC 44 ms
4,380 KB
testcase_22 AC 55 ms
4,624 KB
testcase_23 WA -
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];
    ll l = 0, r = 1e9;
    while(r - l > 1) {
        ll m = l + (r - l) / 2;
        ll sum = 0;
        rep(i, 0, n) sum += v[i] * m;
        if(sum >= d) r = m;
        else l = m;
    }
    cout << r << endl;
    return 0;
}
0