結果

問題 No.1139 Slime Race
ユーザー IlagIlag
提出日時 2020-07-31 21:32:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 2,204 ms
コンパイル使用メモリ 165,480 KB
実行使用メモリ 11,484 KB
最終ジャッジ日時 2023-09-20 21:55:40
合計ジャッジ時間 6,923 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,568 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 TLE -
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;
using ll = long long;
using P = pair<int, int>;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;

ll n,d,sum;

double f(double x){
    return (x*sum>=d);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin>>n>>d;
    ll x[n],u[n];
    for(int i=0;i<n;i++)cin>>x[i];
    for(int i=0;i<n;i++)cin>>u[i],sum+=u[i];
    double lb=0,ub=1001001001;
    while(ub-lb>EPS){
        double md=(ub+lb)/2;
        if(f(md))ub=md;
        else lb=md;
    }
    cout<<ceil(ub)<<endl;
}
0