結果

問題 No.486 3 Straight Win(3連勝)
ユーザー maimai8
提出日時 2020-06-16 22:00:53
言語 OCaml
(5.2.1)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 21,572 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-09 01:21:43
合計ジャッジ時間 1,197 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

open Str
let () =
  Scanf.scanf "%s\n" @@ fun s ->
  let slst = Str.split (Str.regexp " ") s in
  let (e, w) = List.fold_left (fun (e, w) x -> if x = "O" then (e+1, w) else (e, w+1)) (0, 0) slst in
  Printf.printf "%s\n" (if e < w then "East" else if e > w then "West" else "NA")
0