結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 9 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,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 49 ms
6,940 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 1 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[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 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+1).val()<<endl;
}
0