結果
問題 | No.2911 位相の公理 |
ユーザー |
|
提出日時 | 2024-10-04 22:29:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 675 bytes |
コンパイル時間 | 3,292 ms |
コンパイル使用メモリ | 195,836 KB |
最終ジャッジ日時 | 2025-02-24 15:26:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 3 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main () {int N, M;cin >> N >> M;vector<int> A(M);for (auto& a : A) {string s;cin >> s;a = 0;for (auto& c : s) {a <<= 1;a |= (c == '1');}}bool OK = true;vector<int> ex((1 << N), 0);for (auto& a : A) ex[a] = 1;for (int i = 0; i < M; i ++) {for (int j = i + 1; j < M; j ++) {if (!ex[A[i] & A[j]]) {OK = false;}}}if (!OK) {puts("No");return 0;}for (int a = 0; a < (1 << N); a ++) {if (!ex[a]) {int x = 0;for (int b = a; b; b = (b - 1) & a) {if (ex[b]) x |= b;}if (x == a) {puts("No");return 0;}}}puts("Yes");}