Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define TAM 200010
- #define endl << '\n'
- #define SYNC ios::sync_with_stdio(0);
- #define $ << ' ' <<
- using namespace std;
- int main()
- {
- SYNC
- map<int, int> net, comp, out;
- int n, c;
- cin >> c >> n;
- int id, vs;
- while (c--) {
- cin >> id >> vs;
- comp[id] = vs;
- }
- while (n--) {
- cin >> id >> vs;
- net[id] = max(net[id], vs);
- }
- for (auto a : net) {
- if (comp.find(a.first) != comp.end()) {
- if (comp[a.first] < a.second){
- cout << a.first << ' ' << a.second << '\n';
- }
- } else {
- cout << a.first $ a.second endl;
- }
- }
- // for (auto a : out) {
- // cout << a.first << ' ' << a.second << '\n';
- // }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment