結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー simansiman
提出日時 2022-08-11 01:15:34
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 1,215 ms
コンパイル使用メモリ 131,032 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 09:21:58
合計ジャッジ時間 33,832 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 235 ms
4,348 KB
testcase_02 AC 949 ms
4,348 KB
testcase_03 AC 661 ms
4,348 KB
testcase_04 AC 166 ms
4,348 KB
testcase_05 AC 851 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 1,339 ms
4,348 KB
testcase_08 AC 1,330 ms
4,348 KB
testcase_09 AC 1,334 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 1,334 ms
4,348 KB
testcase_12 AC 1,334 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 1,330 ms
4,348 KB
testcase_15 WA -
testcase_16 AC 1,370 ms
4,348 KB
testcase_17 AC 1,363 ms
4,348 KB
testcase_18 WA -
testcase_19 AC 1,366 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 1,360 ms
4,348 KB
testcase_22 WA -
testcase_23 AC 1,368 ms
4,348 KB
testcase_24 WA -
testcase_25 AC 1,362 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

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 < 200; ++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