結果
問題 |
No.2911 位相の公理
|
ユーザー |
|
提出日時 | 2024-10-04 21:49:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 690 bytes |
コンパイル時間 | 2,171 ms |
コンパイル使用メモリ | 199,892 KB |
最終ジャッジ日時 | 2025-02-24 15:12:43 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 7 RE * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector<int> S(M); set<int> X; for(auto &s : S){ string t; cin >> t; int p2 = 1; for(auto &c : t){ s += (c-'0')*p2; p2 *= 2; } X.insert(s); } set<int> Y; for(int i=0; i<N; i++) for(int k=i; k<N; k++) Y.insert(S.at(i)&S.at(k)); Y.insert((1<<N)-1); for(int i=0; i<(1<<N); i++){ int now = 0; for(int k=0; k<N; k++) if(i&(1<<k)) now |= S.at(k); Y.insert(now); } if(X == Y) cout << "Yes\n"; else cout << "No\n"; }