結果
| 問題 | 
                            No.2270 T0空間
                             | 
                    
| コンテスト | |
| ユーザー | 
                             gew1fw
                         | 
                    
| 提出日時 | 2025-06-12 20:41:58 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 807 bytes | 
| コンパイル時間 | 186 ms | 
| コンパイル使用メモリ | 81,980 KB | 
| 実行使用メモリ | 114,028 KB | 
| 最終ジャッジ日時 | 2025-06-12 20:42:07 | 
| 合計ジャッジ時間 | 7,936 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 TLE * 1 -- * 8 | 
ソースコード
def main():
    import sys
    input = sys.stdin.read().split()
    idx = 0
    N = int(input[idx])
    idx += 1
    M = int(input[idx])
    idx += 1
    strings = []
    for _ in range(M):
        strings.append(input[idx])
        idx += 1
    
    # Precompute the bitmasks for each position i (1-based)
    bitmasks = {}
    for i in range(1, N+1):
        pos = N - i  # 0-based index in the string
        mask = 0
        for k in range(M):
            if strings[k][pos] == '1':
                mask |= (1 << k)
        bitmasks[i] = mask
    
    # Check all pairs (i, j) with i < j
    for i in range(1, N):
        for j in range(i+1, N+1):
            if (bitmasks[i] ^ bitmasks[j]) == 0:
                print("No")
                return
    print("Yes")
if __name__ == "__main__":
    main()
            
            
            
        
            
gew1fw