結果
問題 |
No.888 約数の総和
|
ユーザー |
![]() |
提出日時 | 2024-09-25 23:47:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 258 bytes |
コンパイル時間 | 1,497 ms |
コンパイル使用メモリ | 167,008 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 23:47:03 |
合計ジャッジ時間 | 2,610 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 6 |
ソースコード
#include<bits/stdc++.h> using namespace std; long long ans = 0, n; int main() { cin >> n; int k = sqrt(n); for(int i = 1; i <= k; ++i) if(n % i == 0) ans += i + n / i; if(k * k == n) cout << ans - k; else cout << ans; cout << '\n'; }