結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー simansiman
提出日時 2022-08-11 01:14:19
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 1,476 ms
コンパイル使用メモリ 141,820 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-21 10:25:05
合計ジャッジ時間 28,414 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <climits>
#include <map>
#include <queue>
#include <set>
#include <cstring>
#include <vector>

using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;

  for (int i = 0; i < N; ++i) {
    double T, u, L;
    cin >> T >> u >> L;

    double ok = 0.0;
    double ng = 5200;

    for (int i = 0; i < 100; ++i) {
      double v = (ok + ng) / 2.0;
      double l = v * T + (v * v) / (20 * u);

      if (l <= L) {
        ok = v;
      } else {
        ng = v;
      }
    }

    double ans = 3600 * ok / 1000;
    cout << fixed << setprecision(2) << floor(100 * ans) / 100 << endl;
  }

  return 0;
}
0