結果

問題 No.1033 乱数サイ
ユーザー kekenx
提出日時 2020-05-26 21:48:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 3,694 ms
コンパイル使用メモリ 165,504 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-13 03:02:09
合計ジャッジ時間 2,228 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int n, k;
  cin >> n >> k;
  int m = (n + 1) * k;
  double ans = 0;
  for (int i = 0; i <= n; ++i) {
    double one = (double)1 / m * i;
    ans += (one * k);
  }
  cout << fixed << setprecision(10) << ans << '\n';
  return 0;
}
0