結果

問題 No.480 合計
ユーザー oyafusooyafuso
提出日時 2019-03-11 09:45:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 2,519 ms
コンパイル使用メモリ 72,732 KB
実行使用メモリ 57,676 KB
最終ジャッジ日時 2023-09-05 20:01:09
合計ジャッジ時間 5,701 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,612 KB
testcase_01 AC 122 ms
55,908 KB
testcase_02 AC 124 ms
55,608 KB
testcase_03 AC 124 ms
55,540 KB
testcase_04 AC 123 ms
55,868 KB
testcase_05 AC 122 ms
55,700 KB
testcase_06 AC 124 ms
55,708 KB
testcase_07 AC 124 ms
55,868 KB
testcase_08 AC 124 ms
55,428 KB
testcase_09 AC 125 ms
55,700 KB
testcase_10 AC 123 ms
55,604 KB
testcase_11 AC 125 ms
55,956 KB
testcase_12 AC 125 ms
55,372 KB
testcase_13 AC 125 ms
56,120 KB
testcase_14 AC 126 ms
57,676 KB
testcase_15 AC 123 ms
53,936 KB
testcase_16 AC 123 ms
55,624 KB
testcase_17 AC 123 ms
55,796 KB
testcase_18 AC 123 ms
55,716 KB
testcase_19 AC 123 ms
55,548 KB
testcase_20 AC 124 ms
55,880 KB
testcase_21 AC 122 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {

	private static final String SPLIT_STR = " ";

	public static void main(String[] args) {
		// Scanner生成
		Scanner sc = new Scanner(System.in);
		// 入力設定
		int input = Integer.parseInt(sc.nextLine());
		// Scannerクローズ
		sc.close();

		// 結果
		int result = 0;
		// 1からinputまで合計
		for (int i = 1; i <= input; i++) {
			result += i;
		}

		// 出力
		System.out.println(result);
	}
}
0