Notice
Recent Posts
Recent Comments
Link
«   2025/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
관리 메뉴

hwooo

BOJ (C/C++) 2563번: 색종이 본문

Study/Algorithm

BOJ (C/C++) 2563번: 색종이

hwooo 2022. 10. 26. 04:35


코드

#include <stdio.h>
bool A[100][100];
int main() {
	int x, y, n, S = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d %d", &x, &y);
		for (int i = x; i < x + 10; i++) {
			for (int j = y; j < y + 10; j++) {
				A[i][j] = true;
			}
		}
	}

	for (int i =0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			if (A[i][j]) S++;
		}
	}
	printf("%d", S);
	return 0;
}