結果

問題 No.480 合計
ユーザー ambasadambasad
提出日時 2019-11-15 17:36:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 2,577 ms
コンパイル使用メモリ 74,576 KB
実行使用メモリ 41,196 KB
最終ジャッジ日時 2023-10-25 03:39:33
合計ジャッジ時間 5,945 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,088 KB
testcase_01 AC 123 ms
40,952 KB
testcase_02 AC 122 ms
41,008 KB
testcase_03 AC 123 ms
40,964 KB
testcase_04 AC 109 ms
39,812 KB
testcase_05 AC 108 ms
39,820 KB
testcase_06 AC 120 ms
40,784 KB
testcase_07 AC 121 ms
40,920 KB
testcase_08 AC 110 ms
39,820 KB
testcase_09 AC 121 ms
41,196 KB
testcase_10 AC 118 ms
41,024 KB
testcase_11 AC 113 ms
40,372 KB
testcase_12 AC 123 ms
41,068 KB
testcase_13 AC 119 ms
40,840 KB
testcase_14 AC 108 ms
39,972 KB
testcase_15 AC 107 ms
39,824 KB
testcase_16 AC 107 ms
39,820 KB
testcase_17 AC 119 ms
40,880 KB
testcase_18 AC 118 ms
40,792 KB
testcase_19 AC 110 ms
39,816 KB
testcase_20 AC 118 ms
40,956 KB
testcase_21 AC 119 ms
40,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
       Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();

        int n = Integer.parseInt(str);
        int sum = 0;

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

        System.out.println(sum);
        scan.close();
	}
}
0