結果

問題 No.8 N言っちゃダメゲーム
ユーザー taktak
提出日時 2019-02-16 16:56:01
言語 F#
(F# 4.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 13,438 ms
コンパイル使用メモリ 196,668 KB
実行使用メモリ 30,732 KB
最終ジャッジ日時 2023-10-23 20:32:36
合計ジャッジ時間 16,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
30,708 KB
testcase_01 AC 58 ms
30,708 KB
testcase_02 AC 57 ms
30,708 KB
testcase_03 AC 57 ms
30,732 KB
testcase_04 AC 56 ms
30,732 KB
testcase_05 AC 57 ms
30,732 KB
testcase_06 AC 58 ms
30,732 KB
testcase_07 AC 57 ms
30,732 KB
testcase_08 AC 56 ms
30,732 KB
testcase_09 AC 58 ms
30,732 KB
testcase_10 AC 58 ms
30,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (1.32 sec)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

type GameParams = { N: int; K: int }
type Player = Black | White

let simulate n k =
  (n - 1) % (k + 1)
  |> function | 0 -> White | _ -> Black

let N = stdin.ReadLine() |> int

Array.init N (fun _ ->
  let t = stdin.ReadLine().Split() |> Array.map int
  { N = t.[0]; K = t.[1] })
|> Array.map (fun x -> simulate x.N x.K)
|> Array.map (function | Black -> "Win" | _ -> "Lose")
|> Array.iter stdout.WriteLine
0