結果

問題 No.480 合計
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-02-13 23:14:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 56,616 KB
最終ジャッジ日時 2023-08-21 01:35:24
合計ジャッジ時間 5,598 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,212 KB
testcase_01 AC 117 ms
56,124 KB
testcase_02 AC 118 ms
55,492 KB
testcase_03 AC 118 ms
56,328 KB
testcase_04 AC 117 ms
56,152 KB
testcase_05 AC 120 ms
55,992 KB
testcase_06 AC 117 ms
56,052 KB
testcase_07 AC 117 ms
55,740 KB
testcase_08 AC 117 ms
55,924 KB
testcase_09 AC 117 ms
56,076 KB
testcase_10 AC 118 ms
55,676 KB
testcase_11 AC 118 ms
55,508 KB
testcase_12 AC 117 ms
56,500 KB
testcase_13 AC 117 ms
56,284 KB
testcase_14 AC 117 ms
56,156 KB
testcase_15 AC 116 ms
56,616 KB
testcase_16 AC 118 ms
56,028 KB
testcase_17 AC 117 ms
56,116 KB
testcase_18 AC 118 ms
56,128 KB
testcase_19 AC 117 ms
56,120 KB
testcase_20 AC 118 ms
56,116 KB
testcase_21 AC 118 ms
55,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

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

        int ans = 0;
        for(int i=1; i<n+1; i++) {
            ans += i;
        }

        System.out.println(ans);

        in.close();
    }
}
0