結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー umimelumimel
提出日時 2022-06-18 13:15:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 185 ms / 3,000 ms
コード長 833 bytes
コンパイル時間 1,741 ms
コンパイル使用メモリ 166,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 08:26:06
合計ジャッジ時間 8,277 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 31 ms
5,376 KB
testcase_02 AC 126 ms
5,376 KB
testcase_03 AC 87 ms
5,376 KB
testcase_04 AC 26 ms
5,376 KB
testcase_05 AC 111 ms
5,376 KB
testcase_06 AC 176 ms
5,376 KB
testcase_07 AC 181 ms
5,376 KB
testcase_08 AC 177 ms
5,376 KB
testcase_09 AC 179 ms
5,376 KB
testcase_10 AC 185 ms
5,376 KB
testcase_11 AC 180 ms
5,376 KB
testcase_12 AC 181 ms
5,376 KB
testcase_13 AC 178 ms
5,376 KB
testcase_14 AC 181 ms
5,376 KB
testcase_15 AC 178 ms
5,376 KB
testcase_16 AC 179 ms
5,376 KB
testcase_17 AC 178 ms
5,376 KB
testcase_18 AC 175 ms
5,376 KB
testcase_19 AC 178 ms
5,376 KB
testcase_20 AC 172 ms
5,376 KB
testcase_21 AC 175 ms
5,376 KB
testcase_22 AC 175 ms
5,376 KB
testcase_23 AC 176 ms
5,376 KB
testcase_24 AC 175 ms
5,376 KB
testcase_25 AC 176 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)

ll solve(){
    string _T, _u, _L;
    cin >> _T >> _u >> _L;
    _T.erase(find(_T.begin(), _T.end(), '.'));
    _u.erase(find(_u.begin(), _u.end(), '.'));
    _L.erase(find(_L.begin(), _L.end(), '.'));

    ll t = stoi(_T);
    ll u = stoi(_u);
    ll l = stoi(_L);

    ll lo = 0;
    ll hi = 18360000;
    ll mid;
    while(hi - lo > 1){
        mid = (lo + hi)/2;
        if(100LL*mid*mid+72LL*u*t*mid > 20LL*36LL*36LL*u*l) hi = mid;
        else lo = mid;
    }
    
    return lo;
}

int main(){
    ll n;
    cin >> n;

    vector<ll> ans(n);
    rep(i, n) ans[i] = solve();
    rep(i, n) printf("%lld.%02lld\n", ans[i]/100, ans[i]%100);
}
0