結果

問題 No.8 N言っちゃダメゲーム
ユーザー kashiwagi513kashiwagi513
提出日時 2019-03-01 13:37:55
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 19,820 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 08:45:30
合計ジャッジ時間 727 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

let solve n k =
  let rec inner m =
    if m < 0 then "Win"
    else if m = 0 then "Lose"
    else inner (m-k-1)
  in print_string @@ inner (n-1)

let _ =
  let p = int_of_string @@ read_line() in
  for _ = 1 to p do
    let cond = String.split_on_char ' ' (read_line ()) in
    solve (int_of_string @@ List.nth cond 0) 
      (int_of_string @@ List.nth cond 1)
  done
0