結果

問題 No.8 N言っちゃダメゲーム
ユーザー riokuma0810riokuma0810
提出日時 2015-08-18 01:36:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 15,380 KB
最終ジャッジ日時 2023-09-25 12:44:20
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

i = gets.chomp.to_i

i.times do
  n_k = gets.chomp.split
  n = n_k[0].to_i - 1
  k = n_k[1].to_i

  if n < k
    puts "Win"
  else
    while n > k
    n = n - (k+1)
    end
    if n >= k
      puts "Win"
    else
      puts "Lose"
    end
  end
end
0