結果

問題 No.1139 Slime Race
ユーザー face4
提出日時 2020-08-07 08:53:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 581 bytes
コンパイル時間 2,084 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 53,712 KB
最終ジャッジ日時 2024-07-02 08:30:24
合計ジャッジ時間 6,694 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int d = Integer.parseInt(line[1]);
        br.readLine();
        line = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < n; i++){
            if(sum >= d) break;
            sum += Integer.parseInt(line[i]);
        }
        System.out.println((d+sum-1)/sum);
    }
}
0