結果
| 問題 |
No.888 約数の総和
|
| コンテスト | |
| ユーザー |
ゆきのん
|
| 提出日時 | 2019-09-20 21:59:10 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 720 bytes |
| コンパイル時間 | 1,413 ms |
| コンパイル使用メモリ | 163,968 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-14 17:29:51 |
| 合計ジャッジ時間 | 5,200 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 TLE * 1 -- * 14 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
vector<LL> divi(LL K){
vector<LL> v;
for(int i=1;i*i<=K;i++){
if(K%i) continue;
v.pb(i);
v.pb(K/i);
}
sort(ALL(v));
v.erase(unique(ALL(v)),v.end());
return v;
}
int main(){
LL n;cin >> n;
auto p = divi(n);
LL ans = 0;
for (int i = 0; i < p.size(); i++) {
ans += p[i];
}
cout << ans << endl;
return 0;
}
ゆきのん