結果
| 問題 | No.1579 New Type of Nim | 
| コンテスト | |
| ユーザー |  yakki | 
| 提出日時 | 2021-07-02 21:46:08 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,103 bytes | 
| コンパイル時間 | 1,387 ms | 
| コンパイル使用メモリ | 114,600 KB | 
| 最終ジャッジ日時 | 2025-01-22 15:51:37 | 
| ジャッジサーバーID (参考情報) | judge2 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 WA * 11 | 
ソースコード
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<ctime>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;
#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
#define PI acos(-1.0)
const double EPS = 1e-10;
using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;
//using mint = modint998244353;
int dh[] = {-1,0,1,0};
int dw[] = {0,1,0,-1};
int main(){
    int a,b; cin >> a >> b;
    if(a > b) swap(a,b);
    if(b % 2 == 0){
        if(a == b-1 || a == b){
            cout << 'Q' << endl;
        }
        else cout << 'P' << endl;
    }
    else{
        if(a == b-1) cout << 'Q' << endl;
        else cout << 'P' << endl;
    }
}
            
            
            
        