Advertisement
Guest User

oioioiS2S2S2

a guest
Oct 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. int c, j, x, y;
  9. map<int, int>::iterator it;
  10. map<int, int> total;
  11.  
  12. scanf("%d %d", &c, &j);
  13.  
  14. for(int i = 0; i < c; i++){
  15. scanf("%d %d", &x, &y);
  16. total.insert(make_pair(x, y));
  17. }
  18.  
  19. for(int i = 0; i < j; i++){
  20. scanf("%d %d", &x, &y);
  21.  
  22. if (total.find(x) != total.end()){
  23.  
  24. if(y > total[x]){
  25. printf("%d %d\n", x, y);
  26. }
  27. }
  28. }
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement