結果
| 問題 | No.88 次はどっちだ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-21 03:18:52 |
| 言語 | Standard ML (MLton 20241230) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 1,324 bytes |
| 記録 | |
| コンパイル時間 | 5,452 ms |
| コンパイル使用メモリ | 704,484 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-21 03:18:59 |
| 合計ジャッジ時間 | 5,049 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
fun readStr () =
let
fun scan reader stream = SOME (StringCvt.splitl (not o Char.isSpace) reader (StringCvt.skipWS reader stream))
in
valOf (TextIO.scanStream scan TextIO.stdIn)
end
fun countPieces board =
let
val grid = List.foldl (fn (s, acc) =>
String.explode s @ acc)
[]
board
val black = List.foldl (fn (ch, acc) =>
if ch = #"b" then acc + 1
else acc)
0
grid
val white = List.foldl (fn (ch, acc) =>
if ch = #"w" then acc + 1
else acc)
0
grid
in
(black, white)
end
fun findAns sente black white =
let
val gote = if sente = "oda" then "yukiko"
else "oda"
in
if (black + white) mod 2 = 0 then sente
else gote
end
val () =
let
val s = readStr ()
val board = List.tabulate (8, fn _ => readStr ())
val (b, w) = countPieces board
val ans = findAns s b w
in
print (ans ^ "\n")
end