結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー SSRSSSRS
提出日時 2022-06-17 22:22:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 905 ms / 3,000 ms
コード長 616 bytes
コンパイル時間 1,818 ms
コンパイル使用メモリ 167,696 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 08:31:03
合計ジャッジ時間 24,269 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 161 ms
5,248 KB
testcase_02 AC 655 ms
5,248 KB
testcase_03 AC 444 ms
5,248 KB
testcase_04 AC 112 ms
5,248 KB
testcase_05 AC 569 ms
5,248 KB
testcase_06 AC 892 ms
5,248 KB
testcase_07 AC 892 ms
5,248 KB
testcase_08 AC 897 ms
5,248 KB
testcase_09 AC 895 ms
5,248 KB
testcase_10 AC 886 ms
5,248 KB
testcase_11 AC 905 ms
5,248 KB
testcase_12 AC 897 ms
5,248 KB
testcase_13 AC 889 ms
5,248 KB
testcase_14 AC 885 ms
5,248 KB
testcase_15 AC 897 ms
5,248 KB
testcase_16 AC 895 ms
5,248 KB
testcase_17 AC 901 ms
5,248 KB
testcase_18 AC 904 ms
5,248 KB
testcase_19 AC 895 ms
5,248 KB
testcase_20 AC 888 ms
5,248 KB
testcase_21 AC 900 ms
5,248 KB
testcase_22 AC 899 ms
5,248 KB
testcase_23 AC 891 ms
5,248 KB
testcase_24 AC 904 ms
5,248 KB
testcase_25 AC 905 ms
5,248 KB
testcase_26 AC 2 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//まさか
#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000001;
int main(){
  int N;
  cin >> N;
  for (int i = 0; i < N; i++){
    double T, m, L;
    cin >> T >> m >> L;
    double tv = 0, fv = 5100;
    for (int j = 0; j < 100; j++){
      double mid = (tv + fv) / 2;
      if (mid * T + mid * mid / (20 * m) <= L){
        tv = mid;
      } else {
        fv = mid;
      }
    }
    int ans = tv * 360 + eps;
    string ans2 = to_string(ans);
    while (ans2.size() < 3){
      ans2.insert(ans2.begin(), '0');
    }
    ans2.insert(ans2.end() - 2, '.');
    cout << ans2 << endl;
  }
}
0