結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 146 ms
5,376 KB
testcase_02 AC 609 ms
5,376 KB
testcase_03 AC 422 ms
5,376 KB
testcase_04 AC 103 ms
5,376 KB
testcase_05 AC 543 ms
5,376 KB
testcase_06 AC 869 ms
5,376 KB
testcase_07 AC 856 ms
5,376 KB
testcase_08 AC 832 ms
5,376 KB
testcase_09 AC 884 ms
5,376 KB
testcase_10 AC 857 ms
5,376 KB
testcase_11 AC 830 ms
5,376 KB
testcase_12 AC 834 ms
5,376 KB
testcase_13 AC 834 ms
5,376 KB
testcase_14 AC 835 ms
5,376 KB
testcase_15 AC 869 ms
5,376 KB
testcase_16 AC 830 ms
5,376 KB
testcase_17 AC 839 ms
5,376 KB
testcase_18 AC 871 ms
5,376 KB
testcase_19 AC 855 ms
5,376 KB
testcase_20 AC 861 ms
5,376 KB
testcase_21 AC 847 ms
5,376 KB
testcase_22 AC 847 ms
5,376 KB
testcase_23 AC 837 ms
5,376 KB
testcase_24 AC 953 ms
5,376 KB
testcase_25 AC 924 ms
5,376 KB
testcase_26 AC 3 ms
5,376 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