結果

問題 No.1389 Clumsy Calculation
ユーザー tentententen
提出日時 2021-02-14 19:24:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 751 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 3,729 ms
コンパイル使用メモリ 72,104 KB
実行使用メモリ 66,540 KB
最終ジャッジ日時 2023-09-29 11:45:40
合計ジャッジ時間 20,614 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,104 KB
testcase_01 AC 118 ms
55,700 KB
testcase_02 AC 118 ms
55,996 KB
testcase_03 AC 196 ms
58,856 KB
testcase_04 AC 199 ms
56,504 KB
testcase_05 AC 207 ms
58,804 KB
testcase_06 AC 200 ms
58,804 KB
testcase_07 AC 200 ms
58,972 KB
testcase_08 AC 119 ms
56,552 KB
testcase_09 AC 751 ms
64,684 KB
testcase_10 AC 584 ms
64,872 KB
testcase_11 AC 190 ms
58,244 KB
testcase_12 AC 198 ms
58,936 KB
testcase_13 AC 191 ms
58,804 KB
testcase_14 AC 674 ms
64,956 KB
testcase_15 AC 681 ms
64,608 KB
testcase_16 AC 666 ms
64,596 KB
testcase_17 AC 688 ms
64,528 KB
testcase_18 AC 681 ms
64,688 KB
testcase_19 AC 683 ms
64,360 KB
testcase_20 AC 685 ms
64,884 KB
testcase_21 AC 692 ms
64,720 KB
testcase_22 AC 687 ms
64,376 KB
testcase_23 AC 683 ms
64,328 KB
testcase_24 AC 689 ms
64,376 KB
testcase_25 AC 684 ms
64,444 KB
testcase_26 AC 670 ms
66,540 KB
testcase_27 AC 660 ms
64,932 KB
testcase_28 AC 697 ms
64,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextInt();
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += sc.nextInt();
        }
        System.out.println(sum - (n - 1) * x);
    }
}
0