結果

問題 No.369 足し間違い
ユーザー samplelpmassamplelpmas
提出日時 2016-12-30 10:11:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 234 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 3,120 ms
コンパイル使用メモリ 71,740 KB
実行使用メモリ 59,592 KB
最終ジャッジ日時 2023-08-22 01:46:08
合計ジャッジ時間 4,859 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,740 KB
testcase_01 AC 111 ms
55,704 KB
testcase_02 AC 115 ms
56,208 KB
testcase_03 AC 123 ms
56,184 KB
testcase_04 AC 226 ms
59,592 KB
testcase_05 AC 183 ms
58,208 KB
testcase_06 AC 224 ms
58,980 KB
testcase_07 AC 234 ms
59,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        int trueAnswer = 0;

        for (int i = 0; i < N; i++) {
            trueAnswer += sc.nextInt();
        }

        int yukiAnswer = sc.nextInt();

        int diff = trueAnswer - yukiAnswer;

        System.out.println(diff);

    }

}
0