# Codeforces Round #438 C.Qualification Rounds（状态压缩再枚举状态）

#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#define Max(a,b) a>b?a:b
#define Min(a,b) a>b?b:a
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
int dir[4][2]= {{1,0},{-1,0},{0,1},{0,-1}};
const double eps = 1e-6;
const double Pi = acos(-1.0);
const int INF=0x3f3f3f3f;
const int MOD = 1e9+7;
const int maxn = 1e5+10;
int mat[maxn][4],num[4];
int main(){
int n,k;
int state,x;
int vis[20];
while(~scanf("%d%d",&n,&k)){
mem(vis,0);
for(int i = 0; i < n; i++){
state = 0;
for(int j = 0; j < k; j++){
scanf("%d",&x);
state += (1 << j) * x;
}
vis[state] = 1;
}
bool flag = false;
for(int i = 0; i < 16; i++){
for(int j = 0; j < 16; j++){
if(vis[i] && vis[j] && (i & j) == 0){
flag = true;
}
}
}
if(flag) puts("YES");
else puts("NO");
}
return 0;
}

• 本文已收录于以下专栏：

## Codeforces Round 580 D. Kefa and Dishes （状态压缩dp）

D. Kefa and Dishes time limit per test 2 seconds memory limit per test 256 megabytes input sta...

## Codeforces Round #235 (Div. 2) D. Roman and Numbers 解题报告（状态压缩）

D. Roman and Numbers time limit per test 4 seconds memory limit per test 512 megabytes ...
• kbdwo
• 2014-03-11 15:39
• 985

## Codeforces Gym - 101059C Gangsters [状态压缩]

Codeforces Gym - 101059C Gangsters [状态压缩]

## Codeforces 8C Looking for Order（状态压缩DP）

Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting...

举报原因： 您举报文章：深度学习：神经网络中的前向传播和反向传播算法推导 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)