結果

問題 No.8 N言っちゃダメゲーム
ユーザー tak
提出日時 2019-02-16 16:56:01
言語 F#
(F# 4.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 12,660 ms
コンパイル使用メモリ 205,832 KB
実行使用メモリ 29,184 KB
最終ジャッジ日時 2024-09-22 14:11:04
合計ジャッジ時間 12,648 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (397 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.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