結果

問題 No.7 プライムナンバーゲーム
ユーザー gigurururugigurururu
提出日時 2014-11-05 20:32:21
言語 Ruby
(3.2.2)
結果
AC  
実行時間 225 ms / 5,000 ms
コード長 158 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 15,536 KB
最終ジャッジ日時 2023-07-24 20:13:25
合計ジャッジ時間 3,663 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
15,380 KB
testcase_01 AC 93 ms
15,392 KB
testcase_02 AC 223 ms
15,404 KB
testcase_03 AC 117 ms
15,380 KB
testcase_04 AC 106 ms
15,500 KB
testcase_05 AC 105 ms
15,420 KB
testcase_06 AC 151 ms
15,504 KB
testcase_07 AC 139 ms
15,452 KB
testcase_08 AC 122 ms
15,292 KB
testcase_09 AC 170 ms
15,408 KB
testcase_10 AC 96 ms
15,388 KB
testcase_11 AC 143 ms
15,376 KB
testcase_12 AC 198 ms
15,528 KB
testcase_13 AC 203 ms
15,396 KB
testcase_14 AC 225 ms
15,340 KB
testcase_15 AC 218 ms
15,536 KB
testcase_16 AC 210 ms
15,396 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