結果

問題 No.1616 Joke
ユーザー mtmtmtmtmtmtmtmtmtmt
提出日時 2021-07-22 21:34:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 746 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 94,924 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-24 15:57:23
合計ジャッジ時間 1,728 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <stack>
#include <cstring>
#include <utility>
#include <iostream>
#include <iomanip>
#include <list>
#include <queue>
#include <algorithm>
#include <cmath>
#include <unordered_set>
#include <bitset>
#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define SUM(v) accumulate(ALL(v),0ll)
#define CL(v) cout<<v<<endl
using ll = long long;
const ll INF=10000000000000;
using namespace std;
int main()
{
	ll n;
	cin>>n;
	double a=0;
	double b=0;
	REP(i,n+1)
	{
		if(i==0)continue;
		if(n%i==0)
		{
				a+=i;
				b+=(double)1/i;
		}	
	}
//	b=1/a;
//	cout<<a<<" "<<b<<endl;
	cout<<a/b<<endl;
    return 0;
}
0