結果
問題 |
No.1579 New Type of Nim
|
ユーザー |
![]() |
提出日時 | 2021-07-24 19:13:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 712 bytes |
コンパイル時間 | 1,697 ms |
コンパイル使用メモリ | 166,292 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 01:35:16 |
合計ジャッジ時間 | 3,153 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define Pr pair<ll,ll> #define Tp tuple<ll,ll,ll> using Graph = vector<vector<int>>; const ll mod = 1000000007; //累乗 aのb乗、正しmを法として求める long long pw(long long a,long long b,long long m){ if(b==0) return 1; else if(b%2==0){ long long x = pw(a,b/2,m); return (x*x)%m; } else{ long long x = pw(a,b-1,m); return (a*x)%m; } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); ll A,B; cin >> A >> B; string ans = "P"; if(abs(A-B)==1||(A*B==1)) ans = "Q"; cout << ans << endl; }