結果

問題 No.369 足し間違い
ユーザー yamax3232yamax3232
提出日時 2017-02-15 19:01:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 6,460 ms
コンパイル使用メモリ 72,416 KB
実行使用メモリ 60,384 KB
最終ジャッジ日時 2023-08-28 17:25:15
合計ジャッジ時間 6,811 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,196 KB
testcase_01 AC 118 ms
56,012 KB
testcase_02 AC 117 ms
55,836 KB
testcase_03 AC 122 ms
56,256 KB
testcase_04 AC 234 ms
59,760 KB
testcase_05 AC 187 ms
60,384 KB
testcase_06 AC 241 ms
60,108 KB
testcase_07 AC 257 ms
59,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;

public class Addmiss {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
Scanner kb=new Scanner(System.in);
int sum=0;
int n=kb.nextInt();
int v;
ArrayList<Integer> al=new ArrayList<Integer>(n);
for(int i=0;i<n;i++){
	al.add(i,kb.nextInt());
	sum+=al.get(i);
}
v=kb.nextInt();

System.out.printf("%d\n",sum-v);
	}

}
0