結果

問題 No.888 約数の総和
ユーザー 37zigen37zigen
提出日時 2019-09-20 00:18:15
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 489 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 71,576 KB
実行使用メモリ 61,688 KB
最終ジャッジ日時 2023-09-29 01:28:02
合計ジャッジ時間 8,857 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
61,688 KB
testcase_01 AC 127 ms
55,580 KB
testcase_02 AC 128 ms
56,440 KB
testcase_03 AC 130 ms
55,552 KB
testcase_04 AC 128 ms
55,860 KB
testcase_05 AC 127 ms
56,088 KB
testcase_06 AC 127 ms
56,040 KB
testcase_07 AC 132 ms
55,724 KB
testcase_08 AC 130 ms
55,896 KB
testcase_09 AC 127 ms
55,828 KB
testcase_10 AC 126 ms
55,336 KB
testcase_11 AC 127 ms
55,616 KB
testcase_12 AC 127 ms
55,584 KB
testcase_13 AC 127 ms
55,852 KB
testcase_14 AC 128 ms
55,832 KB
testcase_15 AC 127 ms
55,696 KB
testcase_16 AC 126 ms
55,464 KB
testcase_17 AC 130 ms
55,708 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

// i*i が 32bit を超える時、正しくWAになるか

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 (int i = 1; i * i <= N; ++i) {
			if (N % i == 0)
				ans += (i + (i == N / i ? 0 : N / i));
		}
		System.out.println(ans);
	}
}
0