题意:给你m个编号为1到m的灯泡;然后n行中每一行的第一个数给出打开灯泡的个数xi  然后是yij是每个灯泡的编号;

   题目中有一句话、 我愣是没看,因为我英语真的是一窍不通,看了也白看,直接看数据做的,就是因为这个送了2发;

   If Vasya presses the button such that some bulbs connected to it are already turned on, they do not change their state, i.e. remain turned on.

     这句话是说每次打开灯泡之后灯泡就保持打开的状态,即使一个编号的灯泡在不同的两行出现了 灯泡也是打开状态的;

   题目就问最后的灯泡最后是不是全是开打状态;  转化一下就是判断1到m个灯泡的编号是否都出现过;

    

 #include<bits/stdc++.h>
int num[];
using namespace std;
int main()
{
int n,m;
cin >> n >> m;
memset(num,,sizeof(num));
for(int j,i=;i<n;++i){
int x,y;
cin >> x;
for(int j=;j<x;++j){
cin >> y; num[y]++;
}
}
int p=;
for(int i=;i<=m;++i) if(num[i]==){p=;break;
}
if(p) cout << "YES\n";
else cout << "NO\n";
}

codeforces 615A的更多相关文章

  1. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  2. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  3. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  4. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  5. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  6. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

  7. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

  8. CodeForces - 696B Puzzles

    http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...

  9. CodeForces - 148D Bag of mice

    http://codeforces.com/problemset/problem/148/D 题目大意: 原来袋子里有w只白鼠和b只黑鼠 龙和王妃轮流从袋子里抓老鼠.谁先抓到白色老鼠谁就赢. 王妃每次 ...

随机推荐

  1. LintCode刷题笔记--Longest Increasing Subsequence

    标签: 动态规划 描述: Given a sequence of integers, find the longest increasing subsequence (LIS). You code s ...

  2. 使用nuxt.js官方脚手架构建koa2的es6编译问题

    最近在学用nuxt集成koa2做vue后台,发现官方自带脚手架搭建的koa2使用的仍是es5语法,如果想用es6怎么办呢? 这是由于自带脚手架在构建koa2时默认的nodemon是没有使用babel编 ...

  3. Codeforces 436C

    题目链接 C. Dungeons and Candies time limit per test 2 seconds memory limit per test 256 megabytes input ...

  4. bzoj1911 特别行动队

    Description Input Output Sample Input 4 -1 10 -20 2 2 3 4 Sample Output 9       斜率优化 推式子 #include< ...

  5. python 调用API时异常捕获的技巧

  6. 基于MaxCompute的数仓数据质量管理

    声明 本文中介绍的非功能性规范均为建议性规范,产品功能无强制,仅供指导. 参考文献 <大数据之路——阿里巴巴大数据实践>——阿里巴巴数据技术及产品部 著. 背景及目的 数据对一个企业来说已 ...

  7. MUI - 为textarea添加语音输入和清除的功能

    为textarea添加语音输入和清除的功能 mui支持input输入框语音输入和清除的功能,只需要添加相关css类即可. http://www.cnblogs.com/phillyx/ 代码如下 &l ...

  8. 【转载】Combination Sum

    Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combin ...

  9. pytest笔记

    -v 参数显示执行过程 测试覆盖率: ldy@ldy-D214:~/workspace/socai$ pipenv run pytest tests/unit/test_models.py --cov ...

  10. 微信服务号获得openid 跟用户信息

    https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxxxxxxxxxxxx&redirect_uri=http://www. ...