結果

問題 No.2911 位相の公理
ユーザー GOTKAKOGOTKAKO
提出日時 2024-10-04 21:49:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 690 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 209,352 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 21:49:33
合計ジャッジ時間 3,006 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,820 KB
testcase_02 AC 2 ms
6,820 KB
testcase_03 AC 1 ms
6,820 KB
testcase_04 AC 2 ms
6,820 KB
testcase_05 AC 1 ms
6,816 KB
testcase_06 AC 1 ms
6,820 KB
testcase_07 AC 1 ms
6,816 KB
testcase_08 AC 1 ms
6,816 KB
testcase_09 WA -
testcase_10 RE -
testcase_11 AC 1 ms
6,816 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,820 KB
testcase_14 RE -
testcase_15 AC 1 ms
6,820 KB
testcase_16 WA -
testcase_17 AC 3 ms
6,816 KB
testcase_18 AC 3 ms
6,816 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 8 ms
6,816 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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";
}
0