結果

問題 No.2645 Sum of Divisors?
ユーザー shobonvip
提出日時 2024-02-11 11:03:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 251 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 192,212 KB
最終ジャッジ日時 2025-02-19 04:55:32
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other AC * 17 TLE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	long long n;
	cin >> n;
	double ans = 0;
	
	for (int i=1; i<=n; i++){
		for (int j=i; j<=n; j+=i){
			ans += (double)1 / j;
		}
	}
	
	cout << fixed << setprecision(15);
	cout << ans << '\n';
}
0