Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream in("billboard.in");
- ofstream out("billboard.out");
- int x1m, x2m, y1m, y2m, x1b, x2b, y1b, y2b;
- in >> x1m >> y1m >> x2m >> y2m >> x1b >> y1b >> x2b >> y2b;
- int cm = 0;
- int cmm = 0;
- vector < vector <char> > bill(2002, vector <char>(2002, '*'));
- for(int i = (x1m + 1000); i <= (x2m + 1000); i++)
- for(int j = (y1m + 1000); j <= (y2m + 1000); j++, cmm++)
- bill[i][j] = 'M';
- for(int i = (x1b + 1000); i <= (x2b + 1000); i++)
- for(int j = (y1b + 1000); j <= (y2b + 1000); j++)
- if(bill[i][j] == 'M')
- cm++;
- out << (cmm - cm) << endl;
- in.close();
- out.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement