代码
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
multiset<int> s;
int n,x,f[100005];
char op[1000];
int main(){
cin>>n;
memset(f,0,sizeof(f));
while(n--){
scanf("%s%d",op,&x);
if(strcmp(op,"add")==0){
s.insert(x);
f[x]=1;
cout<<s.count(x)<<endl;
}
if(strcmp(op,"del")==0){
cout<<s.count(x)<<endl;
s.erase(x);
}
if(strcmp(op,"ask")==0){
cout<<f[x]<<" ";
cout<<s.count(x)<<endl;
}
}
}