結果

問題 No.567 コンプリート
ユーザー m_tsubasa
提出日時 2020-07-24 00:00:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 473 ms / 2,000 ms
コード長 477 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 191,704 KB
最終ジャッジ日時 2025-01-12 04:46:26
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int n;

long double solve();

int main() {
  cin >> n;
  cout << fixed << setprecision(10);
  cout << solve() << endl;
  return 0;
}

long double solve() {
  long double res = 0;
  for (int i = 1; i <= 6; ++i) {
    long double now = 1;
    for (int j = 0; j < n; ++j) now *= i / 6.0L;
    for (int j = 0; j < i; ++j) now *= (6.0L - j) / (j + 1.0L);
    if (i & 1)
      res -= now;
    else
      res += now;
  }
  return res;
}
0