結果

問題 No.88 次はどっちだ
ユーザー GrayCoderGrayCoder
提出日時 2018-06-03 16:39:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 900 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 10,976 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-09-12 21:55:03
合計ジャッジ時間 1,034 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,056 KB
testcase_01 AC 15 ms
8,176 KB
testcase_02 AC 16 ms
8,060 KB
testcase_03 AC 16 ms
8,036 KB
testcase_04 AC 16 ms
8,140 KB
testcase_05 WA -
testcase_06 AC 16 ms
8,048 KB
testcase_07 AC 17 ms
8,184 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
8,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
from itertools import product

def main():
    S = input()
    B = stdin.read().splitlines()

    if S == 'oda':
        players = ['oda', 'yukiko']
    else:
        players = ['yukiko', 'oda']
    cnt = 64 - ''.join(B).count('.')
    if cnt % 2:
        for i, j in product(range(5), repeat=2):
            if all((B[i][j] == '.', B[i][j+1] == 'b', B[i][j+2] == 'w')) or \
                    all((B[i][j] == '.', B[i+1][j] == 'b', B[i+2][j] == 'w')):
                print(players[1])
                break
        else:
            print(players[0])
    else:
        for i, j in product(range(5), repeat=2):
            if all((B[i][j] == '.', B[i][j+1] == 'w', B[i][j+2] == 'b')) or \
                    all((B[i][j] == '.', B[i+1][j] == 'w', B[i+2][j] == 'b')):
                print(players[0])
                break
        else:
            print(players[1])

main()
0