結果

問題 No.787 Mice and Traitors(ネズミ達と裏切り者)
ユーザー Pachicobue
提出日時 2019-02-08 21:46:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 1,660 ms
コンパイル使用メモリ 193,052 KB
最終ジャッジ日時 2025-01-06 20:55:59
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
template <typename T>
constexpr T MOD() { return 1000000007; }
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 16; }
int main()
{
    ld P, Q;
    std::cin >> P >> Q;
    std::cout << std::fixed << std::setprecision(20);
    if (P != 100 and P != 0 and Q != 100 and Q != 0) {
        P = 100 / P - 1, Q = 100 / Q - 1;
        std::cout << 100 / (1 + P * Q) << std::endl;
    } else if (P == 100 or Q == 100) {
        std::cout << 100 << std::endl;
    } else if (P == 0 or Q == 0) {
        std::cout << 0 << std::endl;
    } else {
    }
    return 0;
}
0