結果

問題 No.888 約数の総和
ユーザー vjudge1
提出日時 2024-09-25 23:16:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 193,132 KB
最終ジャッジ日時 2025-02-24 12:38:58
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll demuocbasic(ll n)
{
	ll Count=0;
	for(ll i=1;i<=trunc(sqrt(n));i++)
	{
		if(n%i==0)
		{
			if(i*i==n) Count+=i;
			else Count+=i+n/i;
		}
	}
	return Count;
}
int main() 
{
  ll n;
  cin>>n;
  if(n==0) cout<<0;
 else
  cout<<demuocbasic(n);
    return 0;
}
0