結果
問題 |
No.888 約数の総和
|
ユーザー |
![]() |
提出日時 | 2019-12-08 18:16:56 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 2,323 ms |
コンパイル使用メモリ | 74,648 KB |
実行使用メモリ | 56,368 KB |
最終ジャッジ日時 | 2024-12-31 05:49:50 |
合計ジャッジ時間 | 8,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 1 WA * 15 RE * 14 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); long sum = 1; for(int i = 2; i <= Math.sqrt(n); i++) { if(n % i == 0) { sum += i; sum += (n / i); } } System.out.println(sum); } }