結果

問題 No.693 square1001 and Permutation 2
ユーザー matsuyoshi30
提出日時 2018-06-08 23:05:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 77,116 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-06-30 10:58:31
合計ジャッジ時間 4,061 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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