产生冠军set容器
2015-05-31 23:47
302 查看
http://acm.hdu.edu.cn/showproblem.php?pid=2094
#include<iostream>
#include<string>
#include<set>
using namespace std;
int main()
{
// freopen("C:\\Users\\John\\Desktop\\hi.txt","r",stdin);
int n;
while(cin>>n,n)
{
set<string>player,loser;
string win,lose;
while(n--)
{
cin>>win>>lose;
player.insert(win);
player.insert(lose);
loser.insert(lose);
}
int sign;
if(player.size()-loser.size()==1)
sign=1;
else
sign=0;
cout<<(sign==1?"Yes":"No")<<endl;
}
return 0;
}
http://acm.hdu.edu.cn/showproblem.php?pid=2094
#include<iostream>
#include<string>
#include<set>
using namespace std;
int main()
{
// freopen("C:\\Users\\John\\Desktop\\hi.txt","r",stdin);
int n;
while(cin>>n,n)
{
set<string>player,loser;
string win,lose;
while(n--)
{
cin>>win>>lose;
player.insert(win);
player.insert(lose);
loser.insert(lose);
}
int sign;
if(player.size()-loser.size()==1)
sign=1;
else
sign=0;
cout<<(sign==1?"Yes":"No")<<endl;
}
return 0;
}
相关文章推荐
- 搭建OpenWrt开发环境(包括编译过程)
- HDU_5249(百度之星D题)
- 有了SQLService的基础,轻松学习Oracle
- 测试计划
- kb-07线段树-12--二分查找区间边界
- C++中调用开源库路径问题
- hdu 1022 Train Problem I (栈的应用)
- SRS文档
- 第一次接触MVC Models概念
- ubuntu配置JDK
- 导航条的设计与实现
- 深入理解java多线程中的join()
- 用文件的读写和string作为临时存储区复制图片文件
- 关于如何修改weblogic用户密码的问题
- php中一个完整表单处理实现代码
- SRS文档
- 数据库设计(2)_逻辑结构设计
- 如何编译openwrt
- 浅谈委托和事件(一)
- 浮动与定位