http://codeforces.com/contest/615/problem/A
读错题 结果发现是无脑题 直接标记统计
#include<cstdio> #include<map> #include<vector> #include<stack> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<cstdlib> #include<climits> #define PI acos(-1.0) #define INF 0x3fffffff using namespace std; typedef long long ll; typedef __int64 int64; const ll MOD=1e9+7; const int64 Mod=1e9+7; const double eps=1e-9; const int N= 110; const int MAXN= 1; typedef int rl; //这里更改输入挂类型 inline void r(rl&num){ num=0;rl f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar(); num*=f; } bool vis[N]; int main() { int n,m,tem,t,sum=0;; r(n);r(m); while(n--) { r(tem); while(tem--) { r(t); if(!vis[t]){ sum++; vis[t]=1; } } } if(sum==m) printf("YES "); else printf("NO "); return 0; }