結果

問題 No.726 Tree Game
ユーザー kobaya0514
提出日時 2018-08-24 21:38:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-23 06:53:15
合計ジャッジ時間 1,772 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def prime(a):
  for i in range(2,int(math.sqrt(a))+1):
    if a%i==0:
      return False
  return True

def solve(a):
  res=a+1
  while True:
    if prime(res):
      return res-a-1
    else:
      res+=1

x,y=map(int,input().split())

ans=solve(x)+solve(y)

if ans%2==0:
  print("Second")
else:
  print("First")
0