|
|
вернуться в форумWhy WA 15 ?????? #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n,k,mh=0,otg=999; string s; vector<int>v; cin>>k; for(int i=1;i<=k;i++) { cin>>n; cin>>s; if(s=="hungry") { if(n>mh) mh=n; } else v.push_back(n); } if(v.size()) { for(int i=0;i<v.size();i++) { if(v[i]>mh&&v[i]<otg) otg=v[i]; } if(otg==999) cout<<"Inconsistent"<<endl; else cout<<otg<<endl; } else cout<<"10"<<endl; return 0; } Edited by author 02.11.2010 12:52 Edited by author 02.11.2010 12:52 |
|
|