[TJOI2008]彩灯
2024-08-30 07:18:58
线性基裸题,求最大线性无关组。
注意:1ll<<i
#include <cstdio>
int n,m;
const int mod=2008;
long long b[64];
void insert(long long x) {
for(int i=62; ~i; i--) {
if((x>>i)&1) {
if(b[i]) x^=b[i];
else {
b[i]=x;
return;
}
}
}
}
char s[70];
long long ans;
int main() {
scanf("%d%d",&n,&m);
for(int i=1; i<=m; i++) {
scanf("%s",s);
long long tp=0;
for(int j=0; j<n; j++) {
if(s[j]=='O') tp+=(1ll<<j);
}
insert(tp);
}
for(int i=0; i<62; i++) if(b[i])ans++;
printf("%d",(1ll<<ans)%mod);
}
最新文章
- Linux学习笔记(4)-远程登录
- Http请求中Content-Type讲解以及在Spring MVC中的应用
- 初学者的jquery登录注册和弹窗设计
- MFC radio button 绑定变量用法
- 转:基础总结篇之一:Activity生命周期
- Linux环境进程间通信(三):消息队列
- Android L(5.0)源码之手势识别OnTouchListener
- onenote使用教程
- 缓存--Redis
- AspectJ开发
- Python Async/Await入门指南
- zabbix简介与部署
- python-随机操作(random)
- week05 06绑定滚动条 去抖动
- make/makefile中的加号+,减号-和at号@的含义
- C/C++ 类成员函数指针 类成员数据指针
- delphi调用webservice (.NET C#版)
- 【转】SQL SERVER 中 sp_rename 用法
- 翻译记忆软件-塔多思TRADO经典教程_5
- js判断手机型号
热门文章
- POJ 1129 Channel Allocation DFS 回溯
- [bzoj4196][Noi2015]软件包管理器_树链剖分_线段树
- [bzoj2466][中山市选2009]树_树形dp
- [bzoj4127]Abs_树链剖分_线段树
- [Javascript] IntersectionObserver -- Lazy Load Images on a Website
- 9517 Link Link Look
- Linux命令(十一)——Shell程序设计二(循环控制语句)
- 能够替代浮动的inline-block
- cocos2d-x 是怎样渲染的
- <;vim实用技巧>;学习笔记