Submission #1390010


Source Code Expand

// 基本テンプレート (縮小版)

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
typedef pair<int, int> pii;
typedef long long ll;
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

signed main() {
    long double p; int n; cin >> p >> n;
    printf("%.12Lf\n", 1.0 / 2.0 - pow(1-2*p, n) / 2.0);
    return 0;
}

Submission Info

Submission Time
Task A - eject
User tsutaj
Language C++14 (GCC 5.4.1)
Score 100
Code Size 717 Byte
Status AC
Exec Time 6 ms
Memory 512 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 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 AC 6 ms 512 KB
00-sample-01 AC 1 ms 256 KB
10-random_small-00 AC 1 ms 256 KB
10-random_small-01 AC 1 ms 256 KB
10-random_small-02 AC 1 ms 256 KB
10-random_small-03 AC 1 ms 256 KB
10-random_small-04 AC 1 ms 256 KB
10-random_small-05 AC 1 ms 256 KB
10-random_small-06 AC 1 ms 256 KB
10-random_small-07 AC 1 ms 256 KB
10-random_small-08 AC 1 ms 256 KB
10-random_small-09 AC 1 ms 256 KB
20-random_large-00 AC 1 ms 256 KB
20-random_large-01 AC 1 ms 256 KB
20-random_large-02 AC 1 ms 256 KB
20-random_large-03 AC 1 ms 256 KB
20-random_large-04 AC 1 ms 256 KB
20-random_large-05 AC 1 ms 256 KB
20-random_large-06 AC 1 ms 256 KB
20-random_large-07 AC 1 ms 256 KB
20-random_large-08 AC 1 ms 256 KB
20-random_large-09 AC 1 ms 256 KB
30-p_zero-00 AC 1 ms 256 KB
30-p_zero-01 AC 1 ms 256 KB
30-p_zero-02 AC 1 ms 256 KB
30-p_zero-03 AC 1 ms 256 KB
30-p_zero-04 AC 1 ms 256 KB
40-p_one-00 AC 1 ms 256 KB
40-p_one-01 AC 1 ms 256 KB
40-p_one-02 AC 1 ms 256 KB
40-p_one-03 AC 1 ms 256 KB
40-p_one-04 AC 1 ms 256 KB
90-handmade-00 AC 1 ms 256 KB