CSES - Datatähti 2023 loppu - Results
Submission details
Task:Ruudukko
Sender:Septicuss
Submission time:2023-01-21 16:15:38 +0200
Language:Java
Status:COMPILE ERROR

Compiler report

input/D.java:17: error: package A does not exist
    final static A.FastReader reader = new A.FastReader();
                  ^
input/D.java:17: error: package A does not exist
    final static A.FastReader reader = new A.FastReader();
                                            ^
input/D.java:142: error: cannot find symbol
                Logger.getLogger(A.class.getName()).log(Level.SEVERE, null, ex);
                                 ^
  symbol:   class A
  location: class FastReader
3 errors

Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

public class D {

    final static A.FastReader reader = new A.FastReader();
    final static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) {

        System.out.println(0 % 2);
        int n = reader.nextInt();
        int m = reader.nextInt();

        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++) {
            Arrays.fill(grid[i], '.');
        }

        if (n != 1) {
            outer:
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    if (n == 2) {
                        if (i == 0 && j % 2 == 0) {
                            grid[i][j] = '#';
                        }
                    }
                    if (n == 3) {
                        if ((i == 0 || i == n - 1) && j % 2 == 0) {
                            grid[i][j] = '#';
                        }
                    }
                    if (n == 4) {
                        if (m % 2 == 0) {
                            System.out.println("n = " + n + " j = " + j);
                            if (i == 0 && j == m - 1) {
                                grid[i][j] = '#';
                            } else if (i != 0 && i % 2 == 1 && j % 2 == 0) {
                                grid[i][j] = '#';
                            }

                        } else {
                            if (i != 0 && i % 2 == 1 && j % 2 == 0) {
                                grid[i][j] = '#';
                            }
                        }
                    }

                }
            }
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                writer.write(grid[i][j]);
            }
            writer.println();
        }

        writer.flush();
        writer.close();
    }

    static void draw(char[][] grid, int x, int y) {
        boolean wall = false;

        if (grid[x + 1][y] == '#') {
            if (x == 0 && y == 0) {
                grid[x][y] = '.';
            }
        }

    }

    static class Pair {

        int x;
        int y;

        public Pair(int x, int y) {
        }

    }

    static class FastReader {

        BufferedReader reader;
        StringTokenizer tokenizer;

        public FastReader() {
            this.reader = new BufferedReader(new InputStreamReader(System.in));
            this.tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {

                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        BigInteger nextBigInt() {
            return new BigInteger(next());
        }

        void close() {
            try {
                reader.close();
            } catch (IOException ex) {
                Logger.getLogger(A.class.getName()).log(Level.SEVERE, null, ex);
            }
            reader = null;
            tokenizer = null;
        }

    }

}