結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-03-15 01:53:52 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 412 bytes |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2024-11-06 14:42:01 |
| 合計ジャッジ時間 | 2,099 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
def is_prime(N):
if N == 2:
return True
elif N&1 == 0 or N == 1:
return False
i = 3
while i*i <= N:
if N%i == 0: return False
i += 2
return True
x,y = map(int,input().split())
if is_prime(x) and is_prime(y):
ans = 1
elif x==2 or y==2:
ans = 1
elif x==1 or y==1:
ans = (x+y+(x==y))%2
else:
ans = (x+y+1)%2
print("First" if ans==0 else "Second")
convexineq