結果
問題 |
No.1579 New Type of Nim
|
ユーザー |
|
提出日時 | 2021-07-02 22:01:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 434 ms |
コンパイル使用メモリ | 67,524 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-29 11:32:50 |
合計ジャッジ時間 | 1,302 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 6 |
ソースコード
#include<iostream> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const LL mod=1e9+7; int main(){ LL n,m; cin>>n>>m; int flag=0; if(n>m+1){ n=m+1; flag=1; } if(m>n+1){ m=n+1; flag=1; } LL t=n+m; if(t%2==0)t--; if(flag)puts("P"); else{ if((t/2)%2||(t==1))puts("Q"); else puts("P"); } return 0; }