結果

問題 No.369 足し間違い
ユーザー yagi2yagi2
提出日時 2017-04-17 16:29:25
言語 Java19
(openjdk 21)
結果
AC  
実行時間 221 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 2,449 ms
コンパイル使用メモリ 73,552 KB
実行使用メモリ 59,440 KB
最終ジャッジ日時 2023-09-26 10:41:45
合計ジャッジ時間 4,333 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,728 KB
testcase_01 AC 117 ms
55,628 KB
testcase_02 AC 116 ms
55,592 KB
testcase_03 AC 124 ms
55,556 KB
testcase_04 AC 220 ms
59,196 KB
testcase_05 AC 183 ms
54,056 KB
testcase_06 AC 211 ms
59,288 KB
testcase_07 AC 221 ms
59,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());

        BigInteger ans = BigInteger.ZERO;
        for (int i = 0; i < N; i++) {
            ans = ans.add(new BigInteger(sc.next()));
        }

        BigInteger V = new BigInteger(sc.next());

        System.out.println(ans.subtract(V));
    }
}
0