这不是洛谷题库的一道题,我把题目直接用图片粘过来
#include<iostream>
#include<map>
using namespace std;
int n,t;
map<long long,pair<string,int> > mp;
int main()
{
cin>>t;
while(t--)
{
cin>>n;
if(n == 1)
{
long long xh;
string na;
int br;
cin>>xh>>na>>br;
if(mp[xh].second != ' ')
{
mp[br].second = br;
mp[xh].first = na;
}
mp[xh].second --;
}
if(n == 2)
{
long long xh;
cin>>xh;
if(mp[xh].first != " ")
{
mp[xh].first = " ";
}
mp[xh].second --;
}
if(n == 3)
{
long long xh;
cin>>xh;
if(mp[xh].first != " ")
{
cout<<"yes"<<endl;
}else
{
cout<<"no"<<endl;
}
}
if(n == 4)
{
int br;
cin>>br;
if(mp[br].second != ' ')
{
cout<<mp[br].second<<endl;
}
}
}
return 0;
}
这是我的代码,输出
yes
no
-1
1
1
请问哪里有问题呢?求助