結果

問題 No.813 ユキちゃんの冒険
ユーザー pionepione
提出日時 2020-12-22 20:25:12
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,024 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 166,044 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 13:03:03
合計ジャッジ時間 5,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 7 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 19 ms
4,348 KB
testcase_05 AC 1,232 ms
4,348 KB
testcase_06 AC 10 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 1,033 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 8 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 15 ms
4,348 KB
testcase_13 AC 11 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 16 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 3 ms
4,348 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2 ms
4,348 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define irreps(i, m, n) for (long long i = ((long long)(n)-1); i > (long long)(m); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) (long long)(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

ll n;
double p,q;

// 2つ門があると無限ループの可能性

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  cin>>n>>p>>q;
  
  double ans=0;
  double now=1, back=p;
  
  rep(i,n){
    ans+=now*back;
    now*=q;
    double tmp=now;
    rep(j,10000){
      tmp+=now*p*p;
      now*=p*p;
    }
    now=tmp;
    back*=q;
  }
  
  printf("%.15lf\n", ans);
  
}
0