結果
問題 |
No.888 約数の総和
|
ユーザー |
|
提出日時 | 2020-06-11 19:54:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 297 bytes |
コンパイル時間 | 1,524 ms |
コンパイル使用メモリ | 167,760 KB |
実行使用メモリ | 13,884 KB |
最終ジャッジ日時 | 2024-06-24 03:15:55 |
合計ジャッジ時間 | 5,224 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 2 WA * 13 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; ll cnt=0; for(int i=1; i*i<n; i++){ cnt++; if(n%i==0) ans+=i; } cnt++; if(n%(cnt)==0) cout << ans+cnt << endl; else cout << ans << endl; }