結果

問題 No.1579 New Type of Nim
ユーザー c-yan
提出日時 2021-07-02 22:51:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-29 12:43:06
合計ジャッジ時間 2,045 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 23 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

A, B = min(A, B), max(A, B)

if A == 1:
    if B == 1:
        print('Q')
    elif B % 2 == 0:
        print('Q')
    else:
        print('P')
elif A == 2:
    if B == 2:
        print('P')
    elif B == 3:
        print('P')
    elif B % 2 == 0:
        print('P')
    else:
        print('Q')
elif A == 3:
    if B == 3:
        print('Q')
    else:
        print('P')
else:
    print('P')
0