結果
問題 |
No.888 約数の総和
|
ユーザー |
|
提出日時 | 2020-04-07 11:58:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 638 bytes |
コンパイル時間 | 1,355 ms |
コンパイル使用メモリ | 169,908 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 11:56:29 |
合計ジャッジ時間 | 2,511 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; using ll = long long ; using P = pair<int,int> ; const int INF = 1e9; const int MOD = 1000000007; vector<ll> diviser_all(ll x){ vector<ll> res; for(ll i = 1;i*i <=x;i++){ if(x%i == 0){ res.push_back(i); if(i*i==x); else res.push_back(x/i); } } return res; } int main(){ ll n; cin >> n; vector<ll> res = diviser_all(n); ll ans = 0; for(ll p:res) ans += p; cout << ans << endl; return 0; }