結果

問題 No.1389 Clumsy Calculation
ユーザー xRS43BofaUEZ5gcxRS43BofaUEZ5gc
提出日時 2021-03-05 09:32:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 866 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 3,743 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 57,244 KB
最終ジャッジ日時 2024-04-15 22:36:48
合計ジャッジ時間 19,927 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
39,896 KB
testcase_01 AC 128 ms
41,388 KB
testcase_02 AC 124 ms
40,908 KB
testcase_03 AC 210 ms
44,316 KB
testcase_04 AC 205 ms
44,712 KB
testcase_05 AC 212 ms
45,576 KB
testcase_06 AC 213 ms
44,740 KB
testcase_07 AC 208 ms
44,604 KB
testcase_08 AC 114 ms
40,324 KB
testcase_09 AC 866 ms
57,244 KB
testcase_10 AC 675 ms
51,744 KB
testcase_11 AC 194 ms
43,536 KB
testcase_12 AC 201 ms
43,968 KB
testcase_13 AC 195 ms
43,024 KB
testcase_14 AC 711 ms
53,728 KB
testcase_15 AC 712 ms
53,284 KB
testcase_16 AC 701 ms
53,560 KB
testcase_17 AC 762 ms
53,404 KB
testcase_18 AC 742 ms
53,620 KB
testcase_19 AC 718 ms
53,320 KB
testcase_20 AC 799 ms
53,588 KB
testcase_21 AC 773 ms
53,392 KB
testcase_22 AC 760 ms
53,732 KB
testcase_23 AC 715 ms
53,696 KB
testcase_24 AC 766 ms
53,448 KB
testcase_25 AC 771 ms
53,592 KB
testcase_26 AC 750 ms
53,564 KB
testcase_27 AC 704 ms
53,028 KB
testcase_28 AC 736 ms
54,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	int n = sc.nextInt();
	    	int x = sc.nextInt();
	    	int sum = 0;

	    	for (int i=0; i < n; i ++) {
	    		sum += sc.nextInt();
	    	}
	    	sc.close();

	    	System.out.println(- (n - 1) * x + sum);
	    	}

	    }
0