結果
問題 |
No.726 Tree Game
|
ユーザー |
|
提出日時 | 2018-08-24 21:35:51 |
言語 | PyPy2 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 620 ms |
コンパイル使用メモリ | 76,416 KB |
実行使用メモリ | 76,160 KB |
最終ジャッジ日時 | 2024-06-23 06:50:03 |
合計ジャッジ時間 | 3,171 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
X, Y = map(int, raw_input().split()) def is_prime(n): if n == 1: return False i = 2 while i * i <= n: if n % i == 0: return False i += 1 return True if is_prime(X) and is_prime(Y): print "Second" exit() cnt = 0 while is_prime(X): cnt += 1 X += 1 while is_prime(Y): cnt += 1 Y += 1 x = X + 1 y = Y + 1 while not is_prime(x): x += 1 while not is_prime(y): y += 1 d = x - X + y - Y print "First" if (d + cnt) % 2 else "Second"