結果

問題 No.159 刺さらないUSB
ユーザー hadrori
提出日時 2015-07-25 23:01:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 357 bytes
コンパイル時間 1,318 ms
コンパイル使用メモリ 156,384 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 23:46:58
合計ジャッジ時間 1,998 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘void input()’:
main.cpp:14:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |     scanf("%lf %lf", &p, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repi(i,0,n)

double p, q;

int solve() {
    double p1 = (1-p)*(1-q)*q, p2 = p*(1-q)*(1-q)*q;
    return p1 < p2;
}

void input() {
    scanf("%lf %lf", &p, &q);
}

int main() {
    input();
    puts(solve()? "YES": "NO");
    return 0;
}
0