結果

問題 No.1560 majority x majority
コンテスト
ユーザー vwxyz
提出日時 2024-06-02 06:40:02
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 183 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 154,116 KB
最終ジャッジ日時 2026-05-29 03:52:13
合計ジャッジ時間 7,044 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 5
other TLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,M=map(int,input().split())
S=[list(map(int,input().split())) for n in range(N)]
dp=[0]*(1<<M)
dp[0]=1
for bit in range(1<<M):
    idx=[n for n in range(N) if all(S[n][m] for m in range(M) if bit&1<<m)]
    for m in range(M):
        if bit&1<<m:
            continue
        if sum(S[n][m] for n in idx)*2>=len(idx):
            dp[bit|1<<m]+=dp[bit]
ans=dp[(1<<M)-1]
print(ans)
0