【yukicoder】No.692 square1001 and Permutation 1

 

使用言語

 

Python 3

 

問題文

 

No.692 square1001 and Permutation 1 - yukicoder

 

解法プロセス

 

1、最後のPermutaionを食べた方の負け
2、Petrが先手、square1001が後攻
3、1人1個以上食べて良い→100個,1000個食べても良い
4、nが2個以上なら、1個残るように食べれるので、必ずPetrが勝つ
5、nが1個だけなら、最後の1個を食べることになるので、Petrが負ける

 

回答

 

n = int(input())
if n > 1:
    print("Petr")
else:
    print("square1001")