結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー kotatsugamekotatsugame
提出日時 2022-11-25 23:04:24
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 603 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 70,656 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 04:10:13
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 199 ms
6,944 KB
testcase_02 AC 205 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 8 ms
6,944 KB
testcase_07 AC 10 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 103 ms
6,940 KB
testcase_14 WA -
testcase_15 AC 15 ms
6,944 KB
testcase_16 WA -
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<atcoder/modint>
#include<bitset>
using namespace std;
using mint=atcoder::modint998244353;
bitset<1000>A[2002];
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[2*i].set(a-1);
		}
		for(int j=0;j<N;j++)if(A[2*i][j]==0)A[2*i+1].set(j);
	}
	M*=2;
	A[M++].set();
	int cur=0;
	for(int j=0;j<N;j++)
	{
		int id=cur;
		while(id<M&&A[id][j]==0)id++;
		if(id==M)continue;
		if(id>cur)
		{
			swap(A[id],A[cur]);
		}
		for(int i=cur+1;i<M;i++)if(A[i][j]==1)A[i]^=A[cur];
		cur++;
	}
	cout<<mint(2).pow(cur).val()<<endl;
}
0