結果

問題 No.43 野球の試合
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-22 14:13:35
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 6,700 KB
実行使用メモリ 6,800 KB
最終ジャッジ日時 2023-09-06 02:56:54
合計ジャッジ時間 1,356 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N=int(raw_input())
table=[]
n_null=0
for i in range(N):
    s= raw_input()
    table.append(s)
    for t in s:
        if t=='-':
            n_null+=1
n_null/=2
bestans=N
for mask in range(1<<n_null):
    n_win=[0 for i in range(N)]
    ind=0
    for i in range(N):
        for j in range(i+1,N):
            if table[i][j]=='o':
                n_win[i]+=1
            elif table[i][j]=='x':
                n_win[j]+=1
            else:
                if (mask&(1<<ind))!=0:
                    n_win[i]+=1
                else:
                    n_win[j]+=1
                ind+=1
    ans=1
    for i in range(1,N):
        if n_win[i]>n_win[0]:
            ans+=1
    bestans=min(ans,bestans)
print bestans
            
0