diff --git "a/LiiNi-coder/202603/11 BOJ \355\226\211\354\204\261\355\203\220\354\202\254.md" "b/LiiNi-coder/202603/11 BOJ \355\226\211\354\204\261\355\203\220\354\202\254.md" new file mode 100644 index 00000000..a251d79e --- /dev/null +++ "b/LiiNi-coder/202603/11 BOJ \355\226\211\354\204\261\355\203\220\354\202\254.md" @@ -0,0 +1,53 @@ +```java +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main{ + public static void main(String[] args)throws IOException{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + int N = Integer.parseInt(st.nextToken()); + int M = Integer.parseInt(st.nextToken()); + int K = Integer.parseInt(br.readLine()); + int[][] J = new int[N+1][M+1]; + int[][] O = new int[N+1][M+1]; + int[][] I = new int[N+1][M+1]; + + + for(int r = 1; r<=N; r++){ + String line = br.readLine(); + for(int c = 1 ; c<=M; c++){ + char ch = line.charAt(c-1); + + J[r][c] = J[r-1][c] + J[r][c-1] - J[r-1][c-1]; + O[r][c] = O[r-1][c] + O[r][c-1] - O[r-1][c-1]; + I[r][c] = I[r-1][c] + I[r][c-1] - I[r-1][c-1]; + if(ch == 'J') + J[r][c]++; + else if(ch == 'O') + O[r][c]++; + else + I[r][c]++; + } + } + + StringBuilder sb = new StringBuilder(); + for(int i=0; i