結果

問題 No.7 プライムナンバーゲーム
ユーザー gigurururugigurururu
提出日時 2014-11-05 20:32:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 255 ms / 5,000 ms
コード長 158 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-04-09 03:39:44
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
12,672 KB
testcase_01 AC 112 ms
12,800 KB
testcase_02 AC 255 ms
12,672 KB
testcase_03 AC 136 ms
12,544 KB
testcase_04 AC 120 ms
12,672 KB
testcase_05 AC 119 ms
12,544 KB
testcase_06 AC 173 ms
12,416 KB
testcase_07 AC 158 ms
12,544 KB
testcase_08 AC 143 ms
12,544 KB
testcase_09 AC 196 ms
12,672 KB
testcase_10 AC 111 ms
12,800 KB
testcase_11 AC 161 ms
12,672 KB
testcase_12 AC 228 ms
12,800 KB
testcase_13 AC 231 ms
12,800 KB
testcase_14 AC 253 ms
12,544 KB
testcase_15 AC 251 ms
12,672 KB
testcase_16 AC 243 ms
12,672 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require"prime"
prime=[*Prime.each(10000)]
w=[false]*4
n=gets.to_i
(2..n).each{|c|
  prime.each{|i|i+c<=n&&w[i+c]=true}if !w[c]
}
puts w[n]?"Win":"Lose"
0