Submission #198614

# Submission time Handle Problem Language Result Execution time Memory
198614 2020-01-26T23:16:33 Z ijxjdjd Bitaro the Brave (JOI19_ho_t1) Java 11
Compilation error
0 ms 0 KB
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class bitaro {
    static BufferedReader fin = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    public static void main(String[] args) throws IOException {
        st = new StringTokenizer(fin.readLine());
        int H = Integer.parseInt(st.nextToken());
        int W = Integer.parseInt(st.nextToken());
        char[][] board = new char[H][W];
        for (int i = 0; i < H; i++) {
            board[i] = fin.readLine().toCharArray();
        }
        int[] countI = new int[W];
        int[] countO = new int[H];
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (board[i][j] == 'O') {
                    countO[i]++;
                }
                else if (board[i][j] == 'I') {
                    countI[j]++;
                }
            }
        }
        long res = 0;
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (board[i][j] == 'J') {
                    res += countI[j]*countO[i];
                }
                else if (board[i][j] == 'O') {
                    countO[i]--;
                }
                else {
                    countI[j]--;
                }
            }
        }
        System.out.println(res);
    }
}

Compilation message

joi2019_ho_t1.java:7: error: class bitaro is public, should be declared in a file named bitaro.java
public class bitaro {
       ^
1 error