#include<limits>
#include<iostream>
#include<unordered_map>
using namespace std;
int main(){
unordered_map<string,string>account;
string a,b;char c;
int n;cin>>n;
while(n--){
cin>>c>>a>>b;
if(c=='N'){
if(account.count(a))
cout<<"ERROR: Exist"<<endl;
else{
account[a]=b;
cout<<"New: OK"<<endl;}
}else{
if(0==account.count(a))
cout<<"ERROR: Not Exist"<<endl;
else if(account[a]==b)
cout<<"Login: OK"<<endl;
else
cout<<"ERROR: Wrong PW"<<endl;
}//else
}
return 0;
}
使用带映射的哈希表表示账户