#include <bits/stdc++.h>
// #include <windows.h>
#define int long long
using namespace std;
signed main()
{
// SetConsoleOutputCP(65001);
int n;
cin>>n;
map<string ,int>mp;
while(n--)
{
// cout<<endl<<"size: "<<mp.size()<<endl;
int a;
cin>>a;
if(a==1)//insert
{
string name;
int score;
cin>>name>>score;
mp[name]=score;
cout<<"OK\n";
}
if(a==2)//search
{
string name;
cin>>name;
if(mp.count(name))
{
cout<<mp[name];
}
else{
cout<<"Not found";
}
cout<<endl;
}
if(a==3)//dele
{
string name;
cin>>name;
if(mp[name])
{
mp.erase(mp.find(name));
cout<<"Deleted successfully";
}
else
{
cout<<"Not found";
}
cout<<endl;
}
if(a==4)//sumup
{
cout<<mp.size()<<endl;
}
}
return 0;
}
求大佬救命,看了一晚上了,找出了map查询的时候空的会自增,解决了,但是提交的时候又是0分 由于看样例的次数在别的题目上用掉了,我也不知道我错在哪里了