cf B. Berland Bingo
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的更多相关文章
- CF 370B Berland Bingo
题目链接: 传送门 Berland Bingo time limit per test:1 second memory limit per test:256 megabytes Descrip ...
- CF 217 B. Berland Bingo
http://codeforces.com/contest/370/problem/B 题意 :呃,这个题我说不清楚....就是有n个人,第 i 个人手里有 mi 张牌,如果,现在主人念数,念到哪张牌 ...
- B. Berland Bingo
Lately, a national version of a bingo game has become very popular in Berland. There are n players p ...
- Edu Cf Round 105 (Div. 2) B. Berland Crossword 1.读懂题, 2. 思维
一. 原题链接 https://codeforces.com/contest/1494/problem/B 二. 题意 + 题解: 没看懂题目, 懵了好久, 先狡辩一下当时误解的句子, 英语是硬伤 ...
- CF #375 (Div. 2) D. bfs
1.CF #375 (Div. 2) D. Lakes in Berland 2.总结:麻烦的bfs,但其实很水.. 3.题意:n*m的陆地与水泽,水泽在边界表示连通海洋.最后要剩k个湖,总要填掉多 ...
- [CF1005F]Berland and the Shortest Paths_最短路树_堆优化dij
Berland and the Shortest Paths 题目链接:https://www.codeforces.com/contest/1005/problem/F 数据范围:略. 题解: 太鬼 ...
- ATC/TC/CF
10.25 去打 CF,然后被 CF 打了. CF EDU 75 A. Broken Keyboard 精神恍惚,WA 了一发. B. Binary Palindromes 比赛中的憨憨做法,考虑一个 ...
- CF round #622 (div2)
CF Round 622 div2 A.简单模拟 B.数学 题意: 某人A参加一个比赛,共n人参加,有两轮,给定这两轮的名次x,y,总排名记为两轮排名和x+y,此值越小名次越前,并且对于与A同分者而言 ...
- 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 ...
随机推荐
- LibCurl编程手册以及代码实例
1. LibCurl编程流程 在基于LibCurl的程序里,主要采用callback function (回调函数)的形式完成传输任务,用户在启动传输前设置好各类参数和回调函数,当满足条件时libcu ...
- cf435C Cardiogram
C. Cardiogram time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- 护肤品总结 Skin Care (1)
很久没有更博了,最近过年在家,就写些生活上面的总结吧- 从护肤品开始,接下来陆陆续续会有化妆品,北美生活购物等. 因为是学生党,所以此帖中的东西基本都是价钱适中.因为经常买买买,所以用的好的坏的都会在 ...
- [LeetCode] 21. Merge Two Sorted Lists 解题思路
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t ...
- Swing UI - 可收起与开展内容面板实现演示
基于JAVA Swing实现的自定义组件可折叠的JPanel组件 基本思想: 可折叠面板,分为两个部分-头部面板与内容面板 头部面板– 显示标题,以及对应的icon图标,监听鼠标事件决定内容面板隐藏或 ...
- MYSQL触发器学习笔记
课程学至金色晨曦科技公司技术总监沙利穆 触发器 1. 什么是触发器 触发器是一种特殊类型的存储过程,不由用户直接调用.创建触发器时会对其进行定义,以便在对特定表或列作特定类型的数据修改时执 ...
- 关闭myeclipse中jsp的校验功能
window--->preference--->Myeclipse--->Validation,取消下图红框中的选中状态.
- Hadoop 类Grep源代码注释
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agree ...
- Android的Recovery中font_10x10.h字库文件制作
任务是要汉化Android中的Recovery,就了解了bootable/recovery/minui/font_10x18.h这个英文字库的来历,最终汉化的时候并没有自己汉字字库,用的github上 ...
- 升级Android ADT 和SDK
因为眼下从事android开发工作,所以升级了下Android SDK和eclipse ADT插件 一.更新ADT 1.Eclipse中打开Help->Install New Software. ...