Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<map>
- #include<string>
- using namespace std;
- int main()
- {
- map<string,long long int>m;
- int i,x,n,y,j,c=0;
- string a,b;
- cin>>n;
- string str,str2;
- for(i=0;i<n;i++)
- {
- cin>>x;
- if(x==0)
- {
- cin>>str>>y;
- m[str]=y;
- c++;
- }
- else if(x==1)
- {
- cin>>str2;
- cout<<m[str2]<<endl;
- }
- else if (x==2)
- {
- cin>>str;
- m[str]=0;
- }
- else
- {
- cin>>a>>b;
- for(auto it=m.lower_bound(a);it!=m.upper_bound(b);++it)
- {
- cout<<it->first<<" "<<it->second<<endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement