結果

問題 No.8 N言っちゃダメゲーム
ユーザー nakamura sosukenakamura sosuke
提出日時 2019-07-05 10:30:24
言語 Ruby
(3.3.0)
結果
AC  
実行時間 152 ms / 5,000 ms
コード長 307 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 11,964 KB
実行使用メモリ 16,152 KB
最終ジャッジ日時 2023-10-20 00:15:51
合計ジャッジ時間 1,709 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
16,152 KB
testcase_01 AC 87 ms
16,152 KB
testcase_02 AC 83 ms
16,152 KB
testcase_03 AC 97 ms
16,152 KB
testcase_04 AC 152 ms
16,152 KB
testcase_05 AC 84 ms
16,152 KB
testcase_06 AC 84 ms
16,152 KB
testcase_07 AC 83 ms
16,152 KB
testcase_08 AC 84 ms
16,152 KB
testcase_09 AC 83 ms
16,152 KB
testcase_10 AC 82 ms
16,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

P  = gets.to_i
NK = P.times.map{ gets.split.map(&:to_i) }

NK.each do | n, k |
  n = n-1
  0.upto(10**10) do | i |
    if i.even?
      n = n - k
      if n <= 0
        puts 'Win'
        break
      end
    else
      n = n - 1
      if n <= 0
        puts 'Lose'
        break
      end
    end
  end
end
0