F - Qualification Rounds CodeForces - 868C 二进制
F - Qualification Rounds
这个题目不会,上网查了一下,发现一个结论就是如果是可以的,那么两个肯定可以满足。
然后就用二进制来压一下这个状态就可以了。
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
#include <string>
#define inf 0x3f3f3f3f
#define inf64 0x3f3f3f3f3f3f3f3f
using namespace std;
const int maxn = 1e5 + 10;
typedef long long ll;
bool vis[100];
int main()
{
int n, m, flag = 0;
scanf("%d%d", &n, &m);
int sum = (1 << m);
for(int i=1;i<=n;i++)
{
int now = 0;
for(int j=1;j<=m;j++)
{
int x;
scanf("%d", &x);
if (x) now |= (1 << (j - 1));
}
vis[now] = 1;
}
for(int i=0;i<sum;i++)
{
if (vis[i] == 0) continue;
for(int j=0;j<sum;j++)
{
if (vis[j] == 0) continue;
if ((i&j) == 0) flag = 1;
}
}
if (flag) printf("YES\n");
else printf("NO\n");
return 0;
}
F - Qualification Rounds CodeForces - 868C 二进制的更多相关文章
- [Codeforces Round #438][Codeforces 868C. Qualification Rounds]
题目链接:868C - Qualification Rounds 题目大意:有\(n\)个题目,\(k\)个人,每个人可能做过这\(n\)个题里的若干道,出题方要在这\(n\)个题目里选若干个出来作为 ...
- 【Codeforces】868C. Qualification Rounds
[题目]C. Qualification Rounds [题意]给定n个问题和K个人,给定每个人知道的问题列表,求能否找到一个非空问题集合,满足每个人知道的集合中问题数量都不超过集合总题数的一半.n& ...
- Codeforces Round #438 C - Qualification Rounds 思维
C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- codeforces 868C
C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces 868C Qualification Rounds - 位运算
Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quar ...
- codeforces 868C Qualification Rounds
Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quar ...
- codeforces 868C - Qualification Rounds(构造)
原题链接:http://codeforces.com/problemset/problem/868/C 题意:有k个队伍参加比赛,比赛有n个预选的题目,有些队伍对已经事先知道了一些题目.问能不能选出若 ...
- Codeforces Round #438 C. Qualification Rounds
Description Snark and Philip are preparing the problemset for the upcoming pre-qualification round f ...
- Qualification Rounds(Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)+状态压缩)
题目链接 传送门 题意 现总共有\(n\)个题目\(k\)支参赛队伍,已知每个题目各队伍是否会写,现问你能否从题目中选出一个子序列使得每支队伍最多只会写一半的题目. 思路 对于每个题目我们用二进制压缩 ...
随机推荐
- c++存储区
全局变量与静态变量区.常量区.局部变量区(栈).动态存储区(堆).自由存储区 1.全局变量与静态变量区->存放全局变量.静态变量,程序运行结束后释放 2.常量区->存放常量 3.局部变量区 ...
- 如何改变Xcode字体大小?
运行Xcode后依次点击左上角Xcode/Preferences/Fonts & Colors里就可以调整,在右边随便点中一个字体就可以调整这个字体的大小和颜色了,按command+a可以将所 ...
- 选择IT行业的自我心得,希望能帮助到各位!(六)
在这个社会,想做大事的人很多,但是很多事情也挺难做的,为什么说复杂的事情简单做,简单的事情重复做,这样一个人才能获得更多的优越品质,为啥说改变,人还是挺难过的,都知道本性难移,想改挺难得.在这个社会千 ...
- 第二章:shell变量
查看所有全局和局部变量:delare和set 查看所有全局变量:env 定义环境变量: 用户变量在家目录下的~/.bash_profile和~/.bashrc中设置 全局变量在/etc/profile ...
- 怎样才能拥有营销号生成器功能?python帮你实现
前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. PS:如有需要Python学习资料的小伙伴可以加点击下方链接自行获取http ...
- 一篇文章快速搞懂Redis的慢查询分析
什么是慢查询? 慢查询,顾名思义就是比较慢的查询,但是究竟是哪里慢呢?首先,我们了解一下Redis命令执行的整个过程: 发送命令 命令排队 命令执行 返回结果 在慢查询的定义中,统计比较慢的时间段指的 ...
- springboot前后端分离跨域
@Configurationpublic class CrossConfig implements WebMvcConfigurer { @Override public void addCorsMa ...
- Python刷CSDN阅读数(仅供娱乐)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @File:csdn_reads.py @E-mail:3649427 ...
- Springboot:员工管理之环境准备(十(1))
1:静态资源 下载静态资源:https://files.cnblogs.com/files/applesnt/ztzy.zip 项目下载:https://files.cnblogs.com/files ...
- MySQL笔记总结-其他
数据库相关概念 一.数据库的好处 1.可以持久化数据到本地 2.结构化查询 二.数据库的常见概念 ★ 1.DB:数据库,存储数据的容器 2.DBMS:数据库管理系统,又称为数据库软件或数据库产品,用于 ...