結果
問題 | No.726 Tree Game |
ユーザー |
|
提出日時 | 2018-08-24 22:27:12 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 312 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-06-23 08:00:25 |
合計ジャッジ時間 | 3,895 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'prime'def solve(x)res = 0while x.prime?.!res += 1x += 1endif res > 0res -= 1endreturn resendy, x = gets.split.map(&:to_i)if x.prime? || y.prime?puts :Firstexitendcnt = solve(y) + solve(x)puts ((cnt % 2 == 1) ? :First : :Second)