dh-winternagi 님의 블로그
(2563) 색종이 본문
https://www.acmicpc.net/problem/2563
단계별로 풀어보기
7단계(2차원 배열) 4번째

#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector v(100, vector<bool> (100, false));
int n, ans= 0;
cin >> n;
while(n--){
int w, h;
cin >> w >> h;
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
v[w+i][h+j]= true;
}
}
}
for(int i=0;i<100;i++){
for(int j=0;j<100;j++){
ans+= v[i][j];
}
}
cout << ans;
return 0;
}'백준 (C++) > Solve' 카테고리의 다른 글
| (11005) 진법 변환 2 (0) | 2026.04.11 |
|---|---|
| (2745) 진법 변환 (0) | 2026.04.11 |
| (10798) 세로읽기 (0) | 2026.04.11 |
| (2566) 최댓값 (0) | 2026.04.11 |
| (2738) 행렬 덧셈 (0) | 2026.04.11 |
