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
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b, i) \ do { \ cout << "["; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b, i) \ do { \ cout << "["; ...
replace
25
26
25
26
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; double dp[301][301][301]; int a[4]; int main() { int n, ai; cin >> n; rep(i, n) { cin >> ai; ++a[ai ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; double dp[304][304][304]; int a[4]; int main() { int n, ai; cin >> n; rep(i, n) { cin >> ai; ++a[ai ...
replace
8
9
8
9
-11
p03169
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long LL; const int MAX = 210000; const ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long LL; const int MAX = 210000; const ...
insert
43
43
43
45
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef long double ld; int n; ld dp[31][31][31]; ld func(int a, int b, int c) { int i, j, l; if (a == 0 && b == 0 && c == 0) return 0; if (dp[a][b][c] != -1) return dp[a][b][c]; ld x, y, z; j = a + b + c; x = (ld)n / (ld)j; ...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef long double ld; int n; ld dp[301][301][301]; ld func(int a, int b, int c) { int i, j, l; if (a == 0 && b == 0 && c == 0) return 0; if (dp[a][b][c] != -1) return dp[a][b][c]; ld x, y, z; j = a + b + c; x = (ld)n / (ld)...
replace
6
7
6
7
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; ld v[301][301][301] = {0.0}; int main() { int n; cin >> n; v[0][0][0] = 0; for (int z = 0; z <= n; z++) { for (int y = 0; y <= n; y++) { for (int x = 0; x <= n; x++) { if ((x + y + z) != 0) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; ld v[303][303][303] = {0.0}; int main() { int n; cin >> n; v[0][0][0] = 0; for (int z = 0; z <= n; z++) { for (int y = 0; y <= n; y++) { for (int x = 0; x <= n; x++) { if ((x + y + z) != 0) { ...
replace
4
5
4
5
-11
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #define ff first #define endl "\n" #define ss second #define li list<int> #define vi vector<int> #define ll long long int #define pii pair<int, int> #define vii vector<pair<int, int>> #define mp ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #define ff first #define endl "\n" #define ss second #define li list<int> #define vi vector<int> #define ll long long int #define pii pair<int, int> #define vii vector<pair<int, int>> #define mp ...
insert
29
29
29
32
TLE
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> using namespace std; #define int long long double dp[301][301][301]; double solve(int x, int y, int z, int &n) { if (x < 0 || y < 0 || z < 0) { return 0; } if (x == 0 && y == 0 && z == 0) { return 0; } double exp = n + x * solve(x - 1, y, z, n) + y * sol...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define int long long double dp[301][301][301]; double solve(int x, int y, int z, int &n) { if (x < 0 || y < 0 || z < 0) { return 0; } if (x == 0 && y == 0 && z == 0) { return 0; } if (dp[x][y][z] > -0.9) { return dp[x][y][z]; ...
insert
14
14
14
17
TLE
p03169
C++
Runtime Error
#ifndef BZ #pragma GCC optimize "-Ofast" #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 double ld; typedef unsigned long long ull;...
#ifndef BZ #pragma GCC optimize "-Ofast" #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 double ld; typedef unsigned long long ull;...
replace
51
53
51
59
-11
p03169
C++
Runtime Error
/*****/ #define TRUE true /**/ #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") /**/ #include <bits/stdc++.h> // #define int long long using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pint = pair<int, int>; using pll ...
/*****/ #define TRUE true /**/ #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") /**/ #include <bits/stdc++.h> // #define int long long using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pint = pair<int, int>; using pll ...
replace
292
293
292
293
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x #define dump_1(x1) cerr << #x1 << ": " << x1 << endl #define dump_2(x1, x2) \ cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl #define dump_3(x1, x2, x...
#include <bits/stdc++.h> #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x #define dump_1(x1) cerr << #x1 << ": " << x1 << endl #define dump_2(x1, x2) \ cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl #define dump_3(x1, x2, x...
replace
63
64
63
64
0
p03169
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int n; double dp[310][310][310]; double dfs(int x3, int x2, int x1) { if (x3 == 0 && x2 == 0 && x1 == 0) return 0.0; else { double sum = (double)(x3 + x2 + x1); double ret = (double)n / sum; if (x3 > 0) ret += d...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int n; double dp[310][310][310]; double dfs(int x3, int x2, int x1) { if (x3 == 0 && x2 == 0 && x1 == 0) return 0.0; else if (dp[x3][x2][x1] > 0) return dp[x3][x2][x1]; else { double sum = (double)(x3 + x2 + x1); do...
insert
12
12
12
14
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef vector<ld> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi; typedef vector<vii> vvii; #define INF INT_MAX #define MOD 1000000007 #define all(x) x.begin(), ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef vector<ld> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vi> vvi; typedef vector<vii> vvii; #define INF INT_MAX #define MOD 1000000007 #define all(x) x.begin(), ...
replace
19
20
19
20
-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; double dp[301][301][301]; int n; // double dfs(int a, int b, int c){ // if(a+b+c == 0) // return 0.0; // if(dp[a][b][c] > -0.5) // return dp[a][b][c]; // double ks = (double)n/ (a+b+c); // double ret=0; // if(a){ // ret += (dfs(a-1,b,c) +...
#include <bits/stdc++.h> using namespace std; double dp[301][301][301]; int n; // double dfs(int a, int b, int c){ // if(a+b+c == 0) // return 0.0; // if(dp[a][b][c] > -0.5) // return dp[a][b][c]; // double ks = (double)n/ (a+b+c); // double ret=0; // if(a){ // ret += (dfs(a-1,b,c) +...
replace
42
45
42
45
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int t; double dp[301][301][301]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; short a[3] = {0}; for (int i = 0; i < t; i++) { int x; cin >> x; a[x - 1]++; } for (int threes = 0; threes <= a[2]; threes++) { for...
#include <bits/stdc++.h> using namespace std; int t; double dp[301][301][301]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; short a[3] = {0}; for (int i = 0; i < t; i++) { int x; cin >> x; a[x - 1]++; } for (int threes = 0; threes <= a[2]; threes++) { for...
replace
16
18
16
18
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int t; double dp[301][301][301]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; short a[3] = {0}; for (int i = 0; i < t; i++) { int x; cin >> x; a[x - 1]++; } for (int threes = 0; threes <= t; threes++) { for (i...
#include <bits/stdc++.h> using namespace std; int t; double dp[301][301][301]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; short a[3] = {0}; for (int i = 0; i < t; i++) { int x; cin >> x; a[x - 1]++; } for (int threes = 0; threes <= t; threes++) { for (i...
replace
16
18
16
18
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1e9 + 7 #define pll pair<long long, long long> #define pdd pair<long double, long double> #define vll vector<ll> #define rep(i, j, n) for (int i = j; i < n; i++) #define mp make_pair #define pb push_back #define pf push_front #define inf 1e...
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1e9 + 7 #define pll pair<long long, long long> #define pdd pair<long double, long double> #define vll vector<ll> #define rep(i, j, n) for (int i = j; i < n; i++) #define mp make_pair #define pb push_back #define pf push_front #define inf 1e...
replace
41
43
41
43
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> #ifdef DBP #define deb(...) fprintf(stderr, __VA_ARGS__) #else #define deb(...) 0 #endif #define fst first #define snd second #define fore(x, a, b) for (int x = (a), qwerty = (b); x < qwerty; x++) #define pb push_back #define mset(a, v) memset((a), (v), sizeof(a)) #define ALL(a) (a).begin(), (a...
#include <bits/stdc++.h> #ifdef DBP #define deb(...) fprintf(stderr, __VA_ARGS__) #else #define deb(...) 0 #endif #define fst first #define snd second #define fore(x, a, b) for (int x = (a), qwerty = (b); x < qwerty; x++) #define pb push_back #define mset(a, v) memset((a), (v), sizeof(a)) #define ALL(a) (a).begin(), (a...
replace
31
32
31
32
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 301; double dp[N][N][N]; int n; int cnt[4]; int main() { cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x]++; } for (int k = 0; k <= n; k++) { for (int j = 0; j <= n; j++) { for (int i = 0; i <= n; i++) { ...
#include <bits/stdc++.h> using namespace std; const int N = 302; double dp[N][N][N]; int n; int cnt[4]; int main() { cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x]++; } for (int k = 0; k <= n; k++) { for (int j = 0; j <= n; j++) { for (int i = 0; i <= n; i++) { ...
replace
3
4
3
4
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long LL; typedef pair<LL, LL> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; const int ...
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long LL; typedef pair<LL, LL> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; const int ...
replace
24
28
24
28
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; const int N = 301; double dp[N][N][N]; int main() { ios::sync_with_stdio(false); int n; cin >> n; vi cnt(3); for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x - 1]++; } for (int c = 0; c <= n; c++) { for (int b = 0...
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; const int N = 303; double dp[N][N][N]; int main() { ios::sync_with_stdio(false); int n; cin >> n; vi cnt(3); for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x - 1]++; } for (int c = 0; c <= n; c++) { for (int b = 0...
replace
4
5
4
5
-11
p03169
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; int main() { int n; cin >> n; int c[4] = {}; for (int i = 0; i < n; i++) { int a; cin >> a; c[a]++; } double dp[301][301][301] = {}; for (int k = 0; k <= c[3]; k++) for (int j = 0; j <= c[2] + c[3]; j++) for (int i = 0; i <=...
#include <iomanip> #include <iostream> using namespace std; int main() { int n; cin >> n; int c[4] = {}; for (int i = 0; i < n; i++) { int a; cin >> a; c[a]++; } double dp[302][302][302] = {}; for (int k = 0; k <= c[3]; k++) for (int j = 0; j <= c[2] + c[3]; j++) for (int i = 0; i <=...
replace
12
13
12
13
-11
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #define int long long #define Matrix vector<vector<int>> // #define Matrix vector<vector<int> > #define double long double #define fastio \ ios_base::sync_with_stdio(false); \ cin.t...
#include <bits/stdc++.h> // #define int long long #define Matrix vector<vector<int>> // #define Matrix vector<vector<int> > #define double long double #define fastio \ ios_base::sync_with_stdio(false); \ cin.t...
replace
62
78
62
68
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 301; double dp[N][N][N]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(9); int n; cin >> n; array<int, 4> cnt{}; int sum = 0; for (int i = 0; i < n; ++i) { int a; cin >> a; ++cnt[a]; ...
#include <bits/stdc++.h> using namespace std; const int N = 310; double dp[N][N][N]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(9); int n; cin >> n; array<int, 4> cnt{}; int sum = 0; for (int i = 0; i < n; ++i) { int a; cin >> a; ++cnt[a]; ...
replace
4
5
4
5
-11
p03169
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i = int(m); i < int...
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i = int(m); i < int...
replace
61
62
61
62
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define sp << " " << #define mod 1000000007 /* mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); long long dice() { uniform_int_distribution<long long> uid(1,2);//specify l and r. return uid(rng) ; } int read() { int cc = getc(stdin); ...
#include <bits/stdc++.h> using namespace std; #define sp << " " << #define mod 1000000007 /* mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); long long dice() { uniform_int_distribution<long long> uid(1,2);//specify l and r. return uid(rng) ; } int read() { int cc = getc(stdin); ...
replace
78
81
78
83
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define IO_OP \ std::ios::sync_with_stdio(0); \ std::cin.tie(0); #define F first #define S second #define V vector #define PB push_back #define MP make_pair #define EB emplace_bac...
#include <bits/stdc++.h> #define IO_OP \ std::ios::sync_with_stdio(0); \ std::cin.tie(0); #define F first #define S second #define V vector #define PB push_back #define MP make_pair #define EB emplace_bac...
replace
22
23
22
23
-11
p03169
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; // dp[0][0][0] = 0 // ans = dp[#{i| a[i] == 1}][][#{k|a[k] == 3}] // dp[i][j][k] = 1 + ((N - i - j - k) / N) * dp[i][j][k] + (i / N) * dp[i - // 1][j][k] + ... (i + j + k) / N * dp[i][j][k] = 1 + (i / N) * dp[i - 1][j][k] // + (j / N) * dp[i + 1][j - 1][k] + ...
#include <iomanip> #include <iostream> using namespace std; // dp[0][0][0] = 0 // ans = dp[#{i| a[i] == 1}][][#{k|a[k] == 3}] // dp[i][j][k] = 1 + ((N - i - j - k) / N) * dp[i][j][k] + (i / N) * dp[i - // 1][j][k] + ... (i + j + k) / N * dp[i][j][k] = 1 + (i / N) * dp[i - 1][j][k] // + (j / N) * dp[i + 1][j - 1][k] + ...
replace
9
10
9
10
-11
p03169
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; const int MAX_N = 100; double p[1 + MAX_N][1 + MAX_N][1 + MAX_N]; int main() { int n; scanf("%d", &n); vector<int> count(3, 0); for (int i = 0; i < n; i++) { int ai; scanf("%d", &ai); ai--; count[ai]++; } p[count[0]][count[1]][count[2]] = 1; ...
#include "bits/stdc++.h" using namespace std; const int MAX_N = 300; double p[1 + MAX_N][1 + MAX_N][1 + MAX_N]; int main() { int n; scanf("%d", &n); vector<int> count(3, 0); for (int i = 0; i < n; i++) { int ai; scanf("%d", &ai); ai--; count[ai]++; } p[count[0]][count[1]][count[2]] = 1; ...
replace
4
5
4
5
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; //.define // #define FILE_IN_OUT #define RET(_x) return cout << (_x) << '\n', 0; #define all(_obj) std::begin(_obj), std::end(_obj) #define loop(_n) for (int i = 0; i < (_n); ++i) #define ceilDiv(_dividend, _divider) \ (((_divide...
#include <bits/stdc++.h> using namespace std; //.define // #define FILE_IN_OUT #define RET(_x) return cout << (_x) << '\n', 0; #define all(_obj) std::begin(_obj), std::end(_obj) #define loop(_n) for (int i = 0; i < (_n); ++i) #define ceilDiv(_dividend, _divider) \ (((_divide...
replace
60
62
60
62
-11
p03169
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define REP(i, m, n) for (int i = (m); i < ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define REP(i, m, n) for (int i = (m); i < ...
insert
121
121
121
122
-11
p03169
C++
Runtime Error
// Radhe Radhe #include <bits/stdc++.h> // #include<boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; // #include<boost/math/common_factor.hpp> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; #include <ext/numeric> using namesp...
// Radhe Radhe #include <bits/stdc++.h> // #include<boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; // #include<boost/math/common_factor.hpp> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; #include <ext/numeric> using namesp...
delete
51
55
51
51
-11
p03169
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); unsigned N; std::cin >> N; vector<vector<vector<double>>> dp( N + 2, vector<vector<double>>(N + 2, vector<double>...
#include <algorithm> #include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); unsigned N; std::cin >> N; vector<vector<vector<double>>> dp( N + 2, vector<vector<double>>(N + 2, vector<double>...
replace
25
31
25
29
TLE
p03169
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
103
104
103
106
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03169
C++
Runtime Error
// KiSmAt #include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const ll inf = 1e18; const int N = 2 * 1e2 + 10; ll res; ll a[N], h[5]; ld dp[N][N][N]; void solve() { ll n, x; cin >> n; for (int i = 0; i < n; ++i) { cin >> x; ...
// KiSmAt #include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const ll inf = 1e18; const int N = 3 * 1e2 + 10; ll res; ll a[N], h[5]; ld dp[N][N][N]; void solve() { ll n, x; cin >> n; for (int i = 0; i < n; ++i) { cin >> x; ...
replace
8
9
8
9
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define mx 1000000007 #define db double using namespace std; db dp[100 + 1][100 + 1][100 + 1] = {0}, n; db solve(int c1, int c2, int c3) { if (dp[c1][c2][c3] != 0) return dp[c1][c2][c3]; if (c1 == 0 && c2 == 0 && c3 == 0) return dp[c1][c2][c3] = 0; db j = 0, k = 0, l = 0, sum =...
#include <bits/stdc++.h> #define mx 1000000007 #define db double using namespace std; db dp[301][301][301] = {0}, n; db solve(int c1, int c2, int c3) { if (dp[c1][c2][c3] != 0) return dp[c1][c2][c3]; if (c1 == 0 && c2 == 0 && c3 == 0) return dp[c1][c2][c3] = 0; db j = 0, k = 0, l = 0, sum = c1 + c2 + c...
replace
6
7
6
7
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; double dp[301][301][301]; double solve(int x, int y, int z, int &n) { if (x < 0 || y < 0 || z < 0) { return 0; } if (dp[x][y][z] > -0.9) { return dp[x][y][z]; } if (x == 0 && y == 0 && z == 0) { return 0; } double exp = n + x * solve(x - 1, ...
#include <bits/stdc++.h> using namespace std; double dp[301][301][301]; double solve(int x, int y, int z, int &n) { if (x < 0 || y < 0 || z < 0) { return 0; } if (dp[x][y][z] > -0.9) { return dp[x][y][z]; } if (x == 0 && y == 0 && z == 0) { return 0; } double exp = n + x * solve(x - 1, ...
replace
29
30
29
30
-11
p03169
C++
Runtime Error
#include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; ++i) cin >> a[i]; vector<int> numSushi(4); int total = 0; for (int i = 0; i < N; ++i) { ++numSushi[a[i]]; total += a[i]; } // dp[i][j][k]: ...
#include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; ++i) cin >> a[i]; vector<int> numSushi(4); int total = 0; for (int i = 0; i < N; ++i) { ++numSushi[a[i]]; total += a[i]; } // dp[i][j][k]: ...
replace
20
21
20
21
0
p03169
C++
Runtime Error
#include <iostream> using namespace std; int sum[4]; double dp[31][31][2]; int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int a; scanf("%d", &a); sum[a]++; } double fail; for (int k = 0; k <= sum[3]; k++) for (int j = 0; j <= sum[3] + sum[2] - k; j++) for (int i =...
#include <iostream> using namespace std; int sum[4]; double dp[301][301][2]; int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int a; scanf("%d", &a); sum[a]++; } double fail; for (int k = 0; k <= sum[3]; k++) for (int j = 0; j <= sum[3] + sum[2] - k; j++) for (int i...
replace
4
5
4
5
0
p03169
C++
Runtime Error
#include <iostream> using namespace std; int sum[4]; double dp[31][31][31]; int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int a; scanf("%d", &a); sum[a]++; } double fail; for (int k = 0; k <= sum[3]; k++) for (int j = 0; j <= sum[3] + sum[2] - k; j++) for (int i ...
#include <iostream> using namespace std; int sum[4]; double dp[301][301][301]; int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int a; scanf("%d", &a); sum[a]++; } double fail; for (int k = 0; k <= sum[3]; k++) for (int j = 0; j <= sum[3] + sum[2] - k; j++) for (int...
replace
4
5
4
5
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int using namespace std; #define MEM(a, b) memset(a, (b), sizeof(a)) double dp[303][303][303] = {}; double dfs(int i, int j, int k, int n) { // if(dp[i][j][k]!=-1) return dp[i][j][k]; if ((i < 0) || (j < 0) || (k < 0)) return 0; else if ((i == 0) && (j == 0) ...
#include <bits/stdc++.h> #define ll long long int using namespace std; #define MEM(a, b) memset(a, (b), sizeof(a)) double dp[303][303][303] = {}; double dfs(int i, int j, int k, int n) { // if(dp[i][j][k]!=-1) return dp[i][j][k]; if ((i < 0) || (j < 0) || (k < 0)) return 0; else if ((i == 0) && (j == 0) ...
replace
24
25
24
25
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define ll long long int #define ulli unsigned long long int #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair #define loop(i, a, b) for (ll i = a; i < b; ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define ll long long int #define ulli unsigned long long int #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair #define loop(i, a, b) for (ll i = a; i < b; ...
replace
80
85
80
85
-11
p03169
C++
Memory Limit Exceeded
#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; typedef vector<vector<ll>> mat; const ll MOD = 1e9 + 7; const ll INF = 2e15 + 10; const ll MAX = 1e14 + 10; c...
#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 double ld; typedef vector<vector<ll>> mat; const ll MOD = 1e9 + 7; const ll INF = 2e15 + 10; const ll MAX = 1e14 + 10; const ...
replace
8
9
8
9
MLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define maxn 302 using namespace std; typedef double db; db dp[maxn][maxn][maxn]; int n, k, cnt[4]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> k; cnt[k]++; } for (int sum = 1; sum <= 3 * n; sum++) for (int k = 0; k * 3 <= sum; k++) for (int j = 0; j ...
#include <bits/stdc++.h> #define maxn 302 using namespace std; typedef double db; db dp[maxn][maxn][maxn]; int n, k, cnt[4]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> k; cnt[k]++; } for (int sum = 1; sum <= 3 * n; sum++) for (int k = 0; k * 3 <= sum; k++) for (int j = 0; j ...
insert
17
17
17
19
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int n; int a[5] = {0}; long double dp[205][205][205]; long double solve(int n1, int n2, int n3) { if ((n1 < 0) || (n2 < 0) || (n3 < 0)) return 0; if (n1 == 0 && n2 == 0 && n3 == 0) return 0; if (dp[n1][n2][n3] != 0) return dp[n1][n2]...
#include <bits/stdc++.h> using namespace std; #define int long long int n; int a[5] = {0}; long double dp[305][305][305]; long double solve(int n1, int n2, int n3) { if ((n1 < 0) || (n2 < 0) || (n3 < 0)) return 0; if (n1 == 0 && n2 == 0 && n3 == 0) return 0; if (dp[n1][n2][n3] != 0) return dp[n1][n2]...
replace
5
6
5
6
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) #define RFOR(i, a, b) for (int i = (a)-1; i >= (b); i--) #define rrep(i, n) RFOR(i, n, 0) using namespace std; typedef long long ll; typedef unsigned long long ull; int n; const int max_n = 303; double dp[ma...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) #define RFOR(i, a, b) for (int i = (a)-1; i >= (b); i--) #define rrep(i, n) RFOR(i, n, 0) using namespace std; typedef long long ll; typedef unsigned long long ull; int n; const int max_n = 303; double dp[ma...
replace
52
61
52
53
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define maxn 100005 #define ld long double ll fastpower(ll b, ll p) { ll k = p % 2 ? b : 1; return p == 0 ? 1 : k * (fastpower(b * b, p / 2)); } ld dp[105][105][105]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define maxn 100005 #define ld long double ll fastpower(ll b, ll p) { ll k = p % 2 ? b : 1; return p == 0 ? 1 : k * (fastpower(b * b, p / 2)); } ld dp[305][305][305]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n...
replace
11
12
11
12
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n; double dp[305][305][305]; int cnt[4]; int main() { freopen("j.in", "r", stdin); // freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; int t; for (int i = 0; i < n; i++) { cin >> t; cnt[t]++; } dp[...
#include <bits/stdc++.h> using namespace std; int n; double dp[305][305][305]; int cnt[4]; int main() { // freopen("j.in", "r", stdin); // freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; int t; for (int i = 0; i < n; i++) { cin >> t; cnt[t]++; } ...
replace
7
8
7
8
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; namespace Base { #define mr make_pair typedef long long ll; typedef double db; const int inf = 0x3f3f3f3f, INF = 0x7fffffff; const ll infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll; template <typename T> void read(T &x) { x = 0; int fh = 1; double num = 1....
#include <bits/stdc++.h> using namespace std; namespace Base { #define mr make_pair typedef long long ll; typedef double db; const int inf = 0x3f3f3f3f, INF = 0x7fffffff; const ll infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll; template <typename T> void read(T &x) { x = 0; int fh = 1; double num = 1....
replace
37
38
37
38
-11
p03169
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; #define MAXN 310 typedef long double ld; ld dp[MAXN][MAXN][MAXN]; int N; int sushi[MAXN]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> sushi[i]; } for (int k = 0; k <= N; k++) { for (int j = 0; j <= N; j++) { for (int i...
#include <iomanip> #include <iostream> using namespace std; #define MAXN 310 typedef long double ld; ld dp[MAXN][MAXN][MAXN]; int N; int sushi[MAXN]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> sushi[i]; } for (int k = 0; k <= N; k++) { for (int j = 0; j <= N; j++) { for (int i...
replace
24
26
24
27
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 1LL << 61; vector<vector<vector<double>>> dp(300, vector<vector<double>>(300, vector<double>(300, -1))); l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 1LL << 61; vector<vector<vector<double>>> dp(301, vector<vector<double>>(301, vector<double>(301, -1))); l...
replace
11
12
11
12
-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 putchar(x) cout << (x) #define repeat(x) \ int _ = 0; \ _ < (x); ...
//{{{ #include <bits/stdc++.h> using namespace std; #define putchar(x) cout << (x) #define repeat(x) \ int _ = 0; \ _ < (x); ...
replace
230
231
230
231
-11
p03169
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; template <class T> using ...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; template <class T> using ...
replace
39
41
39
41
-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 ll long long #define pb push_back #define N 1000000007 #define nmax 200001 #define pll pair<ll, ll> #define fill_nums(A, n) \ for (ll i = 0; i < n; i++) \ ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define N 1000000007 #define nmax 200001 #define pll pair<ll, ll> #define fill_nums(A, n) \ for (ll i = 0; i < n; i++) \ ...
replace
42
43
42
43
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03169
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(...
replace
46
47
46
47
0
p03169
C++
Runtime Error
#include <iomanip> #include <iostream> #include <vector> using namespace std; double dp[305][305][305]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; int x = 0, y = 0, z = 0; for (int i = 0; i < N; i++) { int a; cin >> a; if (a == 1) x++; if (a == 2) ...
#include <iomanip> #include <iostream> #include <vector> using namespace std; double dp[305][305][305]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; int x = 0, y = 0, z = 0; for (int i = 0; i < N; i++) { int a; cin >> a; if (a == 1) x++; if (a == 2) ...
replace
26
27
26
27
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false;...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false;...
replace
27
28
27
28
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define all(x) (x).begin(), ...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define all(x) (x).begin(), ...
replace
66
67
66
68
0
p03169
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> #include <vector> #define MAXN 105 #define INF 0x3f3f3f3f #define p 1000000007 #define rint register int #define LL long long #define LD long double using namespace std; int n, sum, a[MAXN], num[4]...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> #include <vector> #define MAXN 305 #define INF 0x3f3f3f3f #define p 1000000007 #define rint register int #define LL long long #define LD long double using namespace std; int n, sum, a[MAXN], num[4]...
replace
8
9
8
9
0
p03169
C++
Runtime Error
#include <algorithm> #include <bitset> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #in...
#include <algorithm> #include <bitset> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #in...
replace
40
41
40
41
-11
p03169
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ...
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ...
replace
66
67
66
67
0
p03169
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <math.h> #include <set> #include <unordered_map> #include <vector> using namespace std; #define ll long long #define mod 1000000007 double dp[301][301][301]; double solve_ite(int *a, int n, i...
#include <algorithm> #include <climits> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <math.h> #include <set> #include <unordered_map> #include <vector> using namespace std; #define ll long long #define mod 1000000007 double dp[301][301][301]; double solve_ite(int *a, int n, i...
replace
20
22
20
22
TLE
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ld = long double; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; vector<vector<vector<ld>>> dp( n + 1, vector<vector<ld>>(n + 1, vector<ld>(n + 1, 0))); vector<ld> weight(n + 1, 0); for (int i = 0; i ...
#include <bits/stdc++.h> using namespace std; using ld = long double; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; vector<vector<vector<ld>>> dp( n + 1, vector<vector<ld>>(n + 1, vector<ld>(n + 1, 0))); vector<ld> weight(n + 1, 0); for (int i = 0; i ...
replace
16
17
16
17
TLE
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1e18; double dp[305][305][305]; bool check[305][305][305]; double n; double calc(ll a, ll b, ll c) { if (check[a][b][c] == true) { // cout<<"true"<<endl; ...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1e18; double dp[305][305][305]; bool check[305][305][305]; double n; double calc(ll a, ll b, ll c) { if (check[a][b][c] == true) { // cout<<"true"<<endl; ...
replace
31
32
31
32
TLE
p03169
C++
Runtime Error
/* * author: Gary Shih * created: 2020-05-04 13:27:07 */ #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.setf(ios::fixed), cout.precision(9); int n; cin >> n; int c1 = 0, c2 = 0, c3 = 0; for (int i = 0; i < n; ++i) { ...
/* * author: Gary Shih * created: 2020-05-04 13:27:07 */ #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.setf(ios::fixed), cout.precision(9); int n; cin >> n; int c1 = 0, c2 = 0, c3 = 0; for (int i = 0; i < n; ++i) { ...
replace
30
31
30
31
-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; typedef long double ld; typedef long long ll; typedef unsigned long long ull; const int MX = 307; ld b[MX + 5][MX + 5][MX + 5]; int main() { int n; scanf("%d", &n); int c[3]; for (int i = 0; i < n; i++) { int l; cin >> l; if (l > 0) c[l - 1] +...
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef unsigned long long ull; const int MX = 307; ld b[MX + 5][MX + 5][MX + 5]; int main() { int n; scanf("%d", &n); int c[3] = {0, 0, 0}; for (int i = 0; i < n; i++) { int l; cin >> l; if (l > 0) ...
replace
15
16
15
16
-11
p03169
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define INF (1 << 29) #define EPS (1e-10) typedef long long Int; typedef pair<Int, Int> P; #define ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define INF (1 << 29) #define EPS (1e-10) typedef long long Int; typedef pair<Int, Int> P; #define ...
replace
23
24
23
24
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef double ll; int main() { int n; cin >> n; int a1 = 0, a2 = 0, a3 = 0; ll dp[n + 1][n + 1][n + 1]; for (int i = 0; i < n; ++i) { ll x; cin >> x; if (x == 1) a1++; if (x == 2) a2++; if (x == 3) a3++; } dp[0][0][0] = 0...
#include <bits/stdc++.h> using namespace std; typedef double ll; int main() { int n; cin >> n; int a1 = 0, a2 = 0, a3 = 0; ll dp[n + 1][n + 1][n + 1]; for (int i = 0; i < n; ++i) { ll x; cin >> x; if (x == 1) a1++; if (x == 2) a2++; if (x == 3) a3++; } dp[0][0][0] = 0...
replace
23
24
23
24
0
p03169
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> using namespace std; int A, B, C; int n; double dp[301][301][301]; double foo(int A, int B, int C) { if (dp[A][B][C] != -1) return dp[A][B][C]; double nn = n; double AA = A; double BB = B; double CC = C; double res = 0; if (A != 0) { double E1 = (foo(A -...
#include <iomanip> #include <iostream> using namespace std; int A, B, C; int n; double dp[301][301][301]; double foo(int A, int B, int C) { if (dp[A][B][C] != -1) return dp[A][B][C]; double nn = n; double AA = A; double BB = B; double CC = C; double res = 0; if (A != 0) { double E1 = (foo(A -...
replace
38
39
38
39
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define N 101 using namespace std; int n, a, b, c, x; double dp[N][N][N]; double f(int a, int b, int c) { if (a == 0 && b == 0 && c == 0) return 0; if (a < 0 || b < 0 || c < 0) return 0; if (dp[a][b][c] != 0) return dp[a][b][c]; double ea, eb, ec, ans; ea = f(a - 1, b, c...
#include <bits/stdc++.h> #define N 301 using namespace std; int n, a, b, c, x; double dp[N][N][N]; double f(int a, int b, int c) { if (a == 0 && b == 0 && c == 0) return 0; if (a < 0 || b < 0 || c < 0) return 0; if (dp[a][b][c] != 0) return dp[a][b][c]; double ea, eb, ec, ans; ea = f(a - 1, b, c...
replace
1
2
1
2
0
p03169
C++
Runtime Error
/* -------------- | / | | / | | / | * |/ | | ------ * | | | | / \ | | |\ | | | |\ | \ ...
/* -------------- | / | | / | | / | * |/ | | ------ * | | | | / \ | | |\ | | | |\ | \ ...
replace
28
29
28
29
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1001001001; const ll mod = 1000000007; int N; double dp[101][101][101]; double rec(int i, int j, int k) { if (i + j + k == 0) return 0; if (dp[i][j][k] > 0) return dp[i][j][k]; double p0 = (double)(N - i - j - k) / N; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1001001001; const ll mod = 1000000007; int N; double dp[301][301][301]; double rec(int i, int j, int k) { if (i + j + k == 0) return 0; if (dp[i][j][k] > 0) return dp[i][j][k]; double p0 = (double)(N - i - j - k) / N; ...
replace
9
10
9
10
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; double dp[301][301][301]; int n, a[4]; int main() { cin >> n; for (int i = 0; i < n; i += 1) { int b; cin >> b; a[b] += 1; } for (int sum = 1; sum <= a[1] + a[2] * 2 + a[3] * 3; sum += 1) { for (int k = 0; 3 * k <= sum && k <= n; k += 1) { for...
#include <bits/stdc++.h> using namespace std; double dp[303][303][303]; int n, a[4]; int main() { cin >> n; for (int i = 0; i < n; i += 1) { int b; cin >> b; a[b] += 1; } for (int sum = 1; sum <= a[1] + a[2] * 2 + a[3] * 3; sum += 1) { for (int k = 0; 3 * k <= sum && k <= n; k += 1) { for...
replace
2
3
2
3
-11
p03169
C++
Runtime Error
#include <algorithm> #include <cctype> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, p...
#include <algorithm> #include <cctype> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, p...
replace
89
92
89
91
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef pair<ll, ll> pii; typedef vector<pii> vii; typedef map<ll, ll> mii; const int MOD = 1e9 + 7; #define fastIO() \ ios_base::sync_with...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef pair<ll, ll> pii; typedef vector<pii> vii; typedef map<ll, ll> mii; const int MOD = 1e9 + 7; #define fastIO() \ ios_base::sync_with...
replace
41
43
41
44
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> s(3); for (int i = 0; i < n; i++) { int a; cin >> a; s.at(a - 1)++; } vector<vector<vector<double>>> dp( n + 1, vector<vector<double>>(n + 1, vector<double>(n + 1))); for (int k = 0; k <= n; k++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> s(3); for (int i = 0; i < n; i++) { int a; cin >> a; s.at(a - 1)++; } vector<vector<vector<double>>> dp( n + 1, vector<vector<double>>(n + 1, vector<double>(n + 1))); for (int k = 0; k <= n; k++) { ...
replace
15
17
15
17
-11
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vi; typedef vector<vi> vvi; typedef pair<long, long> ii; #define sz(a) long((a).size()) #define pb push_back #define mp make_pair #define all(c) (c).begin(), (c).end() #define tr(c, i) for(typeof((c).begin() i = (c...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vi; typedef vector<vi> vvi; typedef pair<long, long> ii; #define sz(a) long((a).size()) #define pb push_back #define mp make_pair #define all(c) (c).begin(), (c).end() #define tr(c, i) for(typeof((c).begin() i = (c...
replace
120
121
120
121
TLE
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define fst first #define snd second #define fore(i, a, b) for (int i = a, ThxDem = b; i < ThxDem; ++i) #define pb push_back #define ALL(s) s.begin(), s.end() #define FIN \ ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> #define fst first #define snd second #define fore(i, a, b) for (int i = a, ThxDem = b; i < ThxDem; ++i) #define pb push_back #define ALL(s) s.begin(), s.end() #define FIN \ ios_base::sync_with_stdio(0); ...
insert
25
25
25
26
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; using namespace std; double dp[301][301][301]; int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); #ifndef ONLINE_JUDGE freopen("in", "r", stdin); freopen("out", "w", stdout); #endif int n; cin >> n; vector<int> a(n); int o = 0, tw = 0, tr ...
#include <bits/stdc++.h> typedef long long ll; using namespace std; double dp[301][301][301]; int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); int n; cin >> n; vector<int> a(n); int o = 0, tw = 0, tr = 0; for (auto &i : a) { cin >> i; if (i == 1) o++; else if (i == 2)...
delete
8
13
8
8
-11
p03169
C++
Memory Limit Exceeded
#include <bits/stdc++.h> // [PRIMES] 1777 ~2^10.80 using namespace std; // 10333 ~2^13.33 using ll = long long; // seq 1 128 | factor 100333 ~2^16.61 using vl = vector<ll>; // | grep -v ' .* ' 1300111 ~2^20.31 using vvl = vect...
#include <bits/stdc++.h> // [PRIMES] 1777 ~2^10.80 using namespace std; // 10333 ~2^13.33 using ll = long long; // seq 1 128 | factor 100333 ~2^16.61 using vl = vector<ll>; // | grep -v ' .* ' 1300111 ~2^20.31 using vvl = vect...
replace
61
63
61
63
MLE
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) ...
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) ...
replace
127
128
127
129
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define int long long #define mp make_pair #define ff first #define ss second #define inf 9e18 #define pii pair<int, int> #define setp(x) fixed << showpoint << setprecision(x) #define fastio \ ios_base::sync_...
#include <bits/stdc++.h> #define pb push_back #define int long long #define mp make_pair #define ff first #define ss second #define inf 9e18 #define pii pair<int, int> #define setp(x) fixed << showpoint << setprecision(x) #define fastio \ ios_base::sync_...
replace
39
46
39
42
-11
p03169
C++
Runtime Error
#include <cmath> #include <cstdio> #include <iostream> #include <numeric> using namespace std; const int maxn = 300; double dp[maxn + 1][maxn + 1][maxn + 1] = {0}; int occur[3] = {0}; void test() { double sum = 0; double n = 50, e = 30; for (double i = 0; i <= 1000; i++) { sum += (n - e) / n * pow(e / n, i)...
#include <cmath> #include <cstdio> #include <iostream> #include <numeric> using namespace std; const int maxn = 300; double dp[3 * maxn + 1][2 * maxn][maxn + 1] = {0}; int occur[3] = {0}; void test() { double sum = 0; double n = 50, e = 30; for (double i = 0; i <= 1000; i++) { sum += (n - e) / n * pow(e / n...
replace
7
8
7
8
-11
p03169
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define int long long typedef long double ld; #define pii pair<int, int> #define vi vector<int> #define vii vector<vi> #define viii vector...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define int long long typedef long double ld; #define pii pair<int, int> #define vi vector<int> #define vii vector<vi> #define viii vector...
replace
67
70
67
70
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define MAXN 310 #define pii pair<int, int> #define pb push_back typedef long long ll; using namespace std; int n, f[4]; double dp[MAXN][MAXN][MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; for (int i = 0; i < n; i++) { int t; cin >> t; f[t...
#include <bits/stdc++.h> #define MAXN 310 #define pii pair<int, int> #define pb push_back typedef long long ll; using namespace std; int n, f[4]; double dp[MAXN][MAXN][MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; for (int i = 0; i < n; i++) { int t; cin >> t; f[t...
replace
20
23
20
23
-11
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 FASTIO \ cin.tie(0); \ cout...
#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 FASTIO \ cin.tie(0); \ cout...
replace
45
49
45
49
-11
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define For(i, n) rep(i, 0, n) // #define int long long // const int INF=1e18; const int MOD = 1000000007; typedef pair<int, int> P; int c[3] = {0, 0, 0}, n; double mem[305][305][305]; bool f[305][305][305]; double dp(int a...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define For(i, n) rep(i, 0, n) // #define int long long // const int INF=1e18; const int MOD = 1000000007; typedef pair<int, int> P; int c[3] = {0, 0, 0}, n; double mem[305][305][305]; bool f[305][305][305]; double dp(int a...
insert
16
16
16
19
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; double dp[101][101][101]; bool vis[101][101][101] = {0}; int n; double solve(int x, int y, int z) { if (x <= 0 && y <= 0 && z <= 0) return 0; // cout << x << y << z << endl; if (vis[x][y][z]) return dp[x][y][z]; vis[x][y][z] = 1; double ans = 1.0; // ...
#include <bits/stdc++.h> using namespace std; double dp[301][301][301]; bool vis[301][301][301] = {0}; int n; double solve(int x, int y, int z) { if (x <= 0 && y <= 0 && z <= 0) return 0; // cout << x << y << z << endl; if (vis[x][y][z]) return dp[x][y][z]; vis[x][y][z] = 1; double ans = 1.0; // ...
replace
4
6
4
6
0
p03169
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fr(a, b) for (int i = a; i < b; i++) #define mod 10000code200007 #define printDouble(x) cout << fixed << setprecision(10) << x #define triplet pair<int, pair<int, int>> #define fast_io ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fr(a, b) for (int i = a; i < b; i++) #define mod 10000code200007 #define printDouble(x) cout << fixed << setprecision(10) << x #define triplet pair<int, pair<int, int>> #define fast_io ...
replace
23
24
23
24
TLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.setf...
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.setf...
replace
24
26
24
25
0
p03169
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); int N; cin >> N; static int c[3]; for (int i = 0, t; i < N; ++i) { cin >> t; ++c[t - 1]; } static double dp[301][601][901]; /*function<double(int, int, int)> dfs = [&](int a, int b, int c) { if (a ...
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); int N; cin >> N; static int c[3]; for (int i = 0, t; i < N; ++i) { cin >> t; ++c[t - 1]; } static double dp[301][301][301]; /*function<double(int, int, int)> dfs = [&](int a, int b, int c) { if (a ...
replace
15
16
15
16
MLE
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define boost \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define boost \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
27
28
27
28
-11
p03169
C++
Runtime Error
// By TheOneYouWant #pragma GCC optimize("-O2") #include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
// By TheOneYouWant #pragma GCC optimize("-O2") #include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
92
93
92
93
-11
p03169
C++
Runtime Error
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 1000000007; #define doublecout(a) cout << fixed << setprecision(15) << a << endl; double dp[101][101][101]; int n; double solve(int i, int j, int k) { if (dp[i][j][k] >= 0...
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 1000000007; #define doublecout(a) cout << fixed << setprecision(15) << a << endl; double dp[301][301][301]; int n; double solve(int i, int j, int k) { if (dp[i][j][k] >= 0...
replace
7
8
7
8
0
p03169
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; double memo[305][305][305]; double dp(ll s1, ll s2, ll s3, ll empty, ll full) { if (s1 == 0 && s2 == 0 && s3 == 0) return 0; if (memo[s1][s2][s3] != -1) return memo[s1][s2][s3]; double ret = 0; ret = (double)full * (1 + ((do...
#include <bits/stdc++.h> using namespace std; typedef long long ll; double memo[305][305][305]; double dp(ll s1, ll s2, ll s3, ll empty, ll full) { if (s1 == 0 && s2 == 0 && s3 == 0) return 0; if (memo[s1][s2][s3] != -1) return memo[s1][s2][s3]; double ret = 0; double temp1 = 0, temp2 = 0, temp3 = 0;...
replace
13
19
13
24
-11
p03170
C++
Runtime Error
#include <bits/stdc++.h> #define lli long long int #define vec2 vector<vector<lli>> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #define lli long long int #define vec2 vector<vector<lli>> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
71
73
71
75
0
p03170
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i < b; i++) #define out(x) cout << x <...
#include <bits/stdc++.h> using namespace std; // #define int long long #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i < b; i++) #define out(x) cout << x <...
replace
65
66
65
66
0
p03170
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int a[n]; int i; for (i = 0; i < n; i++) cin >> a[i]; int dp[n + 1]; memset(dp, 0, sizeof(dp)); for (i = 0; i <= k; i++) { for (int j = 0; j < n; j++) { if (i >= a[j] && dp[i - a[j]] == 0) dp[i] = 1...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int a[n]; int i; for (i = 0; i < n; i++) cin >> a[i]; int dp[k + 1]; memset(dp, 0, sizeof(dp)); for (i = 0; i <= k; i++) { for (int j = 0; j < n; j++) { if (i >= a[j] && dp[i - a[j]] == 0) dp[i] = 1...
replace
9
10
9
10
0
p03170
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e2 + 2, K = 1e5 + 5; int a[MAXN]; bool dp[K]; int n, k; void input(); void solve(); int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); input(); solve(); return 0; } void input() { cin >> n >> k; for (int i = 0; i < n; i++) c...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e2 + 2, K = 1e5 + 5; int a[MAXN]; bool dp[K]; int n, k; void input(); void solve(); int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); input(); solve(); return 0; } void input() { cin >> n >> k; for (int i = 0; i < n; i++) c...
replace
27
28
27
28
0
p03170
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; // dp[i] : TRUE if first player wins with i stones left vector<bool> dp(k + 1); for (int i...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; // dp[i] : TRUE if first player wins with i stones left vector<bool> dp(k + 1); for (int i...
replace
17
18
17
18
0
p03170
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<int> memo(1e5 + 5, -1); int dp(vector<int> &v, int i) { if (i == 0) return 0; memo[i] = 0; for (int e : v) { if (e <= i) { if (!dp(v, i - e)) memo[i] = 1; } } return memo[i]; } signed main() { cin.tie(0);...
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<int> memo(1e5 + 5, -1); int dp(vector<int> &v, int i) { if (i == 0) return 0; if (memo[i] != -1) return memo[i]; memo[i] = 0; for (int e : v) { if (e <= i) { if (!dp(v, i - e)) memo[i] = 1; } } return ...
insert
8
8
8
10
TLE