WA on #9
查看原帖
WA on #9
1062683
lottle1212__楼主2024/3/21 22:12
#include <iostream>
#define ll long long
using namespace std;
const int maxlg = 60;
int f[64], cnt, n, m;
void insert(ll x) {
	for (int i = maxlg; ~ i; -- i)
		if (x & (1ll << i))
			if (! f[i]) { f[i] = x; ++ cnt; return ; }
			else x ^= f[i];
}
signed main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	cin >> n >> m;
	while (m --) {
		ll res = 0;
		for (int i = 1; i <= n; ++ i) {
			char ch;
			cin >> ch;
			res = (res << 1) | (ch == 'X');
		}
		insert(res);
	}
	cout << (1ll << cnt) % 2008 << '\n';
	return 0;
}
2024/3/21 22:12
加载中...