結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー shift_aaaashift_aaaa
提出日時 2022-11-07 03:44:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 889 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 172,224 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 16:20:41
合計ジャッジ時間 5,250 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <atcoder/all>
#include <vector>
#include <set>
#include <iostream>
#include <bitset>
#include <unordered_set>
using namespace std;

const int MAX_N = 510;
using bit = bitset<MAX_N>;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<bit> a(m), contain(n);
    for (int i = 0; i < m; i++)
    {
        int l;
        cin >> l;
        for (int j = 0; j < l; j++)
        {
            int v;
            cin >> v;
            v--;
            a[i][v] = 1;
        }
    }

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            if (a[j][i] == 1)
            {
                contain[i][j] = 1;
            }
        }
    }
    unordered_set<bit> sets;
    for (int i = 0; i < n; i++)
    {
        sets.insert(contain[i]);
    }
    int size = sets.size();
    cout << atcoder::pow_mod(2, size, 998244353) << endl;
    return 0;
}
0