結果

問題 No.278 連続する整数の和(2)
ユーザー nanophoto12nanophoto12
提出日時 2015-09-13 15:04:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 3,278 ms
コンパイル使用メモリ 71,992 KB
実行使用メモリ 58,400 KB
最終ジャッジ日時 2023-09-26 11:46:04
合計ジャッジ時間 7,480 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,096 KB
testcase_01 WA -
testcase_02 AC 155 ms
57,964 KB
testcase_03 AC 125 ms
55,920 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 128 ms
55,644 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 153 ms
57,744 KB
testcase_10 AC 155 ms
58,056 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 149 ms
57,740 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 157 ms
56,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Long value = scanner.nextLong();
        double root = Math.sqrt((double) value);
        Long sum = 0L;
        for(Long i = 1L; i <= root;i++)
        {
            if(value % i == 0)
            {
                sum += i + (value / i);
            }
        }

        System.out.println(sum.toString());
    }
}
0