結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー taktak
提出日時 2019-02-16 16:57:55
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 355 bytes
コンパイル時間 7,970 ms
コンパイル使用メモリ 193,768 KB
実行使用メモリ 40,256 KB
最終ジャッジ日時 2023-10-23 20:36:08
合計ジャッジ時間 10,721 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (268 ms)。
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

Array.init 1000 (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.where ((=) Black)
|> Array.length
|> stdout.WriteLine
0