結果

問題 No.1579 New Type of Nim
ユーザー se1ka2
提出日時 2021-07-02 21:31:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 64,104 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-23 05:15:54
合計ジャッジ時間 1,554 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if(a < b) swap(a, b);
    if(a - b >= 2){
        cout << "P" << endl;
        return 0;
    }
    if(a - b == 1){
        if(b % 2) cout << "Q" << endl;
        else cout << "P" << endl;
    }
    else{
        if(b % 2) cout << "Q" << endl;
        else cout << "P" << endl;
    }
}
0