結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー 👑 KazunKazun
提出日時 2022-03-15 03:38:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 831 bytes
コンパイル時間 776 ms
コンパイル使用メモリ 75,912 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-17 12:22:56
合計ジャッジ時間 21,289 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 204 ms
5,376 KB
testcase_02 AC 857 ms
5,376 KB
testcase_03 AC 587 ms
5,376 KB
testcase_04 AC 146 ms
5,376 KB
testcase_05 AC 750 ms
5,376 KB
testcase_06 AC 1,142 ms
5,376 KB
testcase_07 AC 1,188 ms
5,376 KB
testcase_08 AC 1,191 ms
5,376 KB
testcase_09 AC 1,183 ms
5,376 KB
testcase_10 AC 1,159 ms
5,376 KB
testcase_11 AC 1,173 ms
5,376 KB
testcase_12 AC 1,168 ms
5,376 KB
testcase_13 AC 1,162 ms
5,376 KB
testcase_14 AC 1,172 ms
5,376 KB
testcase_15 AC 1,180 ms
5,376 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>

using namespace std;
using ll=long long;

ll to_long_long(string X){
    int n=X.length();
    return stol(X.substr(0,n-3))*100+(X[n-2]-'0')*10+(X[n-1]-'0');
}

bool check(ll V, ll T, ll mu, ll L){return V*(25*V+18*T*mu)<=(ll)6480*mu*L;}

string answer(int V){
    int x=V/100, y=V%100;
    int a=y/10, b=V%10;
    return to_string(x)+"."+to_string(a)+to_string(b);
}

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

    string t,m,l;
    ll T,mu,L;
    int V;

    int N; cin >> N;


    while (N){
        cin >> t >> m >> l;
        T=to_long_long(t);
        mu=to_long_long(m);
        L=to_long_long(l);

        V=0;
        while (check(V+1,T,mu,L)) {V++;}
        cout << answer(V) << "\n";

        N--;
    }

    return 0;
}
0