結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-24 23:18:53 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 372 bytes |
| コンパイル時間 | 342 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-06-23 09:56:48 |
| 合計ジャッジ時間 | 4,061 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'prime'
LIM = 10 ** 1333
def solve(x)
res = 0
while x.prime?.!
res += 1
x += 1
end
if res > 0
res -= 1
end
return res
end
y, x = gets.split.map(&:to_i)
assert y <= 1000000000 && x <= 1000000000
if x.prime? || y.prime?
puts :First
exit
end
cnt = solve(y) + solve(x)
puts ((cnt % 2 == 1) ? :First : :Second)