-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava.java
More file actions
98 lines (90 loc) · 2.69 KB
/
java.java
File metadata and controls
98 lines (90 loc) · 2.69 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class java {
public static int R = 0;
public static int C = 0;
public static char[][] apartment = new char[R][C];
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] dimensions = bf.readLine().split(" ");
R = Integer.parseInt(dimensions[0]);
C = Integer.parseInt(dimensions[1]);
for (int i = 0; i < R; i++) {
String line = bf.readLine();
for (int j = 0; j < C; j++) {
apartment[i][j] = line.charAt(j);
}
}
//세팅
int maxPeople = 0;
int[] dx = {-1, 0, 1, 0};
int[] dy = {0, 1, 0, -1};
System.out.println(maxPeople);
}
public int get_width_to_rightside(int x, int y) {
for (int j = 0; j < C; j++) {
if(apartment[x][j] == 'X') {
j--;
break;
}
return j - y + 1;
}
return x;
}
public int set_width_to_rightside() {
int width = 0;
for (int i = 0; i < R; i++) {
int j = 0;
while (j<C) {
if(apartment[i][j] == '.') {
width =
}
}
}
return
}
}
// 한 점에 대한 가로방향 길이 2차원 배열
//메서드 분리 이전
// int[][] prefix_sum = new int[R][C];
//
// for (int i = 0; i < R; i++) {
// int j = 0;
// while(j<C) {
// if (apartment[i][j] == '.') {
// int width = 0;
//
// // 한 점에 대한 가로방향 길이 구하기
// for (int k = j; k < C; k++) {
// if (apartment[i][k] == 'x') {
// j -= 1;
// break;
// }
// width = k - j + 1;
// }
//
// while (width >0 ) {
// prefix_sum[i][j] = width;
//
// width --;
//
// }
//
// } else {
// j ++;
// }
//
// }
// }
// 특정 좌표에서의 오른쪽 길이배열 prefix_sum 을 통해 최대인원 계산
// for (int i = 0; i < R; i++) {
// for (int j = 0; j < C; j++) {
// // 해당 한 점을 집음
// if (apartment[i][j] == '.') {
//
// }
// maxPeople = (Math.max(maxPeople, perimeter) - 1) ;
// }
// }
// }