結果
問題 | No.8 N言っちゃダメゲーム |
ユーザー | letrangerjp |
提出日時 | 2017-05-14 14:46:56 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 248 bytes |
コンパイル時間 | 67 ms |
コンパイル使用メモリ | 11,556 KB |
実行使用メモリ | 31,188 KB |
最終ジャッジ日時 | 2023-10-14 10:56:37 |
合計ジャッジ時間 | 6,985 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 79 ms
31,188 KB |
testcase_01 | AC | 78 ms
15,104 KB |
testcase_02 | AC | 76 ms
15,104 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
def f(n, k) dp = [true]*n dp[0] = false (0..n-1).each{|i| dp[i] = (1..[k,i].min).any?{|v|!dp[i-v]} } # p dp dp[n-1] end P = gets.to_i NK = P.times.map{gets.split.take(2).map(&:to_i)} NK.each{|n, k| puts f(n, k) ? :Win : :Lose }