結果

問題 No.888 約数の総和
ユーザー 37zigen37zigen
提出日時 2019-09-20 12:34:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 71,856 KB
実行使用メモリ 58,260 KB
最終ジャッジ日時 2023-10-12 00:49:05
合計ジャッジ時間 8,144 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,672 KB
testcase_01 AC 125 ms
55,688 KB
testcase_02 AC 126 ms
55,692 KB
testcase_03 AC 125 ms
55,952 KB
testcase_04 AC 127 ms
55,884 KB
testcase_05 AC 126 ms
55,336 KB
testcase_06 AC 126 ms
55,444 KB
testcase_07 AC 128 ms
55,656 KB
testcase_08 AC 125 ms
55,852 KB
testcase_09 AC 126 ms
55,920 KB
testcase_10 AC 126 ms
55,812 KB
testcase_11 AC 126 ms
55,532 KB
testcase_12 AC 126 ms
55,820 KB
testcase_13 AC 129 ms
55,732 KB
testcase_14 AC 127 ms
55,672 KB
testcase_15 AC 130 ms
55,956 KB
testcase_16 AC 126 ms
55,452 KB
testcase_17 AC 127 ms
55,932 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// ans が 32bit 整数

import java.util.Arrays;
import java.util.Scanner;

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

	void run() {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		if (!(1 <= N && N <= 1e12))
			throw new AssertionError();
		int ans = 0;
		for (long i = 1; i * i <= N; ++i) {
			if (N % i == 0)
				ans += (i + (i == N / i ? 0 : N / i));
		}
		System.out.println(ans);
	}
}
0