結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー hamuhei4869hamuhei4869
提出日時 2022-03-24 03:32:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,575 bytes
コンパイル時間 1,429 ms
コンパイル使用メモリ 162,284 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 12:23:28
合計ジャッジ時間 17,707 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 110 ms
5,376 KB
testcase_02 AC 442 ms
5,376 KB
testcase_03 AC 309 ms
5,376 KB
testcase_04 AC 78 ms
5,376 KB
testcase_05 AC 388 ms
5,376 KB
testcase_06 AC 617 ms
5,376 KB
testcase_07 AC 610 ms
5,376 KB
testcase_08 AC 615 ms
5,376 KB
testcase_09 AC 623 ms
5,376 KB
testcase_10 AC 609 ms
5,376 KB
testcase_11 AC 615 ms
5,376 KB
testcase_12 AC 606 ms
5,376 KB
testcase_13 AC 620 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 608 ms
5,376 KB
testcase_16 AC 623 ms
5,376 KB
testcase_17 AC 608 ms
5,376 KB
testcase_18 AC 616 ms
5,376 KB
testcase_19 AC 609 ms
5,376 KB
testcase_20 AC 606 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 616 ms
5,376 KB
testcase_23 AC 615 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 617 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:51:17: warning: integer constant is too large for its type
   51 |         ll ng = 100000000000000000000000000000;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = __int128_t;

std::ostream &operator<<(std::ostream &dest, __int128_t value) {
  std::ostream::sentry s(dest);
  if (s) {
    __uint128_t tmp = value < 0 ? -value : value;
    char buffer[128];
    char *d = std::end(buffer);
    do {
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    } while (tmp != 0);
    if (value < 0) {
      --d;
      *d = '-';
    }
    int len = std::end(buffer) - d;
    if (dest.rdbuf()->sputn(d, len) != len) {
      dest.setstate(std::ios_base::badbit);
    }
  }
  return dest;
}

__int128 parse(string &s) {
  __int128 ret = 0;
  for (int i = 0; i < s.length(); i++)
    if ('0' <= s[i] && s[i] <= '9')
      ret = 10 * ret + s[i] - '0';
  return ret;
}

int main(){
    int N;cin >> N;
    while(N--){
        string _T, _u, _L;
        cin >> _T >> _u >> _L;
        _T.erase(find(_T.begin(), _T.end(), '.'));
        _u.erase(find(_u.begin(), _u.end(), '.'));
        _L.erase(find(_L.begin(), _L.end(), '.'));

        ll T = stoi(_T);
        ll u = stoi(_u);
        ll L = stoi(_L);

        ll ok = 0;
        ll ng = 100000000000000000000000000000;
        while(ng - ok > 1){
            ll mid = (ok + ng) / 2;
            if(L * (20 * u) * 1000000000000 >= mid * T * (20 * u) * 10000 + mid * mid){
                ok = mid;
            }else{
                ng = mid;
            }
        }
        ll V = ok * 3600;
        //cout<<V<<endl;
        long long _V = V / 1000000000;
        printf("%lld.%02lld\n", _V / 100, _V % 100);
    }
    return 0;
}
0