結果

問題 No.369 足し間違い
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-01 16:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 3,758 ms
コンパイル使用メモリ 72,488 KB
実行使用メモリ 52,392 KB
最終ジャッジ日時 2023-08-09 23:16:06
合計ジャッジ時間 5,064 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,248 KB
testcase_01 AC 44 ms
49,268 KB
testcase_02 AC 44 ms
49,284 KB
testcase_03 AC 44 ms
49,172 KB
testcase_04 AC 83 ms
52,292 KB
testcase_05 AC 53 ms
50,644 KB
testcase_06 AC 83 ms
52,392 KB
testcase_07 AC 83 ms
52,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No369 {

	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int N = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] num = new int[N];
			int sum =0;
			for(int i=0; i < N; i++){
				num[i] = Integer.parseInt(str[i]);
				sum += num[i];
			}
			int v = Integer.parseInt(br.readLine());
			System.out.println(sum - v);
			
		}catch(IOException e){
			e.getStackTrace();
		}catch(NumberFormatException e){
			e.getStackTrace();
		}
	}
}
0