結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,968 KB
testcase_01 AC 12 ms
5,888 KB
testcase_02 AC 12 ms
5,884 KB
testcase_03 AC 13 ms
6,052 KB
testcase_04 AC 14 ms
6,100 KB
testcase_05 AC 11 ms
6,056 KB
testcase_06 AC 13 ms
5,928 KB
testcase_07 AC 254 ms
6,792 KB
testcase_08 WA -
testcase_09 AC 11 ms
6,052 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
s = [list(raw_input()) for _ in range(N)]

remain = []
for i in range(N):
    for j in range(i+1,N):
        if s[i][j] == "-":
            remain.append([i,j])
ans = 10
for i in range(2**len(remain)):
    win = [s[j].count("o") for j in range(N)]
    for a,b in remain:
        if i & 1: win[a] += 1
        else: win[b] += 1
        i >>= 1
    ans = min(ans, sorted(k for k in win)[::-1].index(win[0])+1)
print ans
0