結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー shift_aaaashift_aaaa
提出日時 2022-11-07 03:24:23
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,102 ms / 2,000 ms
コード長 847 bytes
コンパイル時間 3,679 ms
コンパイル使用メモリ 167,460 KB
実行使用メモリ 97,536 KB
最終ジャッジ日時 2024-04-16 12:48:09
合計ジャッジ時間 7,701 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1,091 ms
97,536 KB
testcase_02 AC 1,102 ms
97,408 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 25 ms
7,168 KB
testcase_07 AC 30 ms
7,936 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 79 ms
10,624 KB
testcase_11 AC 79 ms
10,752 KB
testcase_12 AC 263 ms
32,256 KB
testcase_13 AC 606 ms
74,240 KB
testcase_14 AC 37 ms
8,064 KB
testcase_15 AC 50 ms
10,880 KB
testcase_16 AC 40 ms
9,600 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <vector>
#include <set>
#include <iostream>

int main()
{
    int n,m;
    std::cin >> n >> m;
    std::vector<std::set<int>> a(m);
    std::vector<std::set<int>> contain(n);
    for (int i = 0; i < m; i++)
    {
        int l;
        std::cin >> l;
        for (int j = 0; j < l; j++)
        {
            int v;
            std::cin >> v;
            a[i].insert(v-1);
        }
        }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            if(a[j].count(i) == 1) {
                contain[i].insert(j);
            }
        }
    }
    std::set<std::set<int>> set_of_set;
    for (auto s : contain)
    {
        set_of_set.insert(s);
    }
    int size = set_of_set.size();
    std::cout << atcoder::modint998244353(2).pow(size).val() << std::endl;
    return 0;
}
0