結果

問題 No.480 合計
ユーザー hj5ln8kbDM8t2fFhj5ln8kbDM8t2fF
提出日時 2019-06-22 20:16:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 2,258 ms
コンパイル使用メモリ 70,936 KB
実行使用メモリ 56,556 KB
最終ジャッジ日時 2023-08-27 03:06:52
合計ジャッジ時間 5,752 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,504 KB
testcase_01 AC 118 ms
56,164 KB
testcase_02 AC 119 ms
56,152 KB
testcase_03 AC 120 ms
53,800 KB
testcase_04 AC 121 ms
54,224 KB
testcase_05 AC 122 ms
55,792 KB
testcase_06 AC 120 ms
53,816 KB
testcase_07 AC 132 ms
55,548 KB
testcase_08 AC 131 ms
56,048 KB
testcase_09 AC 119 ms
56,140 KB
testcase_10 AC 124 ms
55,872 KB
testcase_11 AC 120 ms
55,404 KB
testcase_12 AC 121 ms
55,996 KB
testcase_13 AC 118 ms
56,556 KB
testcase_14 AC 121 ms
56,100 KB
testcase_15 AC 121 ms
55,736 KB
testcase_16 AC 120 ms
56,048 KB
testcase_17 AC 118 ms
55,548 KB
testcase_18 AC 116 ms
55,508 KB
testcase_19 AC 120 ms
55,868 KB
testcase_20 AC 119 ms
55,748 KB
testcase_21 AC 124 ms
55,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Sum{
    public int Cal(int s){
        int gokei = 0;
        for(int i=1;i<=s;i++){
            gokei = gokei + i;
        }
        return gokei;
    }
}

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Sum sm = new Sum();
        int sum = sm.Cal(N);
        System.out.println(sum);
    }
}
0