Notice
Recent Posts
Recent Comments
Link
«   2026/06   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

dh-winternagi 님의 블로그

(2563) 색종이 본문

백준 (C++)/Solve

(2563) 색종이

dh-winternagi 2026. 4. 11. 08:42

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