結果

問題 No.1807 UMA Gacha
ユーザー 👑 Nachia
提出日時 2022-01-14 21:21:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 632 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 73,412 KB
最終ジャッジ日時 2025-01-27 10:49:13
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using i32 = int;
using u32 = unsigned int;
#define rep(i,n) for(int i=0; i<(n); i++)


int main() {
    int N; cin >> N;
    double P; cin >> P;
    if(N >= 200){ cout << "1" << endl; return 0; }
    double ans = 1.0;
    rep(i,N) ans *= (1 - P);
    cout.precision(10);
    cout << fixed;
    cout << (1.0 - ans) << endl;
    return 0;
}



struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0