結果

問題 No.46 はじめのn歩
ユーザー fungsi
提出日時 2025-09-28 09:45:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 1,376 bytes
コンパイル時間 9,218 ms
コンパイル使用メモリ 79,124 KB
実行使用メモリ 43,080 KB
最終ジャッジ日時 2025-09-28 09:45:52
合計ジャッジ時間 8,894 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.DataInputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        Reader r = new Reader();
        int A = r.nextInt();
        int B = r.nextInt();
        System.out.println((B + A - 1) / A);
    }
    
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do { ret = ret * 10 + c - '0'; } 
            while ((c = read()) >= '0' && c <= '9');
            return neg ? -ret : ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1) buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead) fillBuffer();
            return buffer[bufferPointer++];
        }
    }
}
0