結果

問題 No.1808 Fullgold Alchemist
ユーザー tentententen
提出日時 2022-09-28 09:43:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,186 bytes
コンパイル時間 4,419 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 64,604 KB
最終ジャッジ日時 2023-08-24 04:17:17
合計ジャッジ時間 12,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,368 KB
testcase_01 AC 40 ms
49,456 KB
testcase_02 AC 41 ms
49,496 KB
testcase_03 AC 41 ms
49,808 KB
testcase_04 AC 40 ms
49,360 KB
testcase_05 AC 193 ms
56,272 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 45 ms
49,292 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 41 ms
49,312 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ans = Integer.MAX_VALUE;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += sc.nextInt();
            ans = Math.min(ans, sum / i / m);
        }
        System.out.println(ans);
    }
}
    
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0