結果

問題 No.888 約数の総和
ユーザー 37zigen37zigen
提出日時 2019-09-20 12:23:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 5,414 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 57,708 KB
最終ジャッジ日時 2023-10-12 00:36:11
合計ジャッジ時間 11,612 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
55,620 KB
testcase_01 AC 131 ms
53,812 KB
testcase_02 AC 129 ms
55,816 KB
testcase_03 WA -
testcase_04 AC 131 ms
55,496 KB
testcase_05 WA -
testcase_06 AC 131 ms
55,784 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 129 ms
55,532 KB
testcase_10 WA -
testcase_11 AC 130 ms
56,112 KB
testcase_12 AC 128 ms
55,672 KB
testcase_13 AC 128 ms
55,832 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 130 ms
55,604 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 145 ms
55,592 KB
testcase_20 WA -
testcase_21 AC 145 ms
55,916 KB
testcase_22 AC 149 ms
55,744 KB
testcase_23 WA -
testcase_24 AC 137 ms
55,700 KB
testcase_25 WA -
testcase_26 AC 145 ms
55,764 KB
testcase_27 AC 154 ms
55,596 KB
testcase_28 AC 145 ms
55,560 KB
testcase_29 WA -
testcase_30 AC 143 ms
55,704 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// i == N/i の処理が抜けている場合

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 + N / i;
		}
		System.out.println(ans);
	}
}
0