标签:pop cin center title secret get 保存 java chmod
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 123800 Accepted Submission(s): 48826
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 map<string,int>ballon; 6 int n; 7 string str; 8 while(cin>>n&&n) 9 { 10 ballon.clear(); 11 while(n--) 12 { 13 cin>>str; 14 ballon[str]++; 15 } 16 int maxn=0; 17 string maxcolor; 18 map<string,int>::iterator it; 19 for(it=ballon.begin();it!=ballon.end();it++) 20 { 21 if(it->second>maxn) 22 { 23 maxn=(*it).second; 24 maxcolor=(*it).first; 25 } 26 } 27 cout<<maxcolor<<endl; 28 } 29 return 0; 30 }
HDU 1004 Let the Balloon Rise【STL<map>】
标签:pop cin center title secret get 保存 java chmod
原文地址:http://www.cnblogs.com/ECJTUACM-873284962/p/7214568.html