Search
Duplicate
🍋

색종이

주차
19
문제번호
언어
C++
티어
실버
유형
구현
nj_Blog
nj_상태
이해도
풀이
풀이 X
사람
13 more properties

Memo

Code

제출 날짜

@5/7/2021

메모리

2148 KB

시간

0 ms
#include <iostream> #include <vector> int n, result; std::vector<std::vector<int > > paper; std::vector<std::pair<int, int> > torwhddl; void output() { for(auto &i : paper) for(auto &j : i) if(j) ++result; std::cout << result; } void solution() { for(auto &i : torwhddl) for (auto x = i.first ; x < i.first + 10 ; ++x) for (auto y = i.second ; y < i.second + 10 ; ++y) paper[x][y] = 1; } void input() { std::cin >> n; torwhddl.resize(n); for(auto& i: torwhddl) std::cin >> i.first >> i.second; paper = std::vector(100, std::vector(100, 0)); } void preset() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); } int main() { preset(); input(); solution(); output(); }
C++
복사