Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<set>
- #include<map>
- using namespace std;
- /*5
- A 3
- B 5
- C 2
- D 9
- E 4
- 3 7*/
- int main()
- {
- map<int,string> m;
- int N;
- cin>>N;
- for(int i=0;i<N;i++)
- {
- int key;
- string value;
- cin>>value>>key;
- m[key]=value;
- }
- int start,stop;
- cin>>start>>stop;
- for(map<int,string>::iterator it = m.lower_bound(start); it !=m.upper_bound(stop);it++)
- {
- //cout<< it->first<<"\n";
- cout<<it->second<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment