結果
問題 | No.726 Tree Game |
ユーザー |
![]() |
提出日時 | 2020-07-08 23:05:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 202 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-05 00:38:31 |
合計ジャッジ時間 | 2,243 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
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(1,y): if prime(y+i): yy=i break else: continue if x==1: xx=1 else: for i in range(1,x): if prime(x+i): xx=i break else: continue if x==2 or y==2: print("Second") elif (yy-xx)%2==0: print("Second") else: print("First")