結果

問題 No.369 足し間違い
ユーザー YamaKasaYamaKasa
提出日時 2018-05-03 22:33:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 4,917 ms
コンパイル使用メモリ 71,124 KB
実行使用メモリ 59,404 KB
最終ジャッジ日時 2023-09-10 09:24:51
合計ジャッジ時間 4,225 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,720 KB
testcase_01 AC 120 ms
55,836 KB
testcase_02 AC 117 ms
56,160 KB
testcase_03 AC 127 ms
55,556 KB
testcase_04 AC 237 ms
59,404 KB
testcase_05 AC 187 ms
58,492 KB
testcase_06 AC 228 ms
59,124 KB
testcase_07 AC 239 ms
59,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int []A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = scan.nextInt();
		}
		int v = scan.nextInt();
		scan.close();
		int sum = 0;
		for(int i = 0; i < N; i++) {
			sum += A[i];
		}
		System.out.println(sum - v);
	}
}
0