Skip to content

Instantly share code, notes, and snippets.

@BrendenHJH
Created May 8, 2018 11:34
Show Gist options
  • Save BrendenHJH/a21d14a6c41cab38f8e358d04330dd7f to your computer and use it in GitHub Desktop.
Save BrendenHJH/a21d14a6c41cab38f8e358d04330dd7f to your computer and use it in GitHub Desktop.
백준 2563 색종이
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] map = new int[100][100];
int cnt = 0;
for(int i = 0; i < n; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
for(int j = x; j < x + 10; j++) {
for(int k = y; k < y + 10; k++) {
if(map[j][k] == 1)
continue;
map[j][k] = 1;
++cnt;
}
}
}
System.out.println(cnt);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment