map不太熟,T6再次爆零WA求调

#include<bits/stdc++.h>
using namespace std; 
map<int,int> mp;
int q;
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int op,x,y;
	cin>>q;
	while(q--){
		cin>>op;
		if(op==1){
			cin>>x>>y;
			if(!mp.count(x)) mp[x]=x;
			else mp[x]-=y;
		}else{
			cin>>x;
			if(!mp.count(x)) cout<<"NO\n";
			else cout<<"YES\n";
		}
	}
	map<int,int>::iterator it;
	for(it=mp.begin();it!=mp.end();it++){
		cout<<it->first<<" "<<it->second<<endl;
	}
    return 0;
}


写y

不排除有其他错误

一个新班?????

mp[x]+=y

是的