您的位置:首页 > 其它

产生冠军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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: