結果
問題 | No.1579 New Type of Nim |
ユーザー |
![]() |
提出日時 | 2021-07-02 22:05:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 1,015 bytes |
コンパイル時間 | 1,211 ms |
コンパイル使用メモリ | 114,020 KB |
最終ジャッジ日時 | 2025-01-22 16:02:01 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
#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(a % 2 == 1 and a == b) cout << 'Q' << endl; else if(b % 2 == 0 and b == a+1) cout << 'Q' << endl; else cout << 'P' << endl; }