結果
問題 | No.2134 $\sigma$-algebra over Finite Set |
ユーザー | kotatsugame |
提出日時 | 2022-11-25 23:09:22 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 216 ms / 2,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 579 ms |
コンパイル使用メモリ | 71,200 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-04-16 12:50:32 |
合計ジャッジ時間 | 2,147 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 216 ms
6,944 KB |
testcase_02 | AC | 212 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 6 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 12 ms
6,940 KB |
testcase_07 | AC | 13 ms
6,944 KB |
testcase_08 | AC | 3 ms
6,940 KB |
testcase_09 | AC | 2 ms
6,944 KB |
testcase_10 | AC | 30 ms
6,940 KB |
testcase_11 | AC | 30 ms
6,944 KB |
testcase_12 | AC | 60 ms
6,944 KB |
testcase_13 | AC | 118 ms
6,940 KB |
testcase_14 | AC | 12 ms
6,940 KB |
testcase_15 | AC | 16 ms
6,940 KB |
testcase_16 | AC | 13 ms
6,944 KB |
testcase_17 | AC | 2 ms
6,940 KB |
testcase_18 | AC | 1 ms
6,944 KB |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() | ^~~~
ソースコード
#include<iostream> #include<atcoder/modint> #include<bitset> using namespace std; using mint=atcoder::modint998244353; bitset<1000>A[1000]; main() { int N,M; cin>>N>>M; for(int i=0;i<M;i++) { int k;cin>>k; for(;k--;) { int a;cin>>a; A[i].set(a-1); } } int cnt=0; for(int j=0;j<N;j++) { bitset<1000>dp; for(int k=j+1;k<N;k++)dp.set(k); for(int i=0;i<M;i++) { if(A[i][j]==1)dp&=A[i]; else dp&=~A[i]; } if(dp.none())cnt++; } cout<<mint(2).pow(cnt).val()<<endl; }