結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-24 21:44:26 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 421 bytes |
| コンパイル時間 | 181 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-06-23 06:59:18 |
| 合計ジャッジ時間 | 3,744 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'prime'
def solve(y, x)
if y.prime? || x.prime?
return true
else
ty = tx = 0
while ty == 0 || !y.prime?
ty += 1
y += 1
end
while tx == 0 || !x.prime?
tx += 1
x += 1
end
return (ty+tx-2).even? ? false : true
end
end
y,x = gets.split.map(&:to_i)
puts solve(y, x) ? "First" : "Second"