結果

問題 No.1139 Slime Race
ユーザー IlagIlag
提出日時 2020-07-31 21:46:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 1,394 ms
コンパイル使用メモリ 165,636 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 22:43:00
合計ジャッジ時間 2,928 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 18 ms
4,376 KB
testcase_11 AC 17 ms
4,376 KB
testcase_12 AC 21 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 18 ms
4,380 KB
testcase_15 AC 18 ms
4,380 KB
testcase_16 AC 21 ms
4,380 KB
testcase_17 AC 18 ms
4,380 KB
testcase_18 AC 15 ms
4,380 KB
testcase_19 AC 11 ms
4,376 KB
testcase_20 AC 11 ms
4,380 KB
testcase_21 AC 15 ms
4,376 KB
testcase_22 AC 18 ms
4,380 KB
testcase_23 AC 23 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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;
long double sum=0;

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

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

    cin>>n>>d;
    for(int i=0,x;i<n;i++)cin>>x;
    for(int i=0,u;i<n;i++)cin>>u,sum+=u;
    long double lb=-1,ub=1001001001;
    int t=10000;
    while(t--){
        long double md=(lb+ub)/2.0;
        if(f(md))ub=md;
        else lb=md;
    }
    cout<<ceil(ub)<<endl;
}
0