problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define dd double
#define MOD 1000000007
#define nl cout << endl
#define rt ll Q[100005] = {0}
#define mp make_pair
#define test() \
... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define dd double
#define MOD 1000000007
#define nl cout << endl
#define rt ll Q[100005] = {0}
#define mp make_pair
#define test() \
... | delete | 35 | 39 | 35 | 35 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int, int> pi;
#define trace(x) cout << #x << "... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int, int> pi;
#define trace(x) cout << #x << "... | insert | 62 | 62 | 62 | 65 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3001;
double dp[N][N];
bool vis[N][N];
double p[N];
int n;
double rec(int i, int h) {
if (i == n) {
return double(h > (n - h));
}
auto &res = dp[i][h];
if (vis[i][h])
return res;
return res = p[i] * rec(i + 1, h + 1) +... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3001;
double dp[N][N];
bool vis[N][N];
double p[N];
int n;
double rec(int i, int h) {
if (i == n) {
return double(h > (n - h));
}
auto &res = dp[i][h];
if (vis[i][h])
return res;
vis[i][h] = true;
return res = p[i] *... | insert | 17 | 17 | 17 | 18 | TLE | |
p03168 | C++ | Runtime Error | // https://atcoder.jp/contests/dp/tasks/dp_i
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define EPS (1e-7)
#define INF (1e9)
#define MODI (1000000007)
typedef long long ll;
typedef pair<int, int> PII;
typ... | // https://atcoder.jp/contests/dp/tasks/dp_i
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define EPS (1e-7)
#define INF (1e9)
#define MODI (1000000007)
typedef long long ll;
typedef pair<int, int> PII;
typ... | replace | 26 | 27 | 26 | 27 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ld long double
const int N = 1e3 + 5;
int n;
ld prob[N];
ld dp[N][N];
ld go(int idx, int heads) {
if (idx > n) {
int tails = n - heads;
if (heads > tails)
return 1;
return 0;
}
if (dp[idx][heads] >= 0)
return dp[idx][heads];
ld ans... | #include <bits/stdc++.h>
using namespace std;
#define ld long double
const int N = 3e3 + 5;
int n;
ld prob[N];
ld dp[N][N];
ld go(int idx, int heads) {
if (idx > n) {
int tails = n - heads;
if (heads > tails)
return 1;
return 0;
}
if (dp[idx][heads] >= 0)
return dp[idx][heads];
ld ans... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define N 3001
int n;
int vis[N][N] = {0};
double dp[N][N], a[N], ans = 0;
double solve(int i, int c, float p = 0) {
if (i == n) {
if (c > n / 2)
return 1;
return 0;
}
if (vis[i][c])
return dp[i][c];
return dp[i][c] = a[i] * solve(i + 1, c + 1)... | #include <bits/stdc++.h>
using namespace std;
#define N 3001
int n;
int vis[N][N] = {0};
double dp[N][N], a[N], ans = 0;
double solve(int i, int c, float p = 0) {
if (i == n) {
if (c > n / 2)
return 1;
return 0;
}
if (vis[i][c])
return dp[i][c];
vis[i][c] = 1;
return dp[i][c] = a[i] * so... | insert | 18 | 18 | 18 | 19 | TLE | |
p03168 | C++ | Time Limit Exceeded | /*
@author: Charan Sai
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | /*
@author: Charan Sai
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | delete | 74 | 79 | 74 | 74 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define DEBUG 0
#define nl '\n'
#define fori(n) for (int i = 0; i < n; ++i)
#define forj(n) for (int j = 0; j < n; ++j)
#define fork(n) for (int k = 0; k < n; ++k)
#define forl(n) for (int l = 0; l < n; ++l)
#define pq priority_queue
#define umap unordered_map
#define uset ... | #include <bits/stdc++.h>
using namespace std;
#define DEBUG 0
#define nl '\n'
#define fori(n) for (int i = 0; i < n; ++i)
#define forj(n) for (int j = 0; j < n; ++j)
#define fork(n) for (int k = 0; k < n; ++k)
#define forl(n) for (int l = 0; l < n; ++l)
#define pq priority_queue
#define umap unordered_map
#define uset ... | delete | 45 | 50 | 45 | 45 | TLE | |
p03168 | C++ | Runtime Error | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<double> p(N);
for (int i = 0; i < N; i++) {
cin >> p[i];
}
double dp[3000][3000];
for (int i = 0; i < 3000; i++) {
for (int j = 0; j < 3000; j++) {
dp[i][j] = 0;
}
} //... | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<double> p(N);
for (int i = 0; i < N; i++) {
cin >> p[i];
}
double dp[3000][3000];
for (int i = 0; i < 3000; i++) {
for (int j = 0; j < 3000; j++) {
dp[i][j] = 0;
}
} //... | replace | 23 | 24 | 23 | 24 | -11 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repA(i, a, b) for (ll i = a; i <= b; i++)
#define repD(i, b, a) for (int i = b; i >= a; i--)
#define fill(a, val) memset(a, val, sizeof(a))
#define f first
#define s second
ty... | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repA(i, a, b) for (ll i = a; i <= b; i++)
#define repD(i, b, a) for (int i = b; i >= a; i--)
#define fill(a, val) memset(a, val, sizeof(a))
#define f first
#define s second
ty... | replace | 23 | 24 | 23 | 24 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int u = 1e5 + 5;
int main() {
int n;
cin >> n;
long double a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
if (n > 2) {
long double dp[n + 1][n + 1];
memset(dp, 0, sizeof dp);
dp[0][0] = 1;
for (int i = 1; i <= n; i++)
dp[i][0] = dp[i - 1... | #include <bits/stdc++.h>
using namespace std;
int u = 1e5 + 5;
int main() {
int n;
cin >> n;
long double a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
if (n > 2) {
long double dp[n + 1][n + 1];
memset(dp, 0, sizeof dp);
dp[0][0] = 1;
for (int i = 1; i <= n; i++)
dp[i][0] = dp[i - 1... | replace | 18 | 21 | 18 | 21 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr, A) for (auto itr = A.begin(); itr != A.end(); itr++)
te... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr, A) for (auto itr = A.begin(); itr != A.end(); itr++)
te... | replace | 47 | 48 | 47 | 48 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define dbg(n) cout << '\n' << #n << " is " << n << '\n';
#define pb push_back
#define all(v) v.begin(), v.end()
#define cs(i) cout << "Case " << i + 1 << ": \n";
#define FAST ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define dbg(n) cout << '\n' << #n << " is " << n << '\n';
#define pb push_back
#define all(v) v.begin(), v.end()
#define cs(i) cout << "Case " << i + 1 << ": \n";
#define FAST ... | replace | 13 | 14 | 13 | 14 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 1010
#define pb push_back
#define fi first
#define se second
#define si size()
#define ll long long
#define mp make_pair
#define iter ::iterator
#define all(v) v.begin(), v.end()
#define pp pop_back
#define mapiter map<int, int>::iterator
#define forn(i, n) for (int i = 0; i < n; ++i)... | #include <bits/stdc++.h>
#define N 3010
#define pb push_back
#define fi first
#define se second
#define si size()
#define ll long long
#define mp make_pair
#define iter ::iterator
#define all(v) v.begin(), v.end()
#define pp pop_back
#define mapiter map<int, int>::iterator
#define forn(i, n) for (int i = 0; i < n; ++i)... | replace | 1 | 2 | 1 | 2 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <iostream>
#define mp make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
const int MAXN = 3500;
template <typename T> inline T read() {
T res = 0, flag = 1;
char in = ge... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <iostream>
#define mp make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
const int MAXN = 3500;
template <typename T> inline T read() {
T res = 0, flag = 1;
char in = ge... | delete | 61 | 65 | 61 | 61 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int n;
ld dp[3005][3005];
ld p[3005];
bool mark[3005][3005];
ld solve(int up, int down) {
if (up + down == n)
return up > down ? 1 : 0;
if (mark[up][down])
return dp[up][down];
ld &ans = dp[up][down];
int idx... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int n;
ld dp[3005][3005];
ld p[3005];
bool mark[3005][3005];
ld solve(int up, int down) {
if (up + down == n)
return up > down ? 1 : 0;
if (mark[up][down])
return dp[up][down];
mark[up][down] = 1;
ld &ans = d... | insert | 17 | 17 | 17 | 18 | TLE | |
p03168 | C++ | Runtime Error | #include <iomanip>
#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn = 1e3 + 100;
int n;
double ans;
double a[maxn];
double dp[maxn][maxn];
int main() {
cout << fixed << setprecision(10);
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%lf", &a[i]);
dp[0][0] = 1;
for (int... | #include <iomanip>
#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn = 3e3 + 100;
int n;
double ans;
double a[maxn];
double dp[maxn][maxn];
int main() {
cout << fixed << setprecision(10);
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%lf", &a[i]);
dp[0][0] = 1;
for (int... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Runtime Error |
#include <array>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define int long long
#define fast_cin \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... |
#include <array>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define int long long
#define fast_cin \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | replace | 27 | 28 | 27 | 28 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
double dp[3001][3001];
double solve(vector<double> ar, int i, int x) {
if (x == 0) {
return 1;
}
if (i == 0) {
return 0;
}
if (dp[i][x] > -0.9) {
return dp[i][x];
}
return dp[i][x] = ar[i] * solve(ar, i - 1, x - 1) +
(1 - ar[i])... | #include <bits/stdc++.h>
using namespace std;
double dp[3001][3001];
double solve(vector<double> &ar, int i, int x) {
if (x == 0) {
return 1;
}
if (i == 0) {
return 0;
}
if (dp[i][x] > -0.9) {
return dp[i][x];
}
return dp[i][x] = ar[i] * solve(ar, i - 1, x - 1) +
(1 - ar[i]... | replace | 3 | 4 | 3 | 4 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int64_t, int64_t> pll;
typedef vector<int64_t> vl;
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
const long double PI = acos(-1);
#define INF (2147483647)
#define mod (100000000... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int64_t, int64_t> pll;
typedef vector<int64_t> vl;
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
const long double PI = acos(-1);
#define INF (2147483647)
#define mod (100000000... | replace | 22 | 23 | 22 | 23 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set... | #include <algorithm>
#include <bitset>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set... | replace | 30 | 31 | 30 | 31 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define rep(a, b, c) for (int a = (int)b; a < (int)c; a++)
#define repe(a, b, c) for (int a = (int)b; a <= (int)c; a++)
#define repk(a, b, c, k) for (int a = (int)b; a < (int)c; a += (int)k)
#define comeback \
... | #include <bits/stdc++.h>
#define pb push_back
#define rep(a, b, c) for (int a = (int)b; a < (int)c; a++)
#define repe(a, b, c) for (int a = (int)b; a <= (int)c; a++)
#define repk(a, b, c, k) for (int a = (int)b; a < (int)c; a += (int)k)
#define comeback \
... | replace | 26 | 27 | 26 | 27 | 0 | |
p03168 | C++ | Runtime Error |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
/*
||||||||||||||||||||||||||||||||||||||||||||||||
| ||| | |||| |||| | |
| | | | | | | | | | |
| | | | | | | | | | |
... |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
/*
||||||||||||||||||||||||||||||||||||||||||||||||
| ||| | |||| |||| | |
| | | | | | | | | | |
| | | | | | | | | | |
... | replace | 108 | 109 | 108 | 111 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define pr_double(x) cout << fixed << setprecision(10) << x;
double dp[3001][3001];
double solve(vector<double> &ar, int i, int x) {
if (x == 0) {
return 1;
} else if (i == 0) {
return 0;
}
if (dp[i][x] > 0.9) {
return dp[i][x];
}
return dp[i][x... | #include <bits/stdc++.h>
using namespace std;
#define pr_double(x) cout << fixed << setprecision(10) << x;
double dp[3001][3001];
double solve(vector<double> &ar, int i, int x) {
if (x == 0) {
return 1;
} else if (i == 0) {
return 0;
}
if (dp[i][x] > -0.9) {
return dp[i][x];
}
return dp[i][... | replace | 14 | 15 | 14 | 15 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
const int MAXN = 300 + 5;
using namespace std;
int n;
long double dp[MAXN][MAXN], probability[MAXN];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> probability[i];
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
dp[i + 1][j] += dp... | #include <bits/stdc++.h>
const int MAXN = 3000 + 5;
using namespace std;
int n;
long double dp[MAXN][MAXN], probability[MAXN];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> probability[i];
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
dp[i + 1][j] += d... | replace | 2 | 3 | 2 | 3 | 0 | |
p03168 | Python | Time Limit Exceeded | N = int(input())
P = list(map(float, input().split()))
dp = [0] * (N + 1)
dp[0] = 1
for i in range(1, N + 1):
tmp = dp
dp = [0] * (N + 1)
for j in range(N):
if j < N:
dp[j + 1] += tmp[j] * P[i - 1]
dp[j] += tmp[j] * (1 - P[i - 1])
num = 0
for i in range(N // 2 + 1, N + 1):
... | N = int(input())
P = list(map(float, input().split()))
# dp = [[0] * (N + 1) for i in range(N + 1)]
# dp[0][0] = 1.0
# for i in range(1, N + 1):
# for j in range(N):
# if j < N:
# dp[i][j + 1] += dp[i - 1][j] * P[i - 1]
# dp[i][j] += dp[i - 1][j] * (1 - P[i - 1])
#
# num = 0
# for i in r... | insert | 2 | 2 | 2 | 16 | TLE | |
p03168 | Python | Time Limit Exceeded | # -*- coding: utf-8 -*-
# from collections import deque
from sys import setrecursionlimit
setrecursionlimit(1000000)
# INF = float("inf")
# d = deque()
# ---Input---#
n = int(input())
# n, k = map(int, input().split())
p = list(map(float, input().split()))
p = [-1] + p
memo = [[-1 for _ in [0] * (n + 1)] for _ in ... | # -*- coding: utf-8 -*-
# from collections import deque
from sys import setrecursionlimit
setrecursionlimit(1000000)
# INF = float("inf")
# d = deque()
# ---Input---#
n = int(input())
# n, k = map(int, input().split())
p = list(map(float, input().split()))
p = [-1] + p
memo = [[-1 for _ in [0] * (n + 1)] for _ in ... | insert | 32 | 32 | 32 | 36 | TLE | |
p03168 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull = unsigned long long;
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ... | #include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull = unsigned long long;
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ... | replace | 32 | 33 | 32 | 33 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
double dp[3001][3001];
double calc_prob(int n, vector<double> pH, ll HC, vector<vector<double>> &dp) {
if (HC == 0) {
return 1;
}
if (n < 0) {
return 0;
}
if (dp[n][HC] > -0.9) {
return dp[n][HC];
}
double ans = pH[n] * calc_p... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
double dp[3001][3001];
double calc_prob(int n, vector<double> &pH, ll HC, vector<vector<double>> &dp) {
if (HC == 0) {
return 1;
}
if (n < 0) {
return 0;
}
if (dp[n][HC] > -0.9) {
return dp[n][HC];
}
double ans = pH[n] * calc_... | replace | 4 | 5 | 4 | 5 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
double dp[3001][3001];
double calc_prob(int n, vector<double> pH, ll HC) {
if (HC == 0) {
return 1;
}
if (n < 0) {
return 0;
}
if (dp[n][HC] > -0.9) {
return dp[n][HC];
}
double ans = pH[n] * calc_prob(n - 1, pH, HC - 1) +
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
double dp[3001][3001];
double calc_prob(int n, vector<double> &pH, ll HC) {
if (HC == 0) {
return 1;
}
if (n < 0) {
return 0;
}
if (dp[n][HC] > -0.9) {
return dp[n][HC];
}
double ans = pH[n] * calc_prob(n - 1, pH, HC - 1) +
... | replace | 4 | 5 | 4 | 5 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define M 1000000007
using namespace std;
ld dp[3001][3001];
ld f(vector<ld> &a, int i, int x) {
if (x == 0)
return 1;
if (i == 0)
return 0;
if (dp[i][x] > -0.9)
return dp[i][x];
return d... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define M 1000000007
using namespace std;
ld dp[3001][3001];
ld f(vector<ld> &a, int i, int x) {
if (x == 0)
return 1;
if (i == 0)
return 0;
if (dp[i][x] > -0.9)
return dp[i][x];
return d... | replace | 23 | 27 | 23 | 27 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ld long double
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define endl '\n'
const int mod = 1e9 + 7, u = 1e3 + 5;
ld dp[u][u];
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
ld p[n + 1];
for (int i = 1; ... | #include <bits/stdc++.h>
using namespace std;
#define ld long double
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define endl '\n'
const int mod = 1e9 + 7, u = 3e3 + 5;
ld dp[u][u];
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
ld p[n + 1];
for (int i = 1; ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less_equal<int>, rb_tree_tag, \
tree_order_statistic... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less_equal<int>, rb_tree_tag, \
tree_order_statistic... | replace | 35 | 36 | 35 | 40 | -11 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 3001, mod = 1e9 + 7;
double p[N];
double dp[N][N];
int n;
double dfs(int pos, int k) {
if (pos == n + 1) {
return k == 0 ? 1.0 : 0.0;
}
double &ret = dp[pos][k];
if (ret > 0)
return ret;
ret = 0.0;
ret = p[pos] * dfs... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 3001, mod = 1e9 + 7;
double p[N];
double dp[N][N];
int n;
double dfs(int pos, int k) {
if (pos == n + 1) {
return k == 0 ? 1.0 : 0.0;
}
double &ret = dp[pos][k];
if (ret != -1.0)
return ret;
ret = 0.0;
ret = p[pos] *... | replace | 15 | 16 | 15 | 16 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.en... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.en... | delete | 72 | 74 | 72 | 72 | TLE | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
... | #include <algorithm>
#include <bitset>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
... | replace | 245 | 246 | 245 | 246 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll, ll>
#define vvll vector<vector<ll>>
#define pb push_back
#define sz... | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll, ll>
#define vvll vector<vector<ll>>
#define pb push_back
#define sz... | replace | 75 | 77 | 75 | 77 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
int n;
double dp[N][N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
dp[0][0] = 1;
for (int i = 1; i <= n; ++i) {
double p;
cin >> p;
for (int j = 0; j <= i; ++j) {
int k = i - j;
... | #include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
int n;
double dp[N][N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
dp[0][0] = 1;
for (int i = 1; i <= n; ++i) {
double p;
cin >> p;
for (int j = 0; j <= i; ++j) {
int k = i - j;
... | replace | 21 | 22 | 21 | 25 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define MOD 1000000007
double probs[3000];
double recur(int i, int n, int heads, int tails, double sa) {
if (i == n) {
if (heads > tails)
return sa;
else
return ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define MOD 1000000007
double probs[3000];
double recur(int i, int n, int heads, int tails, double sa) {
if (i == n) {
if (heads > tails)
return sa;
else
return ... | insert | 38 | 38 | 38 | 40 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define N 100000
#define f(i, a, b) for (ll i = (ll)a; i <= (ll)b; i++)
#define rf(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--)
#define po pop_back
#define pb push_back
#define lb lower_bound
#define fi first
#define se second
#define debug(x) cout << #x << " = " << x <... | #include <bits/stdc++.h>
#define ll long long int
#define N 100000
#define f(i, a, b) for (ll i = (ll)a; i <= (ll)b; i++)
#define rf(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--)
#define po pop_back
#define pb push_back
#define lb lower_bound
#define fi first
#define se second
#define debug(x) cout << #x << " = " << x <... | replace | 33 | 34 | 33 | 35 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
void func(vector<double> &p, double &sum, int n, int i, double mult) {
int sz = p.size();
if (i == sz) {
if (n >= ceil(double(sz) / 2.0)) {
sum += mult;
}
return;
}
func(p, sum, n + 1, i + 1, mult * p[i]);
func(p, sum, n, i + 1, mult * (1 - p[i])... | #include <bits/stdc++.h>
using namespace std;
void func(vector<double> &p, double &sum, int n, int i, double mult) {
int sz = p.size();
if (i == sz) {
if (n >= ceil(double(sz) / 2.0)) {
sum += mult;
}
return;
}
func(p, sum, n + 1, i + 1, mult * p[i]);
func(p, sum, n, i + 1, mult * (1 - p[i])... | replace | 23 | 24 | 23 | 45 | TLE | |
p03168 | C++ | Runtime Error | #include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
const int N = 3e3 + 3;
int n;
double p[N];
double dp[N][2 * N];
int main() {
// freopen("input.inp", "r", stdin);
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> p[i];
dp[1][1 + N... | #include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
const int N = 3e3 + 3;
int n;
double p[N];
double dp[N][2 * N];
int main() {
// freopen("input.inp", "r", stdin);
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> p[i];
dp[1][1 + N... | replace | 21 | 22 | 21 | 22 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int, int>;
int main() {
int N;
cin >> N;
vector<double> p(N);
rep(i, N) ci... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int, int>;
int main() {
int N;
cin >> N;
vector<double> p(N);
rep(i, N) ci... | replace | 24 | 25 | 24 | 25 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 2e3 + 7;
double a[MAX], dp[MAX][MAX];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> a[i];
dp[0][0] = 1.;
for (int i = 1; i <= n; ++i)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 3e3 + 7;
double a[MAX], dp[MAX][MAX];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> a[i];
dp[0][0] = 1.;
for (int i = 1; i <= n; ++i)
... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.en... | #include <bits/stdc++.h>
using namespace std;
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.en... | replace | 38 | 39 | 38 | 39 | TLE | |
p03168 | C++ | Runtime Error | #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
#define int long long int
#define pb push_back
#define pii pair<int, int>
#define fi first
#define se second
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define dbg(x) \
{ cerr... | #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
#define int long long int
#define pb push_back
#define pii pair<int, int>
#define fi first
#define se second
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define dbg(x) \
{ cerr... | replace | 30 | 31 | 30 | 31 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
bool visited[3000][3000];
double dp[3000][3000];
double solve(int h, int t, double *p) {
if (visited[h][t] == true)
return dp[h][t];
else {
if (h > t) {
dp[h][t] = 0;
visited[h][t] = true;
return 0;
}
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
bool visited[3000][3000];
double dp[3000][3000];
double solve(int h, int t, double *p) {
if (visited[h][t] == true)
return dp[h][t];
else {
if (h > t) {
dp[h][t] = 0;
visited[h][t] = true;
return 0;
}
... | replace | 36 | 37 | 36 | 37 | 0 | |
p03168 | C++ | Time Limit Exceeded | /************
* @Just Another Source code by: ankit.sangwan1999
* @created on: 25 May 2020
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL... | /************
* @Just Another Source code by: ankit.sangwan1999
* @created on: 25 May 2020
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL... | replace | 21 | 25 | 21 | 25 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef array<ll, 2> pll;
const ll NMAX = 1005, MOD = 1e9 + 7;
ld dp[NMAX][NMAX];
int main() {
ll n;
ld p, ans = 0;
... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef array<ll, 2> pll;
const ll NMAX = 3005, MOD = 1e9 + 7;
ld dp[NMAX][NMAX];
int main() {
ll n;
ld p, ans = 0;
... | replace | 9 | 10 | 9 | 10 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FAST_IO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
using namespace std;
typedef long ... | #include <bits/stdc++.h>
#define FAST_IO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
using namespace std;
typedef long ... | replace | 31 | 35 | 31 | 32 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define PB emplace_back
using namespace std;
const int N = 1e3 + 100, mod = 1e9 + 7;
long double dp[N];
int main() {
cout << setprecision(12) << fixed;
dp[0] = 1;
long long int n;
cin >> n;
for (int i = 0; i < n; i++) {
lo... | #include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define PB emplace_back
using namespace std;
const int N = 1e4 + 100, mod = 1e9 + 7;
long double dp[N];
int main() {
cout << setprecision(12) << fixed;
dp[0] = 1;
long long int n;
cin >> n;
for (int i = 0; i < n; i++) {
lo... | replace | 9 | 10 | 9 | 10 | 0 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
std::cout << fixed << setprecision(10);
int n;
cin >... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
std::cout << fixed << setprecision(10);
int n;
cin >... | replace | 23 | 24 | 23 | 24 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store")
#pragma GCC optimize("-fno-defer-pop")
#define all(a) a.begin(), a.end()
#define ll long long int
#define ps push_back
#define fs first
#define sc second
#define mkp mak... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store")
#pragma GCC optimize("-fno-defer-pop")
#define all(a) a.begin(), a.end()
#define ll long long int
#define ps push_back
#define fs first
#define sc second
#define mkp mak... | replace | 36 | 40 | 36 | 37 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define sz(a) int(a.size())
#define ll long long
#define ull unsigned long long
// #define mod int(1e9+7)
#define endl '\n'
#define Engz \
ios::sync_with_stdio(0); ... | #include <bits/stdc++.h>
using namespace std;
#define sz(a) int(a.size())
#define ll long long
#define ull unsigned long long
// #define mod int(1e9+7)
#define endl '\n'
#define Engz \
ios::sync_with_stdio(0); ... | replace | 57 | 58 | 57 | 58 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7;
const ll INF = 2e15 + 10;
const ll MAX = 1e14 + 10;
const ld EPS = 1e-9;
const int N ... | #include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7;
const ll INF = 2e15 + 10;
const ll MAX = 1e14 + 10;
const ld EPS = 1e-9;
const int N ... | replace | 14 | 15 | 14 | 15 | 0 | |
p03168 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int N;
vector<double> v;
double memo[1009][1009];
bool vis[1009][1009];
bool g[1009][1009];
ll mod = 1e9 + 7;
double sol(int pos, int k) {
if (pos == N... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int N;
vector<double> v;
double memo[3009][3009];
bool vis[3009][3009];
ll mod = 1e9 + 7;
double sol(int pos, int k) {
if (pos == N)
return k > (N ... | replace | 7 | 10 | 7 | 9 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define fi first
#define fastio \
ios_base::sync_with_stdio(... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define fi first
#define fastio \
ios_base::sync_with_stdio(... | replace | 174 | 178 | 174 | 178 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
double a[N], sum, d[N][N];
int n, kek;
int main() {
cin >> n;
d[0][0] = 1;
for (int i = 1; i <= n; i++) {
cin >> a[i];
d[i][0] = 1;
}
d[n][0] = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
d[i][j] ... | #include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 10;
double a[N], sum, d[N][N];
int n, kek;
int main() {
cin >> n;
d[0][0] = 1;
for (int i = 1; i <= n; i++) {
cin >> a[i];
d[i][0] = 1;
}
d[n][0] = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
d[i][j] ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | /* aman36 - Aman Raj */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define IOS \
ios ::sync_with_stdio(false); \
cin.tie(0); ... | /* aman36 - Aman Raj */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define IOS \
ios ::sync_with_stdio(false); \
cin.tie(0); ... | replace | 119 | 120 | 119 | 120 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<double> p(n);
vector<double> dp(n, 0);
dp[0] = 1;
for (int i = 0; i < n; i++) {
cin >> p[i];
for (int j = i; j >= 0; j--) {
dp[j + 1] += dp[j... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<double> p(n);
vector<double> dp(n + 1, 0);
dp[0] = 1;
for (int i = 0; i < n; i++) {
cin >> p[i];
for (int j = i; j >= 0; j--) {
dp[j + 1] += ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
const int N = 1e3 + 2;
c... | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
const int N = 1e3 + 2;
c... | insert | 32 | 32 | 32 | 33 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, b) for (int i = 0; i < (b); ++i)
#define endl '\n'
#define sz(x) (int)x.size()
#define mod %
#define fillchar(x, y, z) memset(x, z, y)
#define pii pair<int, int>
#define f... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, b) for (int i = 0; i < (b); ++i)
#define endl '\n'
#define sz(x) (int)x.size()
#define mod %
#define fillchar(x, y, z) memset(x, z, y)
#define pii pair<int, int>
#define f... | replace | 16 | 17 | 16 | 17 | 0 | |
p03168 | C++ | Runtime Error | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// #include <math.h>
// #include <algorithm>
#include <vector>
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main(int argc, char *argv[]) {
long n;
scanf("%ld", &n);
double gp0[1500] = {0}... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// #include <math.h>
// #include <algorithm>
#include <vector>
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main(int argc, char *argv[]) {
long n;
scanf("%ld", &n);
double gp0[3001] = {0}... | replace | 16 | 18 | 16 | 18 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define fr(a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define triplet pair<int, pair<int, int>>
#define fast_io \
ios_base::sync_with_stdio(false); \
... | #include <bits/stdc++.h>
#define ll long long
#define fr(a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define triplet pair<int, pair<int, int>>
#define fast_io \
ios_base::sync_with_stdio(false); \
... | insert | 12 | 12 | 12 | 15 | 0 | |
p03168 | C++ | Time Limit Exceeded | /*
author: kartik8800
*/
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr(a, b) for (ll i = a; i < b; i++)
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define prDouble(x) cout << fixed << setprecision(10) << x
#define triplet pair<ll, pair<ll, ll>>
#define fast_io ... | /*
author: kartik8800
*/
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr(a, b) for (ll i = a; i < b; i++)
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define prDouble(x) cout << fixed << setprecision(10) << x
#define triplet pair<ll, pair<ll, ll>>
#define fast_io ... | replace | 17 | 18 | 17 | 18 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull;
typedef long double ld;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull;
typedef long double ld;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | replace | 19 | 20 | 19 | 20 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
int N;
double p[3333];
double dp[3333][3333]; // dp[i][j]: 表i枚、裏j枚が出る確率
signed main() {
// 入力
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
}
dp[0][0] = 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int N;
double p[3333];
double dp[3333][3333]; // dp[i][j]: 表i枚、裏j枚が出る確率
signed main() {
// 入力
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
}
dp[0][0] = 1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
... | insert | 19 | 19 | 19 | 21 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define dbg3(x, y, z) \
cerr << "(" << #x << ", " << #y << ", " << #z << ") = " \
<< "(" << x << ", " << y << ", " << z << ")" << endl;
template <typename T> void ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define dbg3(x, y, z) \
cerr << "(" << #x << ", " << #y << ", " << #z << ") = " \
<< "(" << x << ", " << y << ", " << z << ")" << endl;
template <typename T> void ... | insert | 32 | 32 | 32 | 34 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
int N;
double p[3333]; // コインの表が出る確率
double dp[3333][3333];
signed main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
}
dp[0][0] = 1; // DPテーブルを初期化
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
// おも... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int N;
double p[3333]; // コインの表が出る確率
double dp[3333][3333];
signed main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
}
dp[0][0] = 1; // DPテーブルを初期化
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (i... | insert | 18 | 18 | 18 | 20 | 0 | |
p03168 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define MAXN ((int)1e3 + 5)
#define MOD ((int)1e9 + 7)
#define ll long long
#define _ << " " <<
#define TRACE(x) cout << #x << " = " << x << endl;
#define pb push_back
#define MP make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define MAXN ((int)3e3 + 5)
#define MOD ((int)1e9 + 7)
#define ll long long
#define _ << " " <<
#define TRACE(x) cout << #x << " = " << x << endl;
#define pb push_back
#define MP make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ... | replace | 4 | 5 | 4 | 5 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#include <ext/pb_ds/assoc_containe... | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#include <ext/pb_ds/assoc_containe... | delete | 39 | 46 | 39 | 39 | -11 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#inc... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#inc... | replace | 56 | 57 | 56 | 57 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
double dp[MAXN][MAXN], p[MAXN];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
dp[0][0] = 1.0;
for (int i = 1; i <= n; i++) {
for (int h = 0; h <= n; h++) {
dp[i][h] = (1.0 - p[i]) * dp[i - 1][h];
... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e3 + 5;
double dp[MAXN][MAXN], p[MAXN];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
dp[0][0] = 1.0;
for (int i = 1; i <= n; i++) {
for (int h = 0; h <= n; h++) {
dp[i][h] = (1.0 - p[i]) * dp[i - 1][h];
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int M = 2e3 + 4;
double dp[M][M], p[M], ans;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 0; j <= i; j++) {
if (j == 0)
dp[i][j] = dp[i - 1][j] * (1 - ... | #include <bits/stdc++.h>
using namespace std;
const int M = 3e3 + 4;
double dp[M][M], p[M], ans;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 0; j <= i; j++) {
if (j == 0)
dp[i][j] = dp[i - 1][j] * (1 - ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03168 | C++ | Time Limit Exceeded |
// ~/SolverToBe/Developers/Corvus
// ~/sudo apt-get verdict Accpeted
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#includ... |
// ~/SolverToBe/Developers/Corvus
// ~/sudo apt-get verdict Accpeted
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#includ... | replace | 41 | 42 | 41 | 42 | TLE | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define ll long long
#define pii pair<int, int>
#defin... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define ll long long
#define pii pair<int, int>
#defin... | replace | 38 | 39 | 38 | 39 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 4;
#define ll long long
long double p[MAXN], dp[MAXN][MAXN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> p[i];
dp[0][0] = 1;
for (int i = 1; i <= ... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e3 + 4;
#define ll long long
long double p[MAXN], dp[MAXN][MAXN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> p[i];
dp[0][0] = 1;
for (int i = 1; i <= ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long lli;
typedef long double lld;
#define mod 1000000007
#define mod2 998244353
#define fori(n) for (int i = 0; i < n; i++)
#define forj(n) for (int j = 0; j < n; j++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fast ios:... | #include <bits/stdc++.h>
using namespace std;
typedef long long lli;
typedef long double lld;
#define mod 1000000007
#define mod2 998244353
#define fori(n) for (int i = 0; i < n; i++)
#define forj(n) for (int j = 0; j < n; j++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fast ios:... | replace | 54 | 55 | 54 | 55 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define start... | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define start... | replace | 55 | 56 | 55 | 58 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define fr(i, a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define f... | #include <bits/stdc++.h>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define fr(i, a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define f... | delete | 30 | 34 | 30 | 30 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define forin(i, a, b) for (int i = a; i < (int)b; i++)
#define rofin(i, a, b) for (int i = a; i > b; i--)
#define v vector
#define crap \
ios::sync_with_... | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define forin(i, a, b) for (int i = a; i < (int)b; i++)
#define rofin(i, a, b) for (int i = a; i > b; i--)
#define v vector
#define crap \
ios::sync_with_... | replace | 20 | 21 | 20 | 21 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
// #define mp make_pair
#define eb emplace_back
#define pb push_back
#define ss second
#define ff first
#define IOS \
ios::sync_with_stdio(0); ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
// #define mp make_pair
#define eb emplace_back
#define pb push_back
#define ss second
#define ff first
#define IOS \
ios::sync_with_stdio(0); ... | delete | 56 | 60 | 56 | 56 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> isPair;
using vvll = vector<vector<ll>>;
using vll = vector<ll>;
#define Pll pair<ll, ll>
#defin... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> isPair;
using vvll = vector<vector<ll>>;
using vll = vector<ll>;
#define Pll pair<ll, ll>
#defin... | replace | 57 | 58 | 57 | 58 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
long double prob[3000];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
long double p;
prob[0] = 1;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> p;
for (int j = 2 * n; j >= 1; j--) {
prob[j] = pro... | #include <bits/stdc++.h>
using namespace std;
#define int long long
long double prob[3000];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
long double p;
prob[0] = 1;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> p;
for (int j = n; j >= 1; j--) {
prob[j] = prob[j]... | replace | 13 | 14 | 13 | 14 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define PI 3.141592653589
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cou... | #include <bits/stdc++.h>
#define ll long long
#define PI 3.141592653589
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cou... | replace | 18 | 19 | 18 | 19 | TLE | |
p03168 | C++ | Runtime Error | // if acyclic graph try toposort
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define ub upper_bound
#define lb lower_bound
#define all(v) ((v).begin()), ((v).end())
#define allr(v)... | // if acyclic graph try toposort
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define ub upper_bound
#define lb lower_bound
#define all(v) ((v).begin()), ((v).end())
#define allr(v)... | replace | 81 | 82 | 81 | 82 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n;
double p[N], f[N][N] = {1.0}; // f[i][j]表示前i个硬币中j个正面向上的概率
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%lf", &p[i]);
f[i][0] = f[i - 1][0] * (1.0 - p[i]);
for (int j = 1; j <= i; j++)
f[i][j] = f[i - 1... | #include <bits/stdc++.h>
using namespace std;
const int N = 3010;
int n;
double p[N], f[N][N] = {1.0}; // f[i][j]表示前i个硬币中j个正面向上的概率
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%lf", &p[i]);
f[i][0] = f[i - 1][0] * (1.0 - p[i]);
for (int j = 1; j <= i; j++)
f[i][j] = f[i - 1... | replace | 2 | 3 | 2 | 3 | 0 | |
p03168 | C++ | Runtime Error | /*
Created by Rishu Sahu @ covid 20-20
*/
/*
*****************************************************************
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
cin.sync_with_stdio(0); ... | /*
Created by Rishu Sahu @ covid 20-20
*/
/*
*****************************************************************
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
cin.sync_with_stdio(0); ... | replace | 31 | 32 | 31 | 32 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
// For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test \
int t; \
cin >> t; ... | #include <bits/stdc++.h>
// For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test \
int t; \
cin >> t; ... | replace | 57 | 58 | 57 | 58 | 0 | |
p03168 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <... | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <... | replace | 115 | 116 | 115 | 116 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long int n;
cin >> n;
vector<double> p(n + 1, 0);
double ans[303][303];
ans[0][0] = 1;
for (long int i = 1; i <= n; i++) {
cin >> p[i];
}
for (long int i = 1; i <= n; i++) {
double head = p[i], tail = 1 - p[i];
ans[0][i] = tail * an... | #include <bits/stdc++.h>
using namespace std;
int main() {
long int n;
cin >> n;
vector<double> p(n + 1, 0);
double ans[3003][3003];
ans[0][0] = 1;
for (long int i = 1; i <= n; i++) {
cin >> p[i];
}
for (long int i = 1; i <= n; i++) {
double head = p[i], tail = 1 - p[i];
ans[0][i] = tail * ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for (int i = a; i < b; i++)
#define eb emplace_back
#define mp make_pair
typedef long long int lli;
typedef unsigned long long int ulli;
const int INF = INT_MAX;
const lli MOD = 10e8 + 7;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL)... | #include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for (int i = a; i < b; i++)
#define eb emplace_back
#define mp make_pair
typedef long long int lli;
typedef unsigned long long int ulli;
const int INF = INT_MAX;
const lli MOD = 10e8 + 7;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL)... | replace | 15 | 16 | 15 | 16 | 0 | |
p03168 | C++ | Runtime Error | #include <iomanip>
#include <iostream>
const int MAXN = 300 + 5;
using namespace std;
int n;
long double dp[MAXN][MAXN], probability[MAXN];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> probability[i];
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
dp[i... | #include <iomanip>
#include <iostream>
const int MAXN = 3000 + 5;
using namespace std;
int n;
long double dp[MAXN][MAXN], probability[MAXN];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> probability[i];
dp[0][0] = 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
dp[... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll do... | #include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll do... | replace | 13 | 14 | 13 | 14 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int, int>
#define pdd pair<double, double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#defi... | #include <bits/stdc++.h>
#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int, int>
#define pdd pair<double, double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#defi... | replace | 41 | 42 | 41 | 42 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int tar = (n - 1) / 2 + 1;
vector<double> pn(tar + 1);
for (int i = 0; i < n; ++i)
cin >> pn[i];
vector<double> dp(n, 0);
dp[0] = 1;
for (int i = 0; i < n; ++i)
for (int j = min(i + 1, tar); j >= 0; --j) {
if (j =... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int tar = (n - 1) / 2 + 1;
vector<double> pn(3000);
for (int i = 0; i < n; ++i)
cin >> pn[i];
vector<double> dp(n, 0);
dp[0] = 1;
for (int i = 0; i < n; ++i)
for (int j = min(i + 1, tar); j >= 0; --j) {
if (j == t... | replace | 7 | 8 | 7 | 8 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, k) for (int i = (int)j; i <= (int)k; i++)
#define debug(x) cerr << #x << ":" << x << endl
const int maxn = (int)1e6 + 5;
double p[maxn], dp[1004][1004], ans;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
re... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, k) for (int i = (int)j; i <= (int)k; i++)
#define debug(x) cerr << #x << ":" << x << endl
const int maxn = (int)1e6 + 5;
double p[maxn], dp[3004][3004], ans;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
re... | replace | 5 | 6 | 5 | 6 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define PRAGMA 448
#ifdef PRAGMA
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#ifdef LUCARIO
#define deb(...) fprintf(stderr, __VA_ARGS__)
#define deb1(x) cerr <... | #include <bits/stdc++.h>
using namespace std;
// #define PRAGMA 448
#ifdef PRAGMA
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#ifdef LUCARIO
#define deb(...) fprintf(stderr, __VA_ARGS__)
#define deb1(x) cerr <... | replace | 60 | 61 | 60 | 61 | -11 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set... | replace | 181 | 186 | 181 | 182 | -11 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<double> dp(n);
dp[0] = 1;
for (int i = 0; i < n; ++i) {
double p;
cin >> p;... | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<double> dp(n + 1);
dp[0] = 1;
for (int i = 0; i < n; ++i) {
double p;
cin >... | replace | 13 | 14 | 13 | 14 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.