結果

問題 No.88 次はどっちだ
ユーザー バカらっく
提出日時 2018-03-03 22:01:53
言語 Swift
(6.0.3)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 118,568 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2024-11-30 12:06:41
合計ジャッジ時間 1,235 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:6:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
for i in 1...8 {
    ^
    _

ソースコード

diff #

let black = readLine()!
let white = black.prefix(1) == "o" ? "yukiko" : "oda"

var bCount = 0
var wCount = 0
for i in 1...8 {
    let line = readLine()!
    bCount += line.reduce(0, {$0 + ($1 == "b" ? 1 : 0)})
    wCount += line.reduce(0, {$0 + ($1 == "w" ? 1 : 0)})
}

if bCount > wCount {
    print(white)
} else {
    print(black)
}
0