結果

問題 No.369 足し間違い
ユーザー ontama_12ontama_12
提出日時 2016-09-23 11:06:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 74,520 KB
実行使用メモリ 46,636 KB
最終ジャッジ日時 2024-04-28 21:26:35
合計ジャッジ時間 4,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,280 KB
testcase_01 AC 133 ms
41,280 KB
testcase_02 AC 130 ms
41,312 KB
testcase_03 AC 133 ms
41,376 KB
testcase_04 AC 254 ms
46,076 KB
testcase_05 AC 199 ms
42,400 KB
testcase_06 AC 246 ms
45,524 KB
testcase_07 AC 272 ms
46,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
//入力文字をの読み取り
    	Scanner sc = new Scanner(System.in);
        //1文字目
        long n = sc.nextLong();
        //正しい合計値
        long sum =0;
        //2文字目以降を合計
        for(int i=0;i<n;i++){
        	sum+=sc.nextLong();
        }
        
        //間違いとの誤差
        long result = sum-sc.nextLong();
        //出力
        	System.out.println(result);
    }
}
0