http://codeforces.com/contest/370/problem/B

题意:给你n个卡片,卡片上有m个不同的数字,这个游戏是随即的从袋子里面抽球,球上有数字1-100;如果第ith玩家比起他人卡片上的数字早读出来,就输出YES,有多个就输出NO。

 #include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#define maxn 100000
using namespace std; int n;
vector<int>g[maxn];
int ans[maxn]; bool deal(int c1,int c2)
{
for(int i=; i<(int)g[c1].size(); i++)
{
bool flag=false;
for(int j=; j<(int)g[c2].size(); j++)
{
if(g[c1][i]==g[c2][j])
{
flag=true;
}
}
if(!flag) return false;
}
return true;
} int main()
{
while(scanf("%d",&n)!=EOF)
{
for(int i=; i<=n; i++)
{
g[i].clear();
}
for(int i=; i<=n; i++)
{
int num;
scanf("%d",&num);
for(int j=; j<=num; j++)
{
int x;
scanf("%d",&x);
g[i].push_back(x);
}
}
for(int i=; i<=n; i++)
{
ans[i]=;
}
for(int i=; i<=n; i++)
{
for(int j=i+; j<=n; j++)
{
if(deal(i,j)) ans[j]=;
if(deal(j,i)) ans[i]=;
}
}
for(int i=; i<=n; i++)
{
if(ans[i])
{
printf("YES\n");
}
else
printf("NO\n");
}
}
return ;
}

cf B. Berland Bingo的更多相关文章

  1. CF 370B Berland Bingo

    题目链接: 传送门 Berland Bingo time limit per test:1 second     memory limit per test:256 megabytes Descrip ...

  2. CF 217 B. Berland Bingo

    http://codeforces.com/contest/370/problem/B 题意 :呃,这个题我说不清楚....就是有n个人,第 i 个人手里有 mi 张牌,如果,现在主人念数,念到哪张牌 ...

  3. B. Berland Bingo

    Lately, a national version of a bingo game has become very popular in Berland. There are n players p ...

  4. Edu Cf Round 105 (Div. 2) B. Berland Crossword 1.读懂题, 2. 思维

    一. 原题链接 https://codeforces.com/contest/1494/problem/B   二. 题意 + 题解: 没看懂题目, 懵了好久, 先狡辩一下当时误解的句子, 英语是硬伤 ...

  5. CF #375 (Div. 2) D. bfs

    1.CF #375 (Div. 2)  D. Lakes in Berland 2.总结:麻烦的bfs,但其实很水.. 3.题意:n*m的陆地与水泽,水泽在边界表示连通海洋.最后要剩k个湖,总要填掉多 ...

  6. [CF1005F]Berland and the Shortest Paths_最短路树_堆优化dij

    Berland and the Shortest Paths 题目链接:https://www.codeforces.com/contest/1005/problem/F 数据范围:略. 题解: 太鬼 ...

  7. ATC/TC/CF

    10.25 去打 CF,然后被 CF 打了. CF EDU 75 A. Broken Keyboard 精神恍惚,WA 了一发. B. Binary Palindromes 比赛中的憨憨做法,考虑一个 ...

  8. CF round #622 (div2)

    CF Round 622 div2 A.简单模拟 B.数学 题意: 某人A参加一个比赛,共n人参加,有两轮,给定这两轮的名次x,y,总排名记为两轮排名和x+y,此值越小名次越前,并且对于与A同分者而言 ...

  9. ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'

    凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...

随机推荐

  1. git中的常用指令名及其意义

    add 添加新文件到 Git 代码仓库的索引中 $ git add filename mv 移动或重命名文件 $ git mv old-filename new-filename rm 从工作目录和 ...

  2. BZOJ2079: [Poi2010]Guilds

    2079: [Poi2010]Guilds Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 237  Solved: 181[Submit][Statu ...

  3. Linux内核定时器

    Linux使用struct    timer_list来描述一个定时器. 重要成员: expires:定时时长 *function:超时执行函数名使用流程: 1.定义定时器变量 /*定义定时器变量结构 ...

  4. cf500C New Year Book Reading

    C. New Year Book Reading time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

  5. UVA 11636 - Hello World! 水

    水题,贪心,dp都随意 /* author:jxy lang:C/C++ university:China,Xidian University **If you need to reprint,ple ...

  6. 简单的HDFS思维导图

  7. mybatis简单应用(基于配置文件)

    本文主要介绍了如何使用mybatis进行简单的数据库操作.本人使用的是mybatis3.05. 1.创建数据库表(User表) CREATETABLE `NewTable` (`userId` big ...

  8. coco2d-html5制作弹弓射鸟第一部分---橡皮筋

    一.写在前面的话 最近在学习cocos2d-html5方面的知识,一直想从事游戏方面的工作,自己也找了好多资料.网上关于cocos2d-html5的教程真的不多,也只有自己摸索,慢慢看示例代码.由于本 ...

  9. C++ operator关键字(重载操作符)(转)

    operator是C++的关键字,它和运算符一起使用,表示一个运算符函数,理解时应将operator=整体上视为一个函数名. 这是C++扩展运算符功能的方法,虽然样子古怪,但也可以理解:一方面要使运算 ...

  10. Drawable与Bitmap 自定义

    Drawable简介 Drawable是Android平下通用的图形对象,它可以装载常用格式的图像,比如GIF.PNG.JPG,当然也支持BMP.相比于View,我们并不需要去考虑如何measure. ...