You are viewing a single comment's thread. Return to all comments →
map map1; string x; int n,k,y; cin>>n; while(n--){ cin>>k; if(k==1){ cin>>x; cin>>y; if(map1.count(x)==1){ y+=map1[x]; map1[x]=y; }else{ map1[x]=y; } } else if(k==2){ cin>>x; map1[x]=0; } else if(k==3){ cin>>x; cout<
Seems like cookies are disabled on this browser, please enable them to open this website
Maps-STL
You are viewing a single comment's thread. Return to all comments →
map map1; string x; int n,k,y; cin>>n; while(n--){ cin>>k; if(k==1){ cin>>x; cin>>y; if(map1.count(x)==1){ y+=map1[x]; map1[x]=y; }else{
map1[x]=y; } } else if(k==2){ cin>>x; map1[x]=0; } else if(k==3){ cin>>x; cout<