結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
コンテスト
ユーザー SSRS
提出日時 2022-06-17 22:22:13
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 817 ms / 3,000 ms
+ 601µs
コード長 616 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,084 ms
コンパイル使用メモリ 183,156 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-10-20 05:36:41
合計ジャッジ時間 27,994 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

//まさか
#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