結果
問題 |
No.888 約数の総和
|
ユーザー |
|
提出日時 | 2020-06-11 22:04:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 333 bytes |
コンパイル時間 | 1,675 ms |
コンパイル使用メモリ | 166,332 KB |
実行使用メモリ | 13,760 KB |
最終ジャッジ日時 | 2024-06-24 03:23:00 |
合計ジャッジ時間 | 5,234 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 15 TLE * 1 -- * 14 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ ll n; cin>>n; ll ans=0; int cnt=0; for(int i=1; i*i<=n; i++){ cnt++; if(n%i==0) {ans+=i; ans+=n/i;} } cout << cnt << endl; if(n%(cnt)==0) cout << ans - cnt << endl; else cout << ans << endl; }