結果
問題 |
No.888 約数の総和
|
ユーザー |
![]() |
提出日時 | 2024-09-25 23:39:58 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 2,290 ms |
コンパイル使用メモリ | 162,876 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-25 23:40:01 |
合計ジャッジ時間 | 3,084 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define all(a) (a).begin(), (a).end() const int maxn = 1e6+1; int main() { ll n, sum = 0; cin>>n; for(int i=1;i<=sqrt(n);++i){ if(n%i==0){ sum += i; if(n/i != i) sum += n/i; } } cout<<sum; return 0; } /*---------------END---------------*/