結果

問題 No.88 次はどっちだ
ユーザー バカらっくバカらっく
提出日時 2018-03-03 22:01:53
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 117,844 KB
実行使用メモリ 8,960 KB
最終ジャッジ日時 2024-05-07 17:25:49
合計ジャッジ時間 1,286 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
8,704 KB
testcase_01 AC 10 ms
8,832 KB
testcase_02 AC 9 ms
8,704 KB
testcase_03 AC 9 ms
8,576 KB
testcase_04 WA -
testcase_05 AC 9 ms
8,576 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 10 ms
8,832 KB
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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