結果
問題 | No.726 Tree Game |
ユーザー |
|
提出日時 | 2018-08-24 21:38:39 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 42 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-06-23 06:53:10 |
合計ジャッジ時間 | 3,140 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 4 |
コンパイルメッセージ
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 :Secondexitendcnt = solve(y) + solve(x)puts cnt % 2 == 1 ? :First : :Second