标签:time 产生 color desc java div ios std weight
3 Alice Bob Smith John Alice Smith 5 a c c d d e b e a d 0
Yes No
#include<iostream> #include<string> #include<set> #include<cstdio> using namespace std; int main() { set<string>shu,ying; string a1,a2; int i,n; set<string>::iterator k; while(scanf("%d",&n),n) { shu.clear(); ying.clear(); for(i=1;i<=n;i++) { cin>>a1>>a2; ying.insert(a1); shu.insert(a2); } for(k=shu.begin();k!=shu.end();k++) { if(ying.count(*k)) ying.erase(*k); } if(ying.size()==1) printf("Yes\n"); else printf("No\n"); } return 0; }
标签:time 产生 color desc java div ios std weight
原文地址:http://www.cnblogs.com/wzjhoutai/p/6852512.html