結果
問題 |
No.159 刺さらないUSB
|
ユーザー |
![]() |
提出日時 | 2019-12-07 03:06:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 913 bytes |
コンパイル時間 | 1,465 ms |
コンパイル使用メモリ | 167,056 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 06:29:18 |
合計ジャッジ時間 | 2,178 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 4 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); double p, q; cin >> p >> q; vector<double> turn_succes_p(10); vector<double> turn_succes_rp(10); //p turn_succes_p[0] = p * q; for (int i = 1; i < 10; ++i) { if (i % 2 == 0) { turn_succes_p[i] = turn_succes_p[i - 1] * (1 - q); } else { turn_succes_p[i] = turn_succes_p[i - 1] * 1; } } //(1 - p) turn_succes_rp[0] = (1 - p) ; for (int i = 1; i < 10; ++i) { if (i % 2 == 0) { turn_succes_rp[i] = turn_succes_rp[i - 1] * 1; } else { turn_succes_rp[i] = turn_succes_rp[i - 1] * (1 - q); } } double P1 = turn_succes_rp[1]; double P2 = turn_succes_p[2]; //cout << P1 << ' ' << P2 << endl; if (P1 < P2) cout << "YES" << endl; else cout << "NO" << endl; return 0; }