結果

問題 No.1139 Slime Race
ユーザー Ilag
提出日時 2020-07-31 21:37:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 1,627 ms
コンパイル使用メモリ 169,176 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 16:56:16
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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;
double d,sum;

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

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

    cin>>n>>d;
    double 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=1001001001001;
    int t=1000;
    while(t--){
        double md=(ub+lb)/2.0;
        if(f(md))ub=md;
        else lb=md;
    }
    cout<<ceil(ub)<<endl;
}
0