結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー simansiman
提出日時 2022-08-11 01:51:58
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 598 ms / 3,000 ms
コード長 890 bytes
コンパイル時間 3,961 ms
コンパイル使用メモリ 131,404 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-21 09:49:48
合計ジャッジ時間 17,309 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 102 ms
4,348 KB
testcase_02 AC 411 ms
4,348 KB
testcase_03 AC 280 ms
4,348 KB
testcase_04 AC 73 ms
4,348 KB
testcase_05 AC 361 ms
4,348 KB
testcase_06 AC 564 ms
4,348 KB
testcase_07 AC 566 ms
4,348 KB
testcase_08 AC 569 ms
4,348 KB
testcase_09 AC 564 ms
4,348 KB
testcase_10 AC 566 ms
4,348 KB
testcase_11 AC 564 ms
4,348 KB
testcase_12 AC 565 ms
4,348 KB
testcase_13 AC 564 ms
4,348 KB
testcase_14 AC 563 ms
4,348 KB
testcase_15 AC 562 ms
4,348 KB
testcase_16 AC 593 ms
4,348 KB
testcase_17 AC 593 ms
4,348 KB
testcase_18 AC 591 ms
4,348 KB
testcase_19 AC 587 ms
4,348 KB
testcase_20 AC 590 ms
4,348 KB
testcase_21 AC 595 ms
4,348 KB
testcase_22 AC 598 ms
4,348 KB
testcase_23 AC 590 ms
4,348 KB
testcase_24 AC 596 ms
4,352 KB
testcase_25 AC 591 ms
4,352 KB
testcase_26 AC 2 ms
4,352 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;

ll to_ll(string str){
  int len = str.length();
  return stol(str.substr(0, len - 3)) * 100+(str[len - 2] - '0') * 10 + (str[len - 1] - '0');
}

int main() {
  int N;
  cin >> N;

  for (int i = 0; i < N; ++i) {
    string T, U, L;
    cin >> T >> U >> L;

    ll ok = 0;
    ll ng = 520000;
    ll t = to_ll(T);
    ll u = to_ll(U);
    ll l = to_ll(L);

    while (abs(ok - ng) >= 2) {
      ll v = (ok + ng) / 2;
      ll len = v * (25 * v + 18 * t * u);

      if (len <= l * 6480 * u) {
        ok = v;
      } else {
        ng = v;
      }
    }

    cout << fixed << setprecision(2) << floor(100 * ok) / 10000 << endl;
  }

  return 0;
}
0