Submission #1695609


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define double long double

double mypow(double p, long n){
  double ret = 1.0;
  while(n>0){dbg(n,ret,p);
    if(n%2==1) ret *= p;
    p *= p;
    n /= 2;
  }
  return ret;
}

int main(){
  double p; long n;
  cin>>p>>n;

  double ans = 1.0 - mypow(1.0-2.0*p, n);

  printf("%.12Lf\n", ans/2.0);

  return 0;
}

Submission Info

Submission Time
Task A - eject
User tossy
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1252 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 33
Set Name Test Cases
All 00-sample-00, 00-sample-01, 10-random_small-00, 10-random_small-01, 10-random_small-02, 10-random_small-03, 10-random_small-04, 10-random_small-05, 10-random_small-06, 10-random_small-07, 10-random_small-08, 10-random_small-09, 20-random_large-00, 20-random_large-01, 20-random_large-02, 20-random_large-03, 20-random_large-04, 20-random_large-05, 20-random_large-06, 20-random_large-07, 20-random_large-08, 20-random_large-09, 30-p_zero-00, 30-p_zero-01, 30-p_zero-02, 30-p_zero-03, 30-p_zero-04, 40-p_one-00, 40-p_one-01, 40-p_one-02, 40-p_one-03, 40-p_one-04, 90-handmade-00
Case Name Status Exec Time Memory
00-sample-00 WA 1 ms 256 KB
00-sample-01 WA 1 ms 256 KB
10-random_small-00 WA 1 ms 256 KB
10-random_small-01 WA 1 ms 256 KB
10-random_small-02 WA 1 ms 256 KB
10-random_small-03 WA 1 ms 256 KB
10-random_small-04 WA 1 ms 256 KB
10-random_small-05 WA 1 ms 256 KB
10-random_small-06 WA 1 ms 256 KB
10-random_small-07 WA 1 ms 256 KB
10-random_small-08 WA 1 ms 256 KB
10-random_small-09 WA 1 ms 256 KB
20-random_large-00 WA 2 ms 256 KB
20-random_large-01 WA 2 ms 256 KB
20-random_large-02 WA 2 ms 256 KB
20-random_large-03 WA 2 ms 256 KB
20-random_large-04 WA 1 ms 256 KB
20-random_large-05 WA 2 ms 256 KB
20-random_large-06 WA 2 ms 256 KB
20-random_large-07 WA 1 ms 256 KB
20-random_large-08 WA 1 ms 256 KB
20-random_large-09 WA 2 ms 256 KB
30-p_zero-00 WA 2 ms 256 KB
30-p_zero-01 WA 2 ms 256 KB
30-p_zero-02 WA 2 ms 256 KB
30-p_zero-03 WA 2 ms 256 KB
30-p_zero-04 WA 2 ms 256 KB
40-p_one-00 WA 2 ms 256 KB
40-p_one-01 WA 2 ms 256 KB
40-p_one-02 WA 2 ms 256 KB
40-p_one-03 WA 2 ms 256 KB
40-p_one-04 WA 2 ms 256 KB
90-handmade-00 WA 1 ms 256 KB