結果

問題 No.1033 乱数サイ
ユーザー mmn15277198
提出日時 2020-06-07 21:07:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 853 ms
コンパイル使用メモリ 89,832 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 21:23:29
合計ジャッジ時間 1,663 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<math.h>
#include<string.h>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<deque>
#include<map>
#include<stdio.h>
using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	double n,k;
	cin >> n >> k;
	n++;
	double ans=0;
	int i=1;
	bool fin=false;
	while(1){
		ans+=(1/(n*k))*i*k;
		i++;
		if(i==n)break;
	}
	cout << fixed << setprecision(1) << ans << endl;
	return 0;
}
0