結果
問題 | No.888 約数の総和 |
ユーザー |
![]() |
提出日時 | 2019-09-20 21:41:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 468 bytes |
コンパイル時間 | 1,361 ms |
コンパイル使用メモリ | 157,780 KB |
実行使用メモリ | 13,824 KB |
最終ジャッジ日時 | 2024-09-14 17:00:00 |
合計ジャッジ時間 | 7,630 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 -- * 2 |
other | -- * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; long long int n; long long int sum; void solve(){ sum=1; cin>>n; for(long long int i=2; i*i<=n; i++){ if(n%i==0){ sum+=i; if(i!=n/i){ sum+=(n/i); } //cout<<i<<" "<<n/i<<" "<<sum<<endl; } //cout<<i<<endl; } if(n!=1){ sum+=n; } cout<<sum<<endl; } int main(){ while(1)solve(); return 0; }