結果
問題 |
No.888 約数の総和
|
ユーザー |
![]() |
提出日時 | 2024-09-25 23:53:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 1,904 ms |
コンパイル使用メモリ | 196,444 KB |
最終ジャッジ日時 | 2025-02-24 12:40:03 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 TLE * 1 -- * 14 |
ソースコード
#include<bits/stdc++.h> #define ll long long using namespace std; vector<int> A; map<ll, ll> cnt; bool checknt (int x) { if (x<=1) return 0; if (x==2) return 1; else { for (int i=2; i<=sqrt(x); i++) { if (x%i==0) return 0; } return 1; } } int main () { ll n; cin >> n; ll ans=0; for (int i=1; i*i<=n; i++) { if (n%i==0 ) { ans+=i; if (n/i!=i) ans+=n/i; } } cout << ans; return 0; }