結果

問題 No.787 Mice and Traitors(ネズミ達と裏切り者)
ユーザー PachicobuePachicobue
提出日時 2019-02-08 21:46:02
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 1,972 ms
コンパイル使用メモリ 198,908 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 04:12:52
合計ジャッジ時間 2,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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