結果

問題 No.1579 New Type of Nim
コンテスト
ユーザー とりゐ
提出日時 2021-07-02 21:32:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 503 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 214 ms
コンパイル使用メモリ 85,392 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2026-04-03 12:45:30
合計ジャッジ時間 2,157 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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')
0