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++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define printWithPrecision(x) cout << fixed << setprecision(10) << x << endl;
double dp[3001][3001];
double solve(vector<double> v, ll i, ll x) {
if (x == 0)
return 1;
if (i == 0)
return 0;
if (dp[i][x] > -0.9)
return dp[i][x];
r... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define printWithPrecision(x) cout << fixed << setprecision(10) << x << endl;
double dp[3001][3001];
double solve(vector<double> &v, ll i, ll x) {
if (x == 0)
return 1;
if (i == 0)
return 0;
if (dp[i][x] > -0.9)
return dp[i][x];
... | replace | 8 | 9 | 8 | 9 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007;
vector<vector<double>> dp; // dp(i,j) probablity of coming j heads when i coins
vector<double> p;
double probhead(int n, int heads) {
if (dp[n][heads] != -1) {
return dp[n][heads];
}
return probhead(n - 1, heads) * (1 - p[n]) +
p... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007;
vector<vector<double>> dp; // dp(i,j) probablity of coming j heads when i coins
vector<double> p;
double probhead(int n, int heads) {
if (dp[n][heads] != -1) {
return dp[n][heads];
}
return dp[n][heads] = probhead(n - 1, heads) * (1 - p[n... | replace | 11 | 13 | 11 | 13 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define MOD 1000000007
#define PI acos(-1)
#define eps (1e-... | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define MOD 1000000007
#define PI acos(-1)
#define eps (1e-... | replace | 42 | 43 | 42 | 43 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i, x, n) for (int i = x; i < n; i++)
#define all(c) c.begin(), c.end()
const int MOD = 1e9 + 7, N = 2e3 + 10;
const int LINF = LLONG_MAX;
double dp[N][N];
double C[N];
int n;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i, x, n) for (int i = x; i < n; i++)
#define all(c) c.begin(), c.end()
const int MOD = 1e9 + 7, N = 3e3 + 10;
const int LINF = LLONG_MAX;
double dp[N][N];
double C[N];
int n;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL... | replace | 5 | 6 | 5 | 6 | 0 | |
p03168 | C++ | Runtime Error | //****** @mdazmat9 **********
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define UB upper_bound
#define LB lower_bound
#define BS binary_search
#define EB emplace_back
#define PB push_back
#define endl "\n"
#define MOD 1000000007
#define MOD2 998244353
#define F first
#defi... | //****** @mdazmat9 **********
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define UB upper_bound
#define LB lower_bound
#define BS binary_search
#define EB emplace_back
#define PB push_back
#define endl "\n"
#define MOD 1000000007
#define MOD2 998244353
#define F first
#defi... | replace | 78 | 82 | 78 | 79 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define loop(i, n) for (int i = 0; i < n; ++i)
#define LOOP(i, a, b) for (int i = a; i < b; ++i)
#define max3(a, b, c) max(a, max(b, c))
#define max4(a, b, c, d) max3(a, b, max(c, d))
#def... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define loop(i, n) for (int i = 0; i < n; ++i)
#define LOOP(i, a, b) for (int i = a; i < b; ++i)
#define max3(a, b, c) max(a, max(b, c))
#define max4(a, b, c, d) max3(a, b, max(c, d))
#def... | insert | 42 | 42 | 42 | 43 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pb push_back
#define show(x) c... | #include <bits/stdc++.h>
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pb push_back
#define show(x) c... | delete | 47 | 52 | 47 | 47 | -11 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll N;
double dp[3099][3099], p[3099], head[3099], tail[3099];
double f(ll n, ll m) {
if (n == 0) {
if (m == 0)
return 1;
else
return 0;
}
if (m == 0) {
return tail[n];
}
if (m == n) {
return head[n];
}
if (dp[n... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll N;
double dp[3099][3099], p[3099], head[3099], tail[3099];
double f(ll n, ll m) {
if (n == 0) {
if (m == 0)
return 1;
else
return 0;
}
if (m == 0) {
return tail[n];
}
if (m == n) {
return head[n];
}
if (dp[n... | replace | 19 | 20 | 19 | 20 | TLE | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// #define FILE_INPUT
// #define DEBUG_MODE
void DebugPrint(double a[], int n) {
#ifdef DEBUG_MODE
for (int i = 0; i < min(20, n); ++i) {
cout << a[i] << ",";
}
cout << end... | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// #define FILE_INPUT
// #define DEBUG_MODE
void DebugPrint(double a[], int n) {
#ifdef DEBUG_MODE
for (int i = 0; i < min(20, n); ++i) {
cout << a[i] << ",";
}
cout << end... | replace | 20 | 21 | 20 | 21 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define Mod 1... | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define Mod 1... | insert | 53 | 53 | 53 | 54 | TLE | |
p03168 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("avx")
// #include<bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define ... | #pragma GCC optimize("O3")
#pragma GCC target("avx")
// #include<bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define ... | replace | 37 | 38 | 37 | 38 | 0 | |
p03168 | C++ | Runtime Error | // Author rahuliitkgp
/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
// Men at Work :)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
#define ff first
#define ss second
... | // Author rahuliitkgp
/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
// Men at Work :)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
#define ff first
#define ss second
... | delete | 39 | 43 | 39 | 39 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03168 | C++ | Runtime Error | /*input
1
0.5
*/
// author - Madhav Thakker
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using... | /*input
1
0.5
*/
// author - Madhav Thakker
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using... | replace | 86 | 87 | 86 | 87 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define debug(x) cerr << #x << " = " << (x) << endl;
template <typename T> ostream &operator<<(ostream &o, vector<T> &v) {
for (auto &x : v... | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define debug(x) cerr << #x << " = " << (x) << endl;
template <typename T> ostream &operator<<(ostream &o, vector<T> &v) {
for (auto &x : v... | replace | 17 | 19 | 17 | 19 | 0 | |
p03168 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <vector>
#define DEBUG 0
constexpr int kMax = 301;
int main() {
int N;
std::cin >> N;
std::vector<double> p(N + 1);
for (int i = 1; i <= N; ++i)
std::cin >> p[i];
double dp[kMax][kMax];
dp[0][0] = 1.0;
for (int j = 1; j <= N; ++j) {
dp[0][j] = 0.0;... | #include <cstdio>
#include <iostream>
#include <vector>
#define DEBUG 0
constexpr int kMax = 3001;
int main() {
int N;
std::cin >> N;
std::vector<double> p(N + 1);
for (int i = 1; i <= N; ++i)
std::cin >> p[i];
double dp[kMax][kMax];
dp[0][0] = 1.0;
for (int j = 1; j <= N; ++j) {
dp[0][j] = 0.0... | replace | 4 | 5 | 4 | 5 | 0 | |
p03168 | C++ | Runtime Error | // Write correct codes,then there is no need to debug
// Implement after solving several problems
// - GENNADY KOROTKEVICH
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false);... | // Write correct codes,then there is no need to debug
// Implement after solving several problems
// - GENNADY KOROTKEVICH
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false);... | replace | 168 | 181 | 168 | 178 | -11 | |
p03168 | C++ | Runtime Error | // turmak-_-
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define nl "\n"
#define IOI return 0;
#define pb push_back
#define ll long long
#define ld long double
#define IOS \
ios_base ::sync_with_stdio(NULL); ... | // turmak-_-
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define nl "\n"
#define IOI return 0;
#define pb push_back
#define ll long long
#define ld long double
#define IOS \
ios_base ::sync_with_stdio(NULL); ... | replace | 25 | 27 | 25 | 27 | 0 | |
p03168 | C++ | Time Limit Exceeded | // Copyright © 2020 Pradeep Singh. All rights reserved.
/*
Zeckendrof's theorem : Each positive number can be represented as a sum of three
fibonacci numbers such that no two consecutive fib number is used. binomial :
C(n,r) = C(n-1,r-1)+C(n-1,r) , C(n,0)=1 catalan : C(2*n,n)/(n+1);
*/
#include <algorithm>
#include ... | // Copyright © 2020 Pradeep Singh. All rights reserved.
/*
Zeckendrof's theorem : Each positive number can be represented as a sum of three
fibonacci numbers such that no two consecutive fib number is used. binomial :
C(n,r) = C(n-1,r-1)+C(n-1,r) , C(n,0)=1 catalan : C(2*n,n)/(n+1);
*/
#include <algorithm>
#include ... | replace | 42 | 44 | 42 | 44 | TLE | |
p03168 | C++ | Runtime Error | #pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
#define int lon... | #pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
#define int lon... | replace | 77 | 78 | 77 | 78 | 0 | |
p03168 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define mt make_tuple
#define pb push_back
const int N = 1e3 + 10;
double dp[N][N], p[N];
int main() {
int n;
double ans = 0;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
for (int i = 0; i <= n; i++)
dp[0][i] = 0;
dp[0][0... | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define mt make_tuple
#define pb push_back
const int N = 3010;
double dp[N][N], p[N];
int main() {
int n;
double ans = 0;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i];
for (int i = 0; i <= n; i++)
dp[0][i] = 0;
dp[0][0] = ... | replace | 5 | 6 | 5 | 6 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
double dp[110][110];
int main() {
int n;
cin >> n;
vector<double> p(n + 1);
for (int i = 1; i <= n; i++)
cin >> p[i];
for (int i = 0; i <= n; i++)
dp[0][i] = 1;
for (int i = 1; i <= n; i++)
for (int x = 0; x <= i; x++)
if (!x)
dp[x]... | #include <bits/stdc++.h>
using namespace std;
double dp[3001][3001];
int main() {
int n;
cin >> n;
vector<double> p(n + 1);
for (int i = 1; i <= n; i++)
cin >> p[i];
for (int i = 0; i <= n; i++)
dp[0][i] = 1;
for (int i = 1; i <= n; i++)
for (int x = 0; x <= i; x++)
if (!x)
dp[... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 100;
int n;
double a[maxn], dp[maxn][maxn];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
dp[i][j] += dp[i - 1][j - 1] * a[i];
}
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 100;
int n;
double a[maxn], dp[maxn][maxn];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
dp[i][j] += dp[i - 1][j - 1] * a[i];
}
... | replace | 2 | 3 | 2 | 3 | 0 | |
p03168 | C++ | Runtime Error | #include <cassert>
#include <cstdio>
int n, licz;
long double start;
long double tab[3003][3003];
long double res;
long double chance(int t, long double x, long double y) {
if (t == 0)
return (1.0 - x) * (1.0 - y);
if (t == 1)
return 1.0 - (1.0 - x) * (1.0 - y) - x * y;
else
return x * y;
}
// 0 -> ... | #include <cassert>
#include <cstdio>
int n, licz;
long double start;
long double tab[3003][3003];
long double res;
long double chance(int t, long double x, long double y) {
if (t == 0)
return (1.0 - x) * (1.0 - y);
if (t == 1)
return 1.0 - (1.0 - x) * (1.0 - y) - x * y;
else
return x * y;
}
// 0 -> ... | replace | 44 | 45 | 44 | 45 | -11 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n;
const int MAX = 3010;
double moedas[MAX];
double memo[MAX][MAX];
double pd(int i, int k) {
if (i >= n)
return k >= (n / 2 + 1);
if (memo[i][k] != -1.0)
return memo[i][k];
return ((1.0 - moedas[i]) * pd(i + 1, k)) + (moedas[i] * pd(i + 1, k + 1));
}
i... | #include <bits/stdc++.h>
using namespace std;
int n;
const int MAX = 3010;
double moedas[MAX];
double memo[MAX][MAX];
double pd(int i, int k) {
if (i >= n)
return k >= (n / 2 + 1);
if (memo[i][k] != -1.0)
return memo[i][k];
return memo[i][k] = ((1.0 - moedas[i]) * pd(i + 1, k)) +
(... | replace | 13 | 14 | 13 | 15 | TLE | |
p03168 | C++ | Runtime Error |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define sp(x) fixed << setprecision(x)
#define fast_io \
ios_base::sync_with_stdio(false); ... |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define sp(x) fixed << setprecision(x)
#define fast_io \
ios_base::sync_with_stdio(false); ... | replace | 42 | 43 | 42 | 43 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X) << 1)
#define R(X) (((X) << 1) | 1)
#define... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X) << 1)
#define R(X) (((X) << 1) | 1)
#define... | replace | 43 | 44 | 43 | 44 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF (1 << 29)
#define INFF 0x7fffffff
#define LINF (1ll << 60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for (int i = 0; i < n; i++)
#define _fj(n) for (int j = 0; j < n; j++)
#define _fk(n) for (int k = 0; k < n; k++)
#define all(x... | #include <bits/stdc++.h>
using namespace std;
#define INF (1 << 29)
#define INFF 0x7fffffff
#define LINF (1ll << 60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for (int i = 0; i < n; i++)
#define _fj(n) for (int j = 0; j < n; j++)
#define _fk(n) for (int k = 0; k < n; k++)
#define all(x... | insert | 43 | 43 | 43 | 44 | TLE | |
p03168 | C++ | Time Limit Exceeded | /* "miles to go before I sleep." */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define pi 3.14159265358979323846
#define pb push_back
#define mk make_pair
#define popcnt(a) \
_Generic((a), int ... | /* "miles to go before I sleep." */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define pi 3.14159265358979323846
#define pb push_back
#define mk make_pair
#define popcnt(a) \
_Generic((a), int ... | replace | 29 | 30 | 29 | 30 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
vector<double> p(n, 0);
vector<vector<double>> pb =
vector<vector<double>>(n + 1, vector<double>(n + 1, 0));
pb[0][0] = 1;
for (int i = 1; i <= n; i++) {
scanf("%lf", &p[i]);
for (int j = 0; j < i; j++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
vector<double> p(n + 1, 0);
vector<vector<double>> pb =
vector<vector<double>>(n + 1, vector<double>(n + 1, 0));
pb[0][0] = 1;
for (int i = 1; i <= n; i++) {
scanf("%lf", &p[i]);
for (int j = 0; j < i; j++) {
... | replace | 7 | 8 | 7 | 8 | 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;
#define ll long long int
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define MOD 1000000007
#define pb push_back
#define S s... | #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;
#define ll long long int
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define MOD 1000000007
#define pb push_back
#define S s... | replace | 135 | 136 | 135 | 136 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#if defined __has_include
#if __has_include(<bits/debug_aamir.h>)
#define dbg(...) DEBUG(#__VA_ARGS__, __VA_ARGS__);
#include <bits/debug_aamir.h>
#else
#define dbg(...)
#endif
#endif
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long l... | #include <bits/stdc++.h>
using namespace std;
#if defined __has_include
#if __has_include(<bits/debug_aamir.h>)
#define dbg(...) DEBUG(#__VA_ARGS__, __VA_ARGS__);
#include <bits/debug_aamir.h>
#else
#define dbg(...)
#endif
#endif
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long l... | replace | 31 | 32 | 31 | 32 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// 分解
// dp[i][j] := i番目までのコインを投げて,表がちょうどj枚になる確率
double dp[3030][3030];
// dp[i][j] = dp[i-1]... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// 分解
// dp[i][j] := i番目までのコインを投げて,表がちょうどj枚になる確率
double dp[3030][3030];
// dp[i][j] = dp[i-1]... | replace | 23 | 24 | 23 | 24 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// どういうDPか
// dp[i][j] := i枚目のコインを投げたとき,表がj枚である確率
// 計算方法
// 1-index
// dp[0][0] = 1.0
// dp[i... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using namespace std;
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
// どういうDPか
// dp[i][j] := i枚目のコインを投げたとき,表がj枚である確率
// 計算方法
// 1-index
// dp[0][0] = 1.0
// dp[i... | replace | 28 | 29 | 28 | 29 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #include <iomanip>
#include <iostream>
using namespace std;
const long long MAXN = 1001;
double dp[MAXN][MAXN];
double p[MAXN];
int main() {
int n;
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++) {
dp[i + 1][j + ... | #include <iomanip>
#include <iostream>
using namespace std;
const long long MAXN = 3001;
double dp[MAXN][MAXN];
double p[MAXN];
int main() {
int n;
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++) {
dp[i + 1][j + ... | replace | 4 | 5 | 4 | 5 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define N 1005
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define piii pair<int, pii>
#define print(x) cout << #x << "=" << x << "\t";
#define endl "\n"
#define newline cout << endl;
int n;
double p[N];
double d... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define N 3005
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define piii pair<int, pii>
#define print(x) cout << #x << "=" << x << "\t";
#define endl "\n"
#define newline cout << endl;
int n;
double p[N];
double d... | replace | 4 | 5 | 4 | 5 | 0 | |
p03168 | C++ | Runtime Error | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<double> p;
p.resize(n + 1);
int i, j, k;
for (i = 1; i <= n; i++)
cin >> p[i];
vector<vector<double>> prob;
prob.resize(n + 1);
for (i = 0; i <= n; i++)
prob[i].resize(n);
prob... | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<double> p;
p.resize(n + 1);
int i, j, k;
for (i = 1; i <= n; i++)
cin >> p[i];
vector<vector<double>> prob;
prob.resize(n + 1);
for (i = 0; i <= n; i++)
prob[i].resize(n + 1);
... | replace | 16 | 17 | 16 | 17 | -6 | malloc(): corrupted top size
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define MOD 1000000007
#define nl '\n'
#define pb push_back
#define mp m... | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define MOD 1000000007
#define nl '\n'
#define pb push_back
#define mp m... | replace | 12 | 13 | 12 | 13 | 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;
using namespace std;
#define ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set ... | #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;
#define ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set ... | replace | 97 | 98 | 97 | 98 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define vii vector<int>
#define vll vector<long long int>
#def... | #include <bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define vii vector<int>
#define vll vector<long long int>
#def... | replace | 40 | 41 | 40 | 41 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
const int64 INF = 1LL << 59;
const int mod = 1e9 + 7;
int N;
double P[3000];
double dp[6002][3000];
bool memo[6002][3000];
double rec(int up, int idx) {
if (idx == N)
return up > 3000 ? 1.0 : 0.0;
if (exchange(memo[up][idx], true))
r... | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
const int64 INF = 1LL << 59;
const int mod = 1e9 + 7;
int N;
double P[3000];
double dp[6002][3000];
bool memo[6002][3000];
double rec(int up, int idx) {
if (idx == N)
return up > 3000 ? 1.0 : 0.0;
if (exchange(memo[up][idx], true))
r... | replace | 28 | 29 | 28 | 29 | -11 | |
p03168 | C++ | Runtime Error | // I - Coins
#include <bits/stdc++.h>
using namespace std;
using dl = double;
int main() {
int N;
cin >> N;
vector<dl> P(N + 1);
for (int i = 1; i <= N; i++)
cin >> P[i];
int C = (N + 1) / 2; // ceil
vector<dl> dp(N + 2);
dp[1] = 1.;
for (int lv = 1; lv <= N; lv++) {
dl f = P[lv], b = 1. - f;... | // I - Coins
#include <bits/stdc++.h>
using namespace std;
using dl = double;
int main() {
int N;
cin >> N;
vector<dl> P(N + 1);
for (int i = 1; i <= N; i++)
cin >> P[i];
int C = (N + 1) / 2; // ceil
vector<dl> dp(N + 2);
dp[1] = 1.;
for (int lv = 1; lv <= N; lv++) {
dl f = P[lv], b = 1. - f;... | replace | 18 | 19 | 18 | 20 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define debug1(x) cout << #x << " " << x << endl;
#define debug2(x, y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define debug3(x, y, z) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z <<... | #include <bits/stdc++.h>
using namespace std;
#define debug1(x) cout << #x << " " << x << endl;
#define debug2(x, y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define debug3(x, y, z) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z <<... | replace | 21 | 22 | 21 | 22 | 0 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, s, n) for (int i = s, i##_len = (n); i < i##_len; ++i)
#define al... | #include <algorithm>
#include <assert.h>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, s, n) for (int i = s, i##_len = (n); i < i##_len; ++i)
#define al... | replace | 41 | 42 | 41 | 42 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ts to_string
#define ub upper_bound
#define lb lower_bound
const char nl = '\n';
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl =... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ts to_string
#define ub upper_bound
#define lb lower_bound
const char nl = '\n';
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl =... | replace | 76 | 77 | 76 | 77 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define F first
#define S second
#define ld long douroote
#define pb push_back
#define sz size
#define ll long long
#define ull unsigned long long
#define INF 0x7f7f7f7f
#define sc(a) scanf("%d", &a)
#define scll(a) scanf("%lld", &a)
#define scd(a) scanf("%lf", &a)
#define scc(a) scanf(" %c", &... | #include <bits/stdc++.h>
#define F first
#define S second
#define ld long douroote
#define pb push_back
#define sz size
#define ll long long
#define ull unsigned long long
#define INF 0x7f7f7f7f
#define sc(a) scanf("%d", &a)
#define scll(a) scanf("%lld", &a)
#define scd(a) scanf("%lf", &a)
#define scc(a) scanf(" %c", &... | insert | 53 | 53 | 53 | 54 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, n) for (ll i = x; i < n; i++)
#define pb push_back
#define ll long long
#define hii cout << "hii" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
#define int ll
#define mpp make_pair
#define endl '\n'
#define ff first
#define ss second
#define ... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, n) for (ll i = x; i < n; i++)
#define pb push_back
#define ll long long
#define hii cout << "hii" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
#define int ll
#define mpp make_pair
#define endl '\n'
#define ff first
#define ss second
#define ... | replace | 33 | 34 | 33 | 34 | 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;
#define ll long long
#define pb push_back
#define vi vector<ll int>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define rs(v, n) v.resize(n)
#define hell 100000... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define vi vector<ll int>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define rs(v, n) v.resize(n)
#define hell 100000... | replace | 61 | 62 | 61 | 62 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MP(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define INF LLONG_MAX / 2... | #include "bits/stdc++.h"
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MP(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define INF LLONG_MAX / 2... | replace | 45 | 49 | 45 | 50 | TLE | |
p03168 | C++ | Runtime Error | #pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
double dp[3003][3003];
void solve() {
int n;
cin >> n;
double data[n + 5], ans = 0;
for (int i = 1; i <= n; i++)
cin >> data[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
dp[i][... | // #pragma GCC optimize("O3", "unroll-loops")
// #pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
double dp[3003][3003];
void solve() {
int n;
cin >> n;
double data[n + 5], ans = 0;
for (int i = 1; i <= n; i++)
cin >> data[i];
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
... | replace | 0 | 2 | 0 | 2 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long int ll;
long double dp[3001][3001] = {0};
long double p[3001] = {0};
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.t... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long int ll;
long double dp[3001][3001] = {0};
long double p[3001] = {0};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout << setprecision(20) << fixed;
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
... | delete | 11 | 16 | 11 | 11 | -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 ll l... | #include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll l... | replace | 35 | 36 | 35 | 36 | -6 | munmap_chunk(): invalid pointer
|
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
template <class T> using v = std::vector<T>;
template <class T> using vv = v<v<T>>;
const int mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
// const int mod = 9982... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
template <class T> using v = std::vector<T>;
template <class T> using vv = v<v<T>>;
const int mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
// const int mod = 9982... | replace | 88 | 89 | 88 | 89 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
double mem[3000][3000];
int vis[3000][3000];
int n;
double arr[3000];
double go(int x, int y) {
if (x >= n)
return (y > n - y);
if (vis[x][y])
return mem[x][y];
return mem[x][y] = (arr[x] * go(x + 1, y + 1) + (1 - arr[x]) * go(x + 1, y));
}
int main() {
... | #include <bits/stdc++.h>
using namespace std;
double mem[3000][3000];
int vis[3000][3000];
int n;
double arr[3000];
double go(int x, int y) {
if (x >= n)
return (y > n - y);
if (vis[x][y])
return mem[x][y];
vis[x][y] = 1;
return mem[x][y] = (arr[x] * go(x + 1, y + 1) + (1 - arr[x]) * go(x + 1, y));
}... | insert | 14 | 14 | 14 | 15 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
using namespace std;
ll h;
ll w;
double dp[1000][1000];
int main() {
ll n;
cin >> n;
double a[40000];
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
dp[0][0] = 1.0;
for (ll i = 1; i <= n; i++) {
for (ll j = 0; j <= i; j++) {
... | #include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
using namespace std;
ll h;
ll w;
double dp[3000][3000];
int main() {
ll n;
cin >> n;
double a[40000];
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
dp[0][0] = 1.0;
for (ll i = 1; i <= n; i++) {
for (ll j = 0; j <= i; j++) {
... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FOR(i, l, r) for (int i = (int)l; i <= (int)r; ++i)
#define REP(i, r) for (int i = (int)0; i < (int)r; ++i)
using namespace std;
typedef long long ll;
const int Nmax = 1e3 + 11;
int n;
double p[Nmax], f[Nmax][Nmax], ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.ti... | #include <bits/stdc++.h>
#define FOR(i, l, r) for (int i = (int)l; i <= (int)r; ++i)
#define REP(i, r) for (int i = (int)0; i < (int)r; ++i)
using namespace std;
typedef long long ll;
const int Nmax = 3e3 + 11;
int n;
double p[Nmax], f[Nmax][Nmax], ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.ti... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
t... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
t... | replace | 99 | 100 | 99 | 100 | 0 | |
p03168 | C++ | Runtime Error | #include <cstdio>
double dp[3000][3000];
int main() {
int n;
scanf("%d", &n);
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
double p;
scanf("%lf", &p);
dp[i][0] = dp[i - 1][0] * (1 - p);
for (int j = 1; j < i; j++)
dp[i][j] = dp[i - 1][j - 1] * p + dp[i - 1][j] * (1 - p);
dp[i][i] = dp[... | #include <cstdio>
double dp[3000][3000];
int main() {
int n;
scanf("%d", &n);
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
double p;
scanf("%lf", &p);
dp[i][0] = dp[i - 1][0] * (1 - p);
for (int j = 1; j < i; j++)
dp[i][j] = dp[i - 1][j - 1] * p + dp[i - 1][j] * (1 - p);
dp[i][i] = dp[... | replace | 15 | 16 | 15 | 16 | -11 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
int i, n, j;
cin >> n;
vector<double> p(n + 1);
for (i = 1; i <= n; ++i)
cin >> p[i];
vector<double> dp(n + 1, 0);
dp[0] = 1;
for (i = 1; i <= n; ++i) {
for (j = i; j >= 0; --j) {
dp[j] = dp[j] * (1 - p[i]);... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
int i, n, j;
cin >> n;
vector<double> p(n + 1);
for (i = 1; i <= n; ++i)
cin >> p[i];
vector<double> dp(n + 1, 0);
dp[0] = 1;
for (i = 1; i <= n; ++i) {
for (j = i; j >= 0; --j) {
dp[j] = dp[j] * (1 - p[i]);... | replace | 18 | 21 | 18 | 21 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS \
... | #include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS \
... | replace | 26 | 27 | 26 | 27 | 0 | |
p03168 | C++ | Time Limit Exceeded | // template {{{
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"
using ld = long double;
using ll = long long;
inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b... | // template {{{
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"
using ld = long double;
using ll = long long;
inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b... | insert | 33 | 33 | 33 | 34 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int n;
double a[3000];
double dp[3000][3000];
double func(int i, int kitne) {
// base case
if (kitne == 0) {
return 1;
}
if (i == n) {
return 0;
}
// recursive case
if (dp[i][kitne] > -1.0) {
return dp[i][kitne];
}
doubl... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int n;
double a[3000];
double dp[3000][3000];
double func(int i, int kitne) {
// base case
if (kitne == 0) {
return 1;
}
if (i == n) {
return 0;
}
// recursive case
if (dp[i][kitne] > -1.0) {
return dp[i][kitne];
}
doubl... | delete | 32 | 36 | 32 | 32 | 0 | |
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];
// dp[i][head]: i-1 番目までのコインを投げたときに表が head 回出る確率
double dp[301][301] = {};
dp[0][0] = 1;
for (int i = 0; i < N; ++i) {
for (... | #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];
// dp[i][head]: i-1 番目までのコインを投げたときに表が head 回出る確率
double dp[3001][3001] = {};
dp[0][0] = 1;
for (int i = 0; i < N; ++i) {
for... | replace | 13 | 14 | 13 | 14 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define trace1(x... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define trace1(x... | replace | 30 | 31 | 30 | 31 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define EPS 10e-9
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define st first
#define nd second
#define sz(v) int(v.size())
#define all(X) (X).begin(), (X).end()
#define ... | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define EPS 10e-9
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define st first
#define nd second
#define sz(v) int(v.size())
#define all(X) (X).begin(), (X).end()
#define ... | insert | 42 | 42 | 42 | 43 | TLE | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919;
const long long INFL = 1LL << 60;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919;
const long long INFL = 1LL << 60;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
... | replace | 49 | 50 | 49 | 58 | TLE | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <vector>
#define ll long long
const ll MOD = 1e9 + 7;
int main() {
std::ios::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<double> p(N);
double dp[N][N];
memset(dp, ... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <vector>
#define ll long long
const ll MOD = 1e9 + 7;
int main() {
std::ios::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<double> p(N);
double dp[N + 1][N + 1];
mem... | replace | 18 | 19 | 18 | 19 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mp make_pair
const int N = 2e3 + 10, Max = 50 + 10;
const int MOD = 1e9 + 7;
double a[N];
double dp[N][N];
int n, m;
double solve(int i, int s) {
if (i == n + 1) {
return s > n / 2 ? ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mp make_pair
const int N = 3e3 + 10, Max = 50 + 10;
const int MOD = 1e9 + 7;
double a[N];
double dp[N][N];
int n, m;
double solve(int i, int s) {
if (i == n + 1) {
return s > n / 2 ? ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define f first
#define s second
#define int long long
using namespace std;
const int N = 3005;
double p[N];
double dp[N][N];
int32_t main() {
ios::sync_with_stdio(false);
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n;
cin >> n;
for (int i = 1; i <=... | #include <bits/stdc++.h>
#define f first
#define s second
#define int long long
using namespace std;
const int N = 3005;
double p[N];
double dp[N][N];
int32_t main() {
ios::sync_with_stdio(false);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n;
cin >> n;
for (int... | replace | 14 | 16 | 14 | 16 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long double ll;
const ll MAX = 400;
vector<ll> ar(3000);
vector<vector<ll>> dp(MAX, vector<ll>(MAX, -1));
ll func(ll n, ll k) {
if (n == 0 && k == 0) {
return 1;
}
if (k > n) {
return 0;
}
if (k < 0 || n < 0) {
return 0;
... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long double ll;
const ll MAX = 4000;
vector<ll> ar(3000);
vector<vector<ll>> dp(MAX, vector<ll>(MAX, -1));
ll func(ll n, ll k) {
if (n == 0 && k == 0) {
return 1;
}
if (k > n) {
return 0;
}
if (k < 0 || n < 0) {
return 0;... | replace | 6 | 7 | 6 | 7 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long double P[1003], dp[1003][1003];
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL), cout.tie(NULL);
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 <= N; j++) {
... | #include <bits/stdc++.h>
using namespace std;
long double P[3003], dp[3003][3003];
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL), cout.tie(NULL);
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 <= N; j++) {
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define pf push_front
#define ll long long
using namespace std;
void TxtRead() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
void TheTime() {
ios_base::sync_with_stdio(false);
cin.ti... | #include <bits/stdc++.h>
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define pf push_front
#define ll long long
using namespace std;
void TxtRead() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
void TheTime() {
ios_base::sync_with_stdio(false);
cin.ti... | replace | 16 | 17 | 16 | 17 | 0 | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define pii pair<ll, ll>
#define debug(a) cout << a << '\n'
#define maxn 3009 /// Still trying to be normal
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for (ll i = a; i < (b); ++i)
#define per(i, b, a) for (ll i = b - 1; ... | #include <bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define pii pair<ll, ll>
#define debug(a) cout << a << '\n'
#define maxn 3009 /// Still trying to be normal
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for (ll i = a; i < (b); ++i)
#define per(i, b, a) for (ll i = b - 1; ... | replace | 32 | 33 | 32 | 33 | 0 | |
p03168 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vecto... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vecto... | replace | 35 | 37 | 35 | 37 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<double> prob;
double dp[3001][3001];
double rec(long long ntail, long long nhead) {
if (ntail + nhead == n)
return (nhead > ntail);
if (dp[ntail + nhead][nhead] != -1.0)
return dp[ntail][nhead];
double a = prob[nta... | #include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<double> prob;
double dp[3001][3001];
double rec(long long ntail, long long nhead) {
if (ntail + nhead == n)
return (nhead > ntail);
if (dp[ntail][nhead] != -1.0)
return dp[ntail][nhead];
double a = prob[ntail + nhe... | replace | 10 | 11 | 10 | 11 | TLE | |
p03168 | C++ | Time Limit Exceeded | // --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;... | // --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;... | delete | 84 | 88 | 84 | 84 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxS = 1e3 + 7;
long double probs[maxS];
long double dp[maxS][maxS];
long double ONE = 1.000000000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> probs[i];
}
for (int i ... | #include <bits/stdc++.h>
using namespace std;
const int maxS = 3e3 + 7;
long double probs[maxS];
long double dp[maxS][maxS];
long double ONE = 1.000000000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> probs[i];
}
for (int i ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03168 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
// #include <stdafx.h>
// #include "targetver.h"
#include <stdio.h>
// #include <tchar.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include ... | #define _CRT_SECURE_NO_WARNINGS
// #include <stdafx.h>
// #include "targetver.h"
#include <stdio.h>
// #include <tchar.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include ... | replace | 67 | 68 | 67 | 68 | 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;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;
*/
typedef long long ll;
typedef unsigned long ... | #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;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;
*/
typedef long long ll;
typedef unsigned long ... | insert | 76 | 76 | 76 | 78 | TLE | |
p03168 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long n;
double h[3010], t[3010], memo[3010][3010], ret = 0;
double dp(int idx, int head) {
if (idx == 0 && head == 0) {
return (double)1.00;
}
if (memo[idx][head] != -1) {
return memo[idx][head];
}
memo[idx][head] = dp(idx - 1, head - 1) * h[idx] +... | #include <bits/stdc++.h>
using namespace std;
long long n;
double h[3010], t[3010], memo[3010][3010], ret = 0;
double dp(int idx, int head) {
if (idx == 0 && head == 0) {
return (double)1.00;
} else if (idx == 0 && head != 0) {
return (double)0.00;
}
if (memo[idx][head] != -1) {
return memo[idx][... | insert | 10 | 10 | 10 | 12 | 0 | |
p03168 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long ... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long ... | insert | 39 | 39 | 39 | 40 | TLE | |
p03169 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
#pragma GCC optimize("Ofast")
... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
#pragma GCC optimize("Ofast")
... | replace | 73 | 75 | 73 | 75 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i, n) for (long long i = 0; i < (n); i++)
#define FOR(i, m, n) for (long long i = (m); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i, n) for (long long i = 0; i < (n); i++)
#define FOR(i, m, n) for (long long i = (m); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED ... | replace | 94 | 95 | 94 | 95 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
// まずは状態を定義。寿司の順番に意味が無いことに気づくので、状態としては、残りの寿司の個数がk枚の皿がそれぞれ何枚あるかということになる。
// 状態遷移は、サイコロを一回降った時にどうなるかを考える。遷移式はそのままだと0個の皿を引いたときに無限ループになるので式変形する必要あり。
// dp[x][y][z] 残り一個のものがx, 残り二個のものがy,
// 残り三個のものがzのときの... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
// まずは状態を定義。寿司の順番に意味が無いことに気づくので、状態としては、残りの寿司の個数がk枚の皿がそれぞれ何枚あるかということになる。
// 状態遷移は、サイコロを一回降った時にどうなるかを考える。遷移式はそのままだと0個の皿を引いたときに無限ループになるので式変形する必要あり。
// dp[x][y][z] 残り一個のものがx, 残り二個のものがy,
// 残り三個のものがzのときの... | replace | 9 | 10 | 9 | 10 | 0 | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lop(i, n) for (ll i = 0; i < n; i++)
#define lop1(i, n) for (ll i = 1; i <= n; i++)
#define lopr(i, n) for (ll i = n - 1; i >= 0; i--)
#define ll long long int
#define pb push_back
#define all(v) v.begin(), v.end()
#define IOS ... | #include <bits/stdc++.h>
using namespace std;
#define lop(i, n) for (ll i = 0; i < n; i++)
#define lop1(i, n) for (ll i = 1; i <= n; i++)
#define lopr(i, n) for (ll i = n - 1; i >= 0; i--)
#define ll long long int
#define pb push_back
#define all(v) v.begin(), v.end()
#define IOS ... | insert | 81 | 81 | 81 | 83 | -11 | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include "rubo.h"
// #define mp make_pair
// #define pb push_back
#define in int
#define ll long long
#define vc vector
#define SQ(j) (j) * (j)
// #define x first
// #define y second
// #define ld long double
#define dbl long double
#define pll pair<long long, long long>
#define pii pair<i... | #include <bits/stdc++.h>
// #include "rubo.h"
// #define mp make_pair
// #define pb push_back
#define in int
#define ll long long
#define vc vector
#define SQ(j) (j) * (j)
// #define x first
// #define y second
// #define ld long double
#define dbl long double
#define pll pair<long long, long long>
#define pii pair<i... | replace | 36 | 37 | 36 | 37 | 0 | |
p03169 | C++ | Runtime Error | // #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vii = vector<int>;
using pii = pair<int, int>;
const ll INF = numeric_limits<ll>::max(), MOD = 1e9 + 7;
const int INF_i = numeric_limits<int>::max(), MAX = 2e2 + 1;
double dp[MAX][MAX][MA... | // #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vii = vector<int>;
using pii = pair<int, int>;
const ll INF = numeric_limits<ll>::max(), MOD = 1e9 + 7;
const int INF_i = numeric_limits<int>::max(), MAX = 3e2 + 1;
double dp[MAX][MAX][MA... | replace | 12 | 13 | 12 | 13 | 0 | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define dbl long double
const int siz = 307;
int n, J, D, T, sum;
dbl dp[3][siz][siz];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
sum += x;
if (x == 1)
J++;
if (x == 2)
D++;
if (x == 3)
... | #include <bits/stdc++.h>
using namespace std;
#define dbl long double
const int siz = 307;
int n, J, D, T, sum;
dbl dp[3][siz][siz];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
sum += x;
if (x == 1)
J++;
if (x == 2)
D++;
if (x == 3)
... | replace | 37 | 39 | 37 | 39 | 0 | |
p03169 | 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 fi first
#define se second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef unsigned ... | #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 fi first
#define se second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef unsigned ... | replace | 21 | 22 | 21 | 22 | -11 | |
p03169 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
typedef long long ll;
int main() {
int n;
cin >> n;
int k = 0, l = 0, m = 0;
rep(i, n) {
int a;
cin >> a;
if (a == 1)
k++;
else if (a == 2)
l++;
else
m++;
}
vector<vector<v... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
typedef long long ll;
int main() {
int n;
cin >> n;
int k = 0, l = 0, m = 0;
rep(i, n) {
int a;
cin >> a;
if (a == 1)
k++;
else if (a == 2)
l++;
else
m++;
}
vector<vector<v... | insert | 24 | 24 | 24 | 26 | TLE | |
p03169 | C++ | Runtime Error |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int>>
#define fin(ar, k, n) \
for (int i = k; i < n; i++) ... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int>>
#define fin(ar, k, n) \
for (int i = k; i < n; i++) ... | delete | 58 | 61 | 58 | 58 | -11 | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9 + 7;
const int INF = 0x3f3f3f3f;
ll max(ll a, ll b) { return a > b ? a : b; }
ll min(ll a, ll b) { return a < b ? a : b; }
int n, x;
vector<int> v(4);
double dp[303][303][303];
double ev[3... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9 + 7;
const int INF = 0x3f3f3f3f;
ll max(ll a, ll b) { return a > b ? a : b; }
ll min(ll a, ll b) { return a < b ? a : b; }
int n, x;
vector<int> v(4);
double dp[303][303][303];
double ev[3... | replace | 19 | 20 | 19 | 20 | -11 | |
p03169 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespac... | #include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespac... | insert | 37 | 37 | 37 | 38 | TLE | |
p03169 | Python | Runtime Error | import numpy as np
from numba import njit
@njit("(f8[:,:,:],i4,i4,i4,i4,)", cache=True)
def solve(dp, N, n1, n2, n3):
if dp[n1][n2][n3] >= 0.0:
return dp[n1][n2][n3]
if n1 == n2 == n3 == 0:
return 0.0
cnt = n1 + n2 + n3
ret = 0
if n3 >= 1:
ret += solve(dp, N, n1, n2 + 1, n... | import numpy as np
from numba import njit
@njit("(f8[:,:,:],i4,i4,i4,i4,)")
def solve(dp, N, n1, n2, n3):
if dp[n1][n2][n3] >= 0.0:
return dp[n1][n2][n3]
if n1 == n2 == n3 == 0:
return 0.0
cnt = n1 + n2 + n3
ret = 0
if n3 >= 1:
ret += solve(dp, N, n1, n2 + 1, n3 - 1) * n3
... | replace | 4 | 5 | 4 | 5 | TLE | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef... | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef... | replace | 66 | 67 | 66 | 67 | -11 | |
p03169 | C++ | Runtime Error | #ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)
#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif
typedef long long ll;
typedef long double ld;
typedef unsigned long long ul... | #ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)
#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif
typedef long long ll;
typedef long double ld;
typedef unsigned long long ul... | replace | 34 | 35 | 34 | 35 | -11 | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#define _CRT_SECURE_NO_WARNINGS
#endif
#define gc getchar_unlocked()
#define pc(x) putchar_unlocked(x)
template <typename T> void scan(T &x) {
x = 0;
register bool _ = 0;
register T c = gc;
_ = c == 45;
... | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#define _CRT_SECURE_NO_WARNINGS
#endif
#define gc getchar_unlocked()
#define pc(x) putchar_unlocked(x)
template <typename T> void scan(T &x) {
x = 0;
register bool _ = 0;
register T c = gc;
_ = c == 45;
... | replace | 75 | 76 | 75 | 76 | -11 | |
p03169 | C++ | Runtime Error | // Nicky's template
// C
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// C++
#include <algorithm>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include... | // Nicky's template
// C
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// C++
#include <algorithm>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include... | replace | 138 | 139 | 138 | 139 | -11 | |
p03169 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
double dp[301][301][301];
int main() {
int n;
cin >> n;
int n1 = 0, n2 = 0, n3 = 0;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
if (x == 1)
n1++;
else if (x == 2)
n2++;
else
n3++;
}
for (int k = 0; k <= n3; ... | #include <cstdio>
#include <iostream>
using namespace std;
double dp[305][305][305];
int main() {
int n;
cin >> n;
int n1 = 0, n2 = 0, n3 = 0;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
if (x == 1)
n1++;
else if (x == 2)
n2++;
else
n3++;
}
for (int k = 0; k <= n3; ... | replace | 3 | 4 | 3 | 4 | -11 | |
p03169 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, inp, cnt1 = 0, cnt2 = 0, cnt3 = 0;
vector<vector<vector<double>>> dp(
305, vector<vector<double>>(305, vector<double>(305)));
cin >> n;
for (int i = 0; i < n; i++) {
cin >> inp;
if (inp... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, inp, cnt1 = 0, cnt2 = 0, cnt3 = 0;
double dp[305][305][305];
// vector<vector<vector<double>>> dp (305, vector<vector<double>> (305 ,
// vector<double> (305)));
cin >> n;
for (int i = 0; i < n; i... | replace | 7 | 9 | 7 | 10 | TLE | |
p03169 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<pi>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vect... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<pi>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vect... | replace | 105 | 106 | 105 | 106 | -11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.