結果
| 問題 |
No.1980 [Cherry 4th Tune D] 停止距離
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-17 22:22:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 7,574 bytes |
| コンパイル時間 | 992 ms |
| コンパイル使用メモリ | 116,808 KB |
| 最終ジャッジ日時 | 2025-01-29 22:13:46 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 24 |
ソースコード
#ifndef ONLINE_JUDGE
#define DEBUG 1
#if DEBUG
#define _GLIBCXX_DEBUG
#endif
#endif
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <ratio>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
using tll = tuple<ll, ll, ll>;
using vtll = vector<tll>;
using vvtll = vector<vtll>;
using t4ll = tuple<ll, ll, ll, ll>;
using vt4ll = vector<t4ll>;
using vvt4ll = vector<vt4ll>;
#define CERR cerr
#define all(v) (v).begin(), (v).end()
#define get_fifth(first, second, third, fourth, fifth, ...) fifth
#define rep1(i, n) rep2 (i, 0, (ll)(n))
#define rep2(i, m, n) rep3 (i, (ll)(m), (ll)(n), 1)
#define rep3(i, m, n, d) for (ll i = (ll)(m); i < (ll)(n); i += (ll)(d))
#define rep(...) get_fifth(__VA_ARGS__, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(i, m) rrep2 (i, (ll)(m), -1)
#define rrep2(i, m, n) rrep3 (i, (ll)(m), (ll)(n), -1)
#define rrep3(i, m, n, d) for (ll i = (ll)(m); i > (ll)(n); i += (ll)(d))
#define rrep(...) get_fifth(__VA_ARGS__, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define PI 3.1415926535897932384626433832795028841971693993751L
#define INF 2222222222222222222LL
//---------------------------------------------------------
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& v)
{
os << v.first << ' ' << v.second;
return os;
}
template <typename T1, typename T2, typename T3>
ostream& operator<<(ostream& os, const tuple<T1, T2, T3>& v)
{
os << get<0>(v) << ' ' << get<1>(v) << ' ' << get<2>(v);
return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
for (auto it = v.begin(); it != v.end(); it++) {
if (it != v.begin()) {
os << ' ';
}
os << *it;
}
return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
for (auto it = v.begin(); it != v.end(); it++) {
if (it != v.begin()) {
os << ' ';
}
os << *it;
}
return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& v)
{
for (auto it = v.begin(); it != v.end(); it++) {
if (it != v.begin()) {
os << ' ';
}
os << *it;
}
return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const map<T1, T2>& v)
{
os << '{';
for (auto it = v.begin(); it != v.end(); it++) {
if (it != v.begin()) {
os << ", ";
}
os << it->first << ':' << it->second;
}
os << '}';
return os;
}
ll divup(ll nume, ll deno)
{
assert(nume >= 0);
assert(deno > 0);
return (nume + deno - 1) / deno;
}
void Yes(void)
{
cout << "Yes\n";
}
void No(void)
{
cout << "No\n";
}
void YES(void)
{
cout << "YES\n";
}
void NO(void)
{
cout << "NO\n";
}
void YesNo(bool cond)
{
cond ? Yes() : No();
}
void YESNO(bool cond)
{
cond ? YES() : NO();
}
template <typename T>
bool chmax(T& a, const T& b)
{
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T>
bool chmin(T& a, const T& b)
{
if (a > b) {
a = b;
return true;
}
return false;
}
template <typename T>
void vin(vector<T>& v)
{
ll len = v.size();
rep (i, len) {
cin >> v[i];
}
}
void in() {}
template <typename Head, typename... Tail>
void in(Head& h, Tail&... t)
{
cin >> h;
in(t...);
}
void print() {}
template <typename Head, typename... Tail>
void print(Head&& h, Tail&&... t)
{
cout << h;
if (sizeof...(t) != 0) {
cout << ' ';
}
else {
cout << '\n';
}
print(t...);
}
//---------------------------------------------------------
#if DEBUG
#define dump(...) dump_1(__LINE__, __func__, #__VA_ARGS__, __VA_ARGS__)
#else
#define dump(...)
#endif
void dump_2() {}
template <typename Head, typename... Tail>
void dump_2(Head&& h, Tail&&... t)
{
CERR << h;
if (sizeof...(t) != 0) {
CERR << ", ";
}
else {
CERR << '\n';
}
dump_2(t...);
}
template <typename... Tail>
void dump_1(const int line, const char* func, const char* name, Tail&&... t)
{
CERR << '[' << func << ':' << line << "] " << name << " => ";
dump_2(t...);
}
//---------------------------------------------------------
const ll mod = 1000000007LL; // 10**9 + 7
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) % mod) {}
mint& operator+=(const mint a)
{
if ((x += a.x) >= mod) x -= mod;
return *this;
}
mint& operator-=(const mint a)
{
if ((x += mod - a.x) >= mod) x -= mod;
return *this;
}
mint& operator*=(const mint a)
{
(x *= a.x) %= mod;
return *this;
}
mint operator+(const mint a) const
{
mint res(*this);
return res += a;
}
mint operator-(const mint a) const
{
mint res(*this);
return res -= a;
}
mint operator*(const mint a) const
{
mint res(*this);
return res *= a;
}
mint pow(ll t) const
{
if (!t) return 1;
mint a = pow(t >> 1);
a *= a;
if (t & 1) a *= *this;
return a;
}
// for prime mod
mint inv() const
{
return pow(mod - 2);
}
mint& operator/=(const mint a)
{
return (*this) *= a.inv();
}
mint operator/(const mint a) const
{
mint res(*this);
return res /= a;
}
friend istream& operator>>(istream& is, mint& v)
{
is >> v.x;
return is;
}
friend ostream& operator<<(ostream& os, const mint& v)
{
os << v.x;
return os;
}
};
//---------------------------------------------------------
struct mintcomb {
vector<mint> fact, ifact;
mintcomb(int n) : fact(n + 1), ifact(n + 1)
{
assert(n < mod);
fact[0] = 1;
for (int i = 1; i <= n; ++i) {
fact[i] = fact[i - 1] * i;
}
ifact[n] = fact[n].inv();
for (int i = n; i >= 1; --i) {
ifact[i - 1] = ifact[i] * i;
}
}
mint permutation(int n, int k)
{
if (k < 0 || k > n) return 0;
return fact[n] * ifact[n - k];
}
mint combination(int n, int k)
{
if (k < 0 || k > n) return 0;
return fact[n] * ifact[k] * ifact[n - k];
}
};
//---------------------------------------------------------
ld S(ld v, ld t, ld m)
{
return v * t + v * v / (20.0 * m);
}
void solve()
{
ld T, M, L;
in(T, M, L);
ld lo = 0;
ld hi = 510100;
while (lo + 1e-9 < hi) {
ld mid = (lo + hi) / 2.0;
ld s = S(mid, T, M);
if (s <= L) {
lo = mid;
}
else {
hi = mid;
}
}
ll ans = floor((lo + 1e-7) * 60 * 60 / 10);
printf("%lld.%02lld\n", ans / 100, ans % 100);
}
//---------------------------------------------------------
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(16);
cerr << fixed << setprecision(16);
ll t = 1;
in(t);
rep (i, t) {
solve();
}
}