結果

問題 No.369 足し間違い
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-01 16:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 2,739 ms
コンパイル使用メモリ 73,444 KB
実行使用メモリ 39,864 KB
最終ジャッジ日時 2024-04-27 17:28:39
合計ジャッジ時間 3,667 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
36,968 KB
testcase_01 AC 43 ms
36,872 KB
testcase_02 AC 43 ms
37,004 KB
testcase_03 AC 43 ms
36,524 KB
testcase_04 AC 82 ms
39,660 KB
testcase_05 AC 50 ms
36,944 KB
testcase_06 AC 85 ms
39,864 KB
testcase_07 AC 85 ms
39,860 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