結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー shoshoshomshoshoshom
提出日時 2022-06-17 21:42:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 566 ms / 3,000 ms
コード長 844 bytes
コンパイル時間 2,244 ms
コンパイル使用メモリ 194,296 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 13:18:52
合計ジャッジ時間 17,280 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 99 ms
5,376 KB
testcase_02 AC 376 ms
5,376 KB
testcase_03 AC 263 ms
5,376 KB
testcase_04 AC 70 ms
5,376 KB
testcase_05 AC 352 ms
5,376 KB
testcase_06 AC 533 ms
5,376 KB
testcase_07 AC 540 ms
5,376 KB
testcase_08 AC 544 ms
5,376 KB
testcase_09 AC 521 ms
5,376 KB
testcase_10 AC 536 ms
5,376 KB
testcase_11 AC 531 ms
5,376 KB
testcase_12 AC 537 ms
5,376 KB
testcase_13 AC 541 ms
5,376 KB
testcase_14 AC 533 ms
5,376 KB
testcase_15 AC 555 ms
5,376 KB
testcase_16 AC 548 ms
5,376 KB
testcase_17 AC 554 ms
5,376 KB
testcase_18 AC 561 ms
5,376 KB
testcase_19 AC 552 ms
5,376 KB
testcase_20 AC 548 ms
5,376 KB
testcase_21 AC 546 ms
5,376 KB
testcase_22 AC 566 ms
5,376 KB
testcase_23 AC 552 ms
5,376 KB
testcase_24 AC 558 ms
5,376 KB
testcase_25 AC 561 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

static inline void solve() {

  int T;
  cin >> T;

  for (int testcase = 1; testcase <= T; testcase++) {
    double t, m, l;
    cin >> t >> m >> l;
    double left = 0, right = 5100.0 * 1000.0 / 3600.0;
    for (int it = 0; it < 100; it++) {
      double mid = (left + right) * 0.5;
      double len = mid * t + mid * mid / (20 * m);
      if (len <= l) {
        left = mid;
      } else {
        right = mid;
      }
    }
    double ans = (left + right) * 0.5;
    long long lans = ans * 3600.0 * 0.1;
    ans = (double)lans * 0.01;
    printf("%.2lf\n", ans);
  }
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef LOCAL
  int T;
  cin >> T;
  for (int tc = 1; tc <= T; tc++) {
    cout << "Case" << tc << ":" << '\n';
    solve();
  }
#else
  solve();
#endif
  return 0;
}
0