結果

問題 No.726 Tree Game
ユーザー takakin
提出日時 2020-07-08 23:02:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-05 00:29:59
合計ジャッジ時間 2,165 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
y,x=map(int,input().split())

def prime(n):
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append(i)
      if i!=n//i:
        divisors.append(n//i)

  return len(divisors)==2

if y==1:
  yy=1
else:    
  for i in range(y):
    if prime(y+i):
      yy=i
      break
    else:
      continue
if x==1:
  xx=1
else:
  for i in range(x):
    if prime(x+i):
      xx=i
      break
    else:
      continue

if (yy-xx)%2==0:
  print("Second")
else:
  print("First")
0