eloquence79 [BOJ 7569번] 토마토(JAVA) www.acmicpc.net/problem/7569 7569번: 토마토 첫 줄에는 상자의 크기를 나타내는 두 정수 M,N과 쌓아올려지는 상자의 수를 나타내는 H가 주어진다. M은 상자의 가로 칸의 수, N은 상자의 세로 칸의 수를 나타낸다. 단, 2 ≤ M ≤ 100, 2 ≤ N ≤ 100, www.acmicpc.net import java.io.*; import java.util.*; class Dot{ int x, y, z; Dot(int z, int x, int y){ this.x=x; this.y=y; this.z=z; } } class Main{ static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); stati.. 2020. 9. 24. [BOJ 7576번] 토마토(JAVA) www.acmicpc.net/problem/7576 7576번: 토마토 첫 줄에는 상자의 크기를 나타내는 두 정수 M,N이 주어진다. M은 상자의 가로 칸의 수, N은 상자의 세로 칸의 수를 나타낸다. 단, 2 ≤ M,N ≤ 1,000 이다. 둘째 줄부터는 하나의 상자에 저장된 토마토� www.acmicpc.net import java.io.*; import java.util.*; class Dot{ int x, y; Dot(int x, int y){ this.x=x; this.y=y; } } class Main{ static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw=new.. 2020. 9. 23. [BOJ 2178번] 미로탐색(JAVA) www.acmicpc.net/problem/2178 2178번: 미로 탐색 첫째 줄에 두 정수 N, M(2 ≤ N, M ≤ 100)이 주어진다. 다음 N개의 줄에는 M개의 정수로 미로가 주어진다. 각각의 수들은 붙어서 입력으로 주어진다. www.acmicpc.net import java.io.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; class Main{ static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw=new BufferedWriter(new OutputSt.. 2020. 9. 22. [BOJ 1012번] 유기농 배추(C++) www.acmicpc.net/problem/1012 1012번: 유기농 배추 차세대 영농인 한나는 강원도 고랭지에서 유기농 배추를 재배하기로 하였다. 농약을 쓰지 않고 배추를 재배하려면 배추를 해충으로부터 보호하는 것이 중요하기 때문에, 한나는 해충 방지에 � www.acmicpc.net #include int arr[52][52] = { 0 }; void dfs(int x, int y) { arr[y][x] = 0; if (arr[y][x+1] == 1) dfs(x + 1, y); if (arr[y][x - 1] == 1) dfs(x - 1, y); if (arr[y+1][x] == 1) dfs(x, y + 1); if (arr[y-1][x] == 1) dfs(x, y - 1); } int main(v.. 2020. 9. 21. 이전 1 2 3 4 5 6 7 ··· 20 다음