結果
| 問題 |
No.1980 [Cherry 4th Tune D] 停止距離
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2022-08-11 01:51:58 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 600 ms / 3,000 ms |
| コード長 | 890 bytes |
| コンパイル時間 | 2,254 ms |
| コンパイル使用メモリ | 140,712 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-21 10:54:38 |
| 合計ジャッジ時間 | 17,271 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#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;
}
siman