結果

問題 No.1076 寿司打
コンテスト
ユーザー imoni_kawaii
提出日時 2020-06-12 21:32:50
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 740 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,053 ms
コンパイル使用メモリ 209,244 KB
実行使用メモリ 9,820 KB
最終ジャッジ日時 2026-10-12 03:06:26
合計ジャッジ時間 2,177 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#ifdef _DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
template<class T, class U> inline bool chmax(T &a, const U &b) { if(a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if(a > b) { a = b; return true; } return false; }

ld p;

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  cin >> p;
  ld E = 0, P = 1;
  for(ld i = 0; i <= 100000; i++) {
    E = E+P*(1-p)*i;
    P = P*p;
  }
  cout << fixed << setprecision(13) << E << '\n';
  return 0;
}
0