結果
| 問題 |
No.1579 New Type of Nim
|
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2021-07-02 21:32:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 503 bytes |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 82,440 KB |
| 実行使用メモリ | 54,272 KB |
| 最終ジャッジ日時 | 2024-07-23 05:16:13 |
| 合計ジャッジ時間 | 2,692 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
import sys
import math
from collections import deque,Counter
sys.setrecursionlimit(10**7)
int1=lambda x: int(x)-1
mi=lambda :map(int,input().split())
li=lambda :list(mi())
mi1=lambda :map(int1,input().split())
li1=lambda :list(mi1())
mis=lambda :map(str,input().split())
lis=lambda :list(mis())
mod=10**9+7
Mod=998244353
INF=10**18
ans=0
a,b=mi()
if abs(a-b)>=2:
print('P')
elif a==b:
if a%2==0:
print('P')
else:
print('Q')
else:
if (a+b+1)%4==0:
print('Q')
else:
print('P')
とりゐ