結果

問題 No.693 square1001 and Permutation 2
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-06-08 23:05:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 72,728 KB
実行使用メモリ 56,084 KB
最終ジャッジ日時 2023-09-13 00:09:53
合計ジャッジ時間 4,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,452 KB
testcase_01 AC 121 ms
55,944 KB
testcase_02 WA -
testcase_03 AC 130 ms
56,084 KB
testcase_04 WA -
testcase_05 AC 122 ms
55,844 KB
testcase_06 AC 122 ms
55,944 KB
testcase_07 AC 122 ms
55,832 KB
testcase_08 WA -
testcase_09 AC 120 ms
55,744 KB
testcase_10 AC 121 ms
55,572 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(Math.abs(asm - sum));
    }
}
0