- 난이도: 브론즈 1
- 알고리즘: 배열, 구현
중복 처리를 위해 set 컨테이너를 이용하였다. 구현 방법도 다양해서 별로 어렵진 않은 문제였다.
#include <iostream>
#include <set>
using namespace std;
int main() {
cin.tie(NULL);
cout.tie(NULL);
std::ios::sync_with_stdio(false);
int x, y, w, h;
set<pair<int, int>> pairs;
for (int i = 0; i < 4; i++) {
cin >> x >> y >> w >> h;
for (int j = x; j < w; j++) {
for (int k = y; k < h; k++) {
pairs.insert(pair<int, int>(j, k));
}
}
}
cout << pairs.size();
}