結果

問題 No.480 合計
ユーザー nohopennohopen
提出日時 2019-06-29 15:38:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 2,292 ms
コンパイル使用メモリ 72,604 KB
実行使用メモリ 56,744 KB
最終ジャッジ日時 2023-09-14 23:15:21
合計ジャッジ時間 6,094 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,084 KB
testcase_01 AC 115 ms
55,712 KB
testcase_02 AC 115 ms
56,012 KB
testcase_03 AC 117 ms
55,668 KB
testcase_04 AC 115 ms
56,048 KB
testcase_05 AC 114 ms
56,060 KB
testcase_06 AC 116 ms
56,028 KB
testcase_07 AC 110 ms
55,764 KB
testcase_08 AC 110 ms
55,852 KB
testcase_09 AC 114 ms
55,564 KB
testcase_10 AC 110 ms
55,700 KB
testcase_11 AC 112 ms
55,924 KB
testcase_12 AC 115 ms
56,744 KB
testcase_13 AC 112 ms
55,880 KB
testcase_14 AC 112 ms
55,968 KB
testcase_15 AC 112 ms
55,756 KB
testcase_16 AC 114 ms
56,216 KB
testcase_17 AC 117 ms
55,848 KB
testcase_18 AC 115 ms
55,916 KB
testcase_19 AC 123 ms
55,620 KB
testcase_20 AC 114 ms
55,840 KB
testcase_21 AC 120 ms
55,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt( sc.next() );
    int sum = IntStream.range(1, n + 1).sum();
    System.out.println(sum);
  }
}
0