#include<bits/stdc++.h>
using namespace std;
multiset<int>a;
map<int,bool>b;
int n,i,x;
string s;
int main(){
cin>>n;
for(i=1;i<=n;i++){
cin>>s>>x;
if(s=="add"){
b[x]=1;
a.insert(x);
cout<<a.count(x)<<endl;
}
if(s=="del"){
cout<<a.count(x)<<endl;
a.erase(x);
}
if(s=="ask")
cout<<b[x]<<" "<<a.count(x)<<endl;
}
return 0;
}
Openjudge 3341 Set
最新推荐文章于 2023-07-06 14:03:01 发布