結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 95 ms
5,376 KB
testcase_02 AC 403 ms
5,376 KB
testcase_03 AC 261 ms
5,376 KB
testcase_04 AC 69 ms
5,376 KB
testcase_05 AC 342 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 535 ms
5,376 KB
testcase_08 AC 511 ms
5,376 KB
testcase_09 AC 543 ms
5,376 KB
testcase_10 AC 521 ms
5,376 KB
testcase_11 AC 530 ms
5,376 KB
testcase_12 AC 540 ms
5,376 KB
testcase_13 AC 519 ms
5,376 KB
testcase_14 AC 530 ms
5,376 KB
testcase_15 AC 529 ms
5,376 KB
testcase_16 AC 550 ms
5,376 KB
testcase_17 AC 554 ms
5,376 KB
testcase_18 AC 533 ms
5,376 KB
testcase_19 AC 542 ms
5,376 KB
testcase_20 AC 526 ms
5,376 KB
testcase_21 AC 551 ms
5,376 KB
testcase_22 AC 548 ms
5,376 KB
testcase_23 AC 541 ms
5,376 KB
testcase_24 AC 555 ms
5,376 KB
testcase_25 AC 535 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 / 1000.0 * 100;
    ans = 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