結果

問題 No.480 合計
ユーザー ShotaroSuzuShotaroSuzu
提出日時 2020-05-19 17:11:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 1,780 ms
コンパイル使用メモリ 74,228 KB
実行使用メモリ 54,192 KB
最終ジャッジ日時 2024-04-09 22:18:39
合計ジャッジ時間 4,813 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
52,768 KB
testcase_01 AC 115 ms
54,036 KB
testcase_02 AC 97 ms
52,336 KB
testcase_03 AC 109 ms
53,956 KB
testcase_04 AC 99 ms
52,708 KB
testcase_05 AC 103 ms
52,732 KB
testcase_06 AC 110 ms
53,964 KB
testcase_07 AC 100 ms
53,292 KB
testcase_08 AC 119 ms
54,104 KB
testcase_09 AC 110 ms
54,064 KB
testcase_10 AC 108 ms
54,120 KB
testcase_11 AC 107 ms
54,020 KB
testcase_12 AC 98 ms
53,048 KB
testcase_13 AC 108 ms
53,908 KB
testcase_14 AC 109 ms
54,152 KB
testcase_15 AC 109 ms
54,148 KB
testcase_16 AC 100 ms
52,760 KB
testcase_17 AC 111 ms
54,192 KB
testcase_18 AC 100 ms
52,988 KB
testcase_19 AC 102 ms
52,748 KB
testcase_20 AC 100 ms
52,724 KB
testcase_21 AC 110 ms
53,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder.tutorial.sum;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);

		long inNum = sc.nextInt();

		long sum = 0L;
		for (int i = 1; i <= inNum; i++) {
			sum += i;
		}
		System.out.println(sum);
	}

}
0