|
|
вернуться в форумhelp me!! WA #include <iostream> #include <string> #include <algorithm> #include <map> using namespace std; int main() { int n; map <string , string> user; map <string , string > ::iterator it; string name , er , ti ; cin >> n; for(int i = 0 ; i < n ; i++) { cin >> name >> er; if(er == "CE") { it = user.find(name); if(it == user.end()) user[name] = "0"; } else if(er == "AC") { user[name] = "a"; } else { cin >> ti; it = user.find(name); if(it != user.end()) user[name] = max(ti, it->second); else user[name] = ti; } } //cout << " ^^^ " << user.size() << endl; it = user.begin(); int mx = 0 , mn = 0; while(it != user.end()) { //cout << "first == " << it->first << " second == " << it->second << endl; if(it->second == "6" || it->second == "a") mx++; if(it->second == "7") { mn++; mx++; } it++; } cout << mn << " " << mx << endl; return 0; } what the wrong !? |
|
|