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\)支参赛队伍,已知每个题目各队伍是否会写,现问你能否从题目中选出一个子序列使得每支队伍最多只会写一半的题目. 思路 对于每个题目我们用二进制压缩 ...
随机推荐
- cd命令使用
- Salesforce Admin考题解析 | 流程自动化考题与知识点拓展
[题目1] A record is modified on 1/1/2008. It meets criteria for a time-based workflow rule; this rule ...
- 三个步骤就能让你轻松掌握Python爬虫
前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:NicePython PS:如有需要Python学习资料的小伙伴可以加 ...
- Anadi and Domino--codeforces div2
题目链接:https://codeforces.com/contest/1230/problem/C 题目大意:21枚多米诺牌,给你一个图,将多米诺牌放到图的边上,由同一个点发出的所有边,边上多米诺牌 ...
- iOS GIF图片转UIImage
多平台保持统一风格的UI设计,少不了一些动态图片的使用 1.本地GIF图片使用 1.1 将本地GIF转为NSdata类型 NSData *tempdata = [NSData dataWithCont ...
- VSCode六大通用插件真香合集
目录 一.background:设置心水背景图 安利理由: 安装及设置步骤: 设置过程中使用的代码: 成果展示: 注意: 二.Material Theme(VSCode主题)+Material Ico ...
- java 多线--静态代理模式
我们使用 java 多线程时,都需要通过线程代理对象来启动线程,常见的写法: new Thread(target).start(); 这在设计模式中叫静态代理模式,静态代理模式组成; 1.公共接口 2 ...
- Python - 生成随机验证码的3种实现方式
生成6位随机验证码的3种实现方式如下: 1. 简单粗暴型:所有数字和字母都放入字符串: 2. 利用ascii编码的规律,遍历获取字符串和数字的字符串格式: 3. 引用string库. 方法1代码: i ...
- Java工作流程引擎系统的退回规则 专题说明
概述 说明:流程引擎的退回与发送,分别是前进与后退,它是流程引擎的基础功能操作,流程的退回根据不同的应用场景,也是需要不同的方式来控制,我们把这些方式叫做规则处理. 退回工作的场景相对复杂,由于与审核 ...
- Junit借助Groboutils Core进行并发测试
本文参考:http://www.voidcn.com/article/p-ybnvuffh-ke.html:转载请注明出处 junit是无法进行并发测试,但是又有需要并发测试的场景怎么办呢?此时可以借 ...