POJ 2443 Set Operation
来源:互联网 发布:淘宝店铺类目在哪里看 编辑:程序博客网 时间:2024/05/22 08:01
看到好多题目都需要bitset优化,参考了紫书水了一题。。。
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <vector>#include <algorithm>#include <map>#include <set>#include <bitset>using namespace std;int n,m,a,b;bitset <1005> x[10005];int main(){ //freopen("in.txt","r",stdin); while(scanf("%d",&n)==1) { for(int i=0;i<=10000;++i)x[i].reset(); for(int i=0;i<n;++i) { scanf("%d",&m); for(int j=0;j<m;++j) { scanf("%d",&a); x[a].set(i); } } scanf("%d",&m); for(int i=0;i<m;++i) { scanf("%d%d",&a,&b); if((x[a]&x[b]).any())puts("Yes"); else puts("No"); } } return 0;}
0 0
- POJ 2443 Set Operation
- POJ 2443 Set Operation
- POJ 2443 Set Operation
- poj 2443 Set Operation(bitset)
- 压位加速-poj-2443-Set Operation
- poj 2443 Set Operation (位操作)
- poj 2443 Set Operation(思维&状态压缩)
- POJ 2443 Set Operation -- 位运算 + bitset
- [bitset] POJ 2443——Set Operation
- poj 2443 Set Operation (bitset用法
- POJ -- 2443 Set Operation 【 二进制压位 】
- POJ 2443:Set Operation 经典位运算好题
- POJ 2443Set Operation(好题! 每32位压缩处理)
- PKU 2454 Set Operation
- Set Property CIM Operation
- poj2443 Set Operation
- Operation of sorted set
- python set operation
- [POJ 1742] Coins 男人八题(多重背包)
- 随机数咔咔
- OpenCV Resize()
- Cocos2d-x 3.6 HttpRequest设置回调的方法
- 逗号运算符
- POJ 2443 Set Operation
- 参数(parameter)和属性(Attribute)的区别
- 关于单片机通过串口发送浮点数信息
- 网金监管的另一只靴子会砸死谁
- 集群 分布式 负载均衡
- 树的重心
- 关于 MySQL 密码你应该知道的那些事
- 如何卸载android设备中的apk
- 在魅族官网,如何发帖?