Codeforce 868 C Qualification Rounds (计数原理)
来源:互联网 发布:微博怎么设置个性域名 编辑:程序博客网 时间:2024/05/18 22:15
we need a lot of patience on this question
:http://codeforces.com/problemset/problem/868/C
Let’s talk about the method ,we can only find two question that has no intersection then that ‘ll be it!
because we want to choose minimum of question.If we can chose one question that no team knows it , we can definitely chose it . And if there are two more question that make a good set ,just two of them is fine.
if we directly fin all the question , we will get a tle then we
can iter all the situation of teams knows problem
#include <bits/stdc++.h>#define ll long longusing namespace std;int cnt[20];int main(){ ios::sync_with_stdio(0); int x,n,k; cin>>n>>k; for(int i = 0;i<n;i++) { int s = 0; for(int j = 0;j<k;j++) { int x = 0; cin>>x; s = s * 2+x; } cnt[s]++; } for(int i = 0;i<(1<<k);i++) { for(int j = 0;j<(1<<k);j++) { if(cnt[i]>0&&cnt[j]>0 && (i&j) == 0) { return cout<<"YES"<<endl,0; } } } cout<<"NO"<<endl; return 0;}
阅读全文
0 0
- Codeforce 868 C Qualification Rounds (计数原理)
- Codeforces 868 C. Qualification Rounds (技巧)
- Codeforces 868 C Qualification Rounds
- codeforces 868C Qualification Rounds
- codeforces 868C Qualification Rounds
- Codeforces 868C Qualification Rounds
- Codeforces 868C Qualification Rounds
- CodeForces 868C Qualification Rounds
- codeforces 868C Qualification Rounds
- CF 868 C. Qualification Rounds 【状态压缩】
- Codeforces 868C Qualification Rounds【思维】
- Codeforces 868C Qualification Rounds 结论
- C. Qualification Rounds
- CF2017.10.5 C. Qualification Rounds
- Codeforces round438 C. Qualification Rounds
- codeforces 868C.Qualification Rounds(bitmasks与状压dp)
- Codeforces Round #438 C Qualification Rounds(暴力+位运算)
- CF868C:Qualification Rounds(思维)
- 2017 后端面试经历分享
- JS闭包
- 【计算机视觉】【神经网络与深度学习】深度学习在图像超分辨率重建中的应用
- 目录——Web第三阶段:Javascript
- es6新特性之generator
- Codeforce 868 C Qualification Rounds (计数原理)
- 多媒体编辑模块架构设计
- HDU5655
- 达内课程-高级流/操作流BufferedOutputStream/BufferedInputStream
- leetcode013-Maximal Square(dp)
- Django的国际化
- 对象构造和初始化
- hexo yilia主题添加文章访问量统计
- intellij tab键改为4个空格