結果

問題 No.888 約数の総和
ユーザー 37zigen37zigen
提出日時 2019-09-20 00:16:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 2,359 ms
コンパイル使用メモリ 72,148 KB
実行使用メモリ 57,564 KB
最終ジャッジ日時 2023-09-29 01:25:36
合計ジャッジ時間 8,403 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,432 KB
testcase_01 AC 125 ms
55,840 KB
testcase_02 AC 125 ms
55,804 KB
testcase_03 AC 125 ms
55,756 KB
testcase_04 AC 125 ms
55,620 KB
testcase_05 AC 124 ms
55,696 KB
testcase_06 AC 125 ms
55,428 KB
testcase_07 AC 125 ms
55,840 KB
testcase_08 AC 125 ms
53,944 KB
testcase_09 AC 125 ms
55,776 KB
testcase_10 AC 125 ms
56,012 KB
testcase_11 AC 123 ms
55,840 KB
testcase_12 AC 125 ms
55,340 KB
testcase_13 AC 126 ms
55,700 KB
testcase_14 AC 127 ms
55,400 KB
testcase_15 AC 126 ms
55,844 KB
testcase_16 AC 124 ms
55,860 KB
testcase_17 AC 124 ms
55,608 KB
testcase_18 AC 139 ms
55,624 KB
testcase_19 AC 136 ms
55,852 KB
testcase_20 AC 134 ms
56,140 KB
testcase_21 AC 140 ms
56,068 KB
testcase_22 AC 140 ms
56,028 KB
testcase_23 AC 125 ms
55,520 KB
testcase_24 AC 132 ms
55,924 KB
testcase_25 AC 132 ms
55,896 KB
testcase_26 AC 133 ms
55,752 KB
testcase_27 AC 135 ms
55,924 KB
testcase_28 AC 140 ms
55,844 KB
testcase_29 AC 138 ms
57,564 KB
testcase_30 AC 136 ms
55,904 KB
testcase_31 AC 137 ms
55,960 KB
testcase_32 AC 142 ms
55,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 制約侵害 check

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();
		long 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