Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- using namespace std;
- int main(){
- int c, j, x, y;
- map<int, int>::iterator it;
- map<int, int> total;
- scanf("%d %d", &c, &j);
- for(int i = 0; i < c; i++){
- scanf("%d %d", &x, &y);
- total.insert(make_pair(x, y));
- }
- for(int i = 0; i < j; i++){
- scanf("%d %d", &x, &y);
- if (total.find(x) != total.end()){
- if(y > total[x]){
- printf("%d %d\n", x, y);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement