結果

問題 No.43 野球の試合
ユーザー roiti46roiti46
提出日時 2015-02-11 23:30:55
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 6,644 KB
実行使用メモリ 6,688 KB
最終ジャッジ日時 2023-09-05 23:48:28
合計ジャッジ時間 1,144 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,832 KB
testcase_01 AC 12 ms
5,848 KB
testcase_02 WA -
testcase_03 AC 12 ms
5,932 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 13 ms
5,840 KB
testcase_07 AC 238 ms
6,688 KB
testcase_08 AC 11 ms
5,896 KB
testcase_09 AC 12 ms
6,068 KB
testcase_10 AC 11 ms
5,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
s = [raw_input() for _ in range(N)]
remain = [[i,j] for i in range(N) for j in range(i+1,N) if s[i][j] == "-"]
ans = 6
for i in range(2**len(remain)):
    win = [si.count("o") for si in s]
    for a,b in remain:
        if i & 1: win[[a,b][i&1]] += 1
        i >>= 1
    ans = min(ans, sorted(list(set(win)))[::-1].index(win[0])+1)
print ans
0