Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aer395;
- import java.util.Scanner;
- public class AER395 {
- static Scanner in = new Scanner(System.in);
- public static int cortes(boolean[][] tableta, int fini, int cini, int ffin, int cfin) {
- int chocos = 0;
- int almendras = 0;
- boolean trozoLimpio = true;
- int f = fini;
- while (trozoLimpio && f < ffin) {
- int c = cini;
- while (trozoLimpio && c < cfin) { {
- if (tableta[f][c]) {
- almendras++;
- } else {
- chocos++;
- }
- trozoLimpio = (chocos == 0 || almendras == 0);
- }
- }
- if (trozoLimpio) {
- return 0;
- } return
- }
- public static void caso() {
- int filas = in.nextInt();
- int columnas = in.nextInt();
- boolean[][] tableta = new boolean[filas][columnas];
- for (int f = 0; f < filas; f++) {
- String cadenaFila = in.next();
- for (int c = 0; c < columnas; c++) {
- tableta[f][c] = cadenaFila.charAt(c) == '#';
- }
- }
- }
- public static void main(String[] args) {
- while (in.hasNext()) {
- caso();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement