Created
May 8, 2018 11:34
-
-
Save BrendenHJH/a21d14a6c41cab38f8e358d04330dd7f to your computer and use it in GitHub Desktop.
백준 2563 색종이
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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