結果

問題 No.693 square1001 and Permutation 2
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-06-08 23:04:31
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 5,014 ms
コンパイル使用メモリ 75,468 KB
実行使用メモリ 55,840 KB
最終ジャッジ日時 2023-09-13 00:09:44
合計ジャッジ時間 6,652 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,788 KB
testcase_01 AC 122 ms
55,668 KB
testcase_02 WA -
testcase_03 AC 128 ms
55,276 KB
testcase_04 WA -
testcase_05 AC 120 ms
55,740 KB
testcase_06 AC 120 ms
55,768 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 122 ms
55,548 KB
testcase_10 AC 120 ms
55,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int sum = 0;
        for(int i=0; i<n; i++) sum += in.nextInt();

        int asm = 0;
        for(int i=1; i<=n; i++) asm += i;

        System.out.println(asm - sum);
    }
}
0