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
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { ll n, m; cin >> n >> m; vector<ll> a(n); vector<ll> b(n); for (ll i = 0; i < n; ++i) cin >> a[i] >> b[i]; vector<vector<ll>> dp(n + 1, vector<ll>(1000 * n + 1, 1e12)); dp[0][0] = 0; for (ll i = 0; i < n; ++i) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { ll n, m; cin >> n >> m; vector<ll> a(n); vector<ll> b(n); for (ll i = 0; i < n; ++i) cin >> a[i] >> b[i]; vector<vector<ll>> dp(n + 1, vector<ll>(1000 * n + 1, 1e12)); dp[0][0] = 0; for (ll i = 0; i < n; ++i) { ...
replace
17
18
17
18
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (int i = m; i < n; i++) #define IFOR(i, m, n) for (int i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FOREACH(x, a) for (auto &(x) : (a)) #define ALL(v) v.begin(), v.end...
#include <bits/stdc++.h> #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (int i = m; i < n; i++) #define IFOR(i, m, n) for (int i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FOREACH(x, a) for (auto &(x) : (a)) #define ALL(v) v.begin(), v.end...
replace
44
45
44
46
-6
corrupted size vs. prev_size
p03164
C++
Runtime Error
// reference ----> errichto stream #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; int main(int argc, char **argv) { #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); in...
// reference ----> errichto stream #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; int main(int argc, char **argv) { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, w; cin >> n >> w; vector<int> val(n), wei(n); int sum = 0; for (int i = 0; i < n; i++) { ...
delete
6
10
6
6
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03164
C++
Runtime Error
// dp[i][v] = tuye i taye aval ye tedadi ro var darim ke majume arzeshashun // beshe v, hade aghal vazneshun che ghadre ! dp[0][v[0]] = w[0] dp[0][0] = 0 // else dp[0][i] = oo #include <bits/stdc++.h> using namespace std; const int N = 110; const int V = 1e3 + 10; long long n, W, v[N], w[N], dp[N][N * V]; int main...
// dp[i][v] = tuye i taye aval ye tedadi ro var darim ke majume arzeshashun // beshe v, hade aghal vazneshun che ghadre ! dp[0][v[0]] = w[0] dp[0][0] = 0 // else dp[0][i] = oo #include <bits/stdc++.h> using namespace std; const int N = 110; const int V = 1e3 + 10; long long n, W, v[N], w[N], dp[N][N * V]; int main...
replace
18
19
18
19
0
p03164
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
insert
120
120
120
121
TLE
p03164
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define ll long long #define li long #define pb push_back #define mem(arr, x) memset(arr, x, sizeof(arr)) ll n, W; ll w[101], v[101]; ll dp[101][100010]; ll totalV = 0; ll minWeight(ll end, ll Val) { if (Val <= 0) return 0; if (end == 0) ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define ll long long #define li long #define pb push_back #define mem(arr, x) memset(arr, x, sizeof(arr)) ll n, W; ll w[101], v[101]; ll dp[101][100010]; ll totalV = 0; ll minWeight(ll end, ll Val) { if (Val <= 0) return 0; if (end == 0) ...
replace
17
18
17
18
TLE
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1e18 + 5; int main(int argc, char **argv) { ll N = 0, W = 0; cin >> N >> W; vector<ll> weights(N); vector<ll> values(N); for (int i = 0; i < N; ++i) { cin >> weights[i] >> values[i]; } vector<ll> dp(1000000, INF); ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1e18 + 5; int main(int argc, char **argv) { ll N = 0, W = 0; cin >> N >> W; vector<ll> weights(N); vector<ll> values(N); for (int i = 0; i < N; ++i) { cin >> weights[i] >> values[i]; } vector<ll> dp(1000000, INF); ...
replace
22
24
22
26
0
p03164
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; #define MAXN 120 #define MAXV 100020 #define INF 110000000001 long long N, W; long long w[MAXN], v[MAXN]; long long dp[MAXN][MAXV]; int main() { cin >> N >> W; for (long long i = 0; i < N; i++) { cin >> w[i] >> v[i]; } for (long long i = 0; i < N...
#include <cmath> #include <iostream> using namespace std; #define MAXN 120 #define MAXV 100020 #define INF 110000000001 long long N, W; long long w[MAXN], v[MAXN]; long long dp[MAXN][MAXV]; int main() { cin >> N >> W; for (long long i = 0; i < N; i++) { cin >> w[i] >> v[i]; } for (long long i = 0; i < N...
replace
25
26
25
26
-11
p03164
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define ll long long #define li long #define pb push_back #define mem(arr, x) memset(arr, x, sizeof(arr)) ll n, W; ll w[101], v[101]; ll dp[101][100010]; ll totalV = 0; ll minWeight(ll end, ll Val) { if (Val <= 0) return 0; if (end == 0) ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define ll long long #define li long #define pb push_back #define mem(arr, x) memset(arr, x, sizeof(arr)) ll n, W; ll w[101], v[101]; ll dp[101][100010]; ll totalV = 0; ll minWeight(ll end, ll Val) { if (Val <= 0) return 0; if (end == 0) ...
replace
17
19
17
19
TLE
p03164
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <limits.h> #include <vector> using namespace std; const long long inf = 1e12; int main() { int n, t; cin >> n >> t; long long pricesum = 0; vector<int> w(n), p(n); for (int i = 0; i < n; i++) { cin >> w[i] >> p[i]; ...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <limits.h> #include <vector> using namespace std; const long long inf = 1e12; int main() { int n, t; cin >> n >> t; long long pricesum = 0; vector<int> w(n), p(n); for (int i = 0; i < n; i++) { cin >> w[i] >> p[i]; ...
replace
24
25
24
25
0
p03164
C++
Runtime Error
// #pragma GCC optimize "trapv" #include <bits/stdc++.h> #define ll long long int #define fab(a, b, i) for (int i = a; i < b; i++) #define pb push_back #define db double #define mp make_pair #define endl "\n" #define f first #define se second #define all(x) x.begin(), x.end() #define MOD 1000000007 #define BIG 1e10 #de...
// #pragma GCC optimize "trapv" #include <bits/stdc++.h> #define ll long long int #define fab(a, b, i) for (int i = a; i < b; i++) #define pb push_back #define db double #define mp make_pair #define endl "\n" #define f first #define se second #define all(x) x.begin(), x.end() #define MOD 1000000007 #define BIG 1e10 #de...
replace
33
37
33
34
0
p03164
C++
Runtime Error
#include <algorithm> #include <climits> #include <iostream> #include <string.h> #include <vector> #define int int64_t #define endl "\n" #define INF INT_MAX - 2 using namespace std; void io() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } int n, capacity; int knapsack(vector<int> &weight...
#include <algorithm> #include <climits> #include <iostream> #include <string.h> #include <vector> #define int int64_t #define endl "\n" #define INF INT_MAX - 2 using namespace std; void io() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } int n, capacity; int knapsack(vector<int> &weight...
replace
17
18
17
18
0
p03164
C++
Runtime Error
// bismillahir rahmanir rahim //Author:Fayed Anik #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 ordered_set tree<int, null_type,less<int>, // rb_tree_tag,tree_order_statist...
// bismillahir rahmanir rahim //Author:Fayed Anik #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 ordered_set tree<int, null_type,less<int>, // rb_tree_tag,tree_order_statist...
replace
42
43
42
43
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define Fo(i, k, n) for (int i = k; i < n; i++) #define endl "\n" #define ff first #define ss second #define int long long #define pb push_back #define mp make...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define Fo(i, k, n) for (int i = k; i < n; i++) #define endl "\n" #define ff first #define ss second #define int long long #define pb push_back #define mp make...
replace
69
70
69
70
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int using namespace std; const int mx = 1e3 + 10; ll w[200], v[200], dp[mx][200], n, W; ll find_max(ll val, ll index) { if (index == n) return val == 0 ? 0 : INT_MAX; if (~dp[val][index]) return dp[val][index]; ll ans = find_max(val, index + 1); if (v[i...
#include <bits/stdc++.h> #define ll long long int using namespace std; const int mx = 100009; ll w[mx], v[mx], dp[mx][200], n, W; ll find_max(ll val, ll index) { if (index == n) return val == 0 ? 0 : INT_MAX; if (~dp[val][index]) return dp[val][index]; ll ans = find_max(val, index + 1); if (v[index...
replace
4
6
4
6
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, W, w[101], v[102]; long long dp[102][10003]; long long rec(int pos, int val) { // printf("%d %d\n", pos, val); if (dp[pos][val] != -1) { return dp[pos][val]; } long long ans = 2000000000000; if (pos != 0) { ans = rec(pos - 1, val); } if (v[pos]...
#include <bits/stdc++.h> using namespace std; int N, W, w[101], v[102]; long long dp[102][100003]; long long rec(int pos, int val) { // printf("%d %d\n", pos, val); if (dp[pos][val] != -1) { return dp[pos][val]; } long long ans = 2000000000000; if (pos != 0) { ans = rec(pos - 1, val); } if (v[pos...
replace
3
4
3
4
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fore(i, s, e) for (int i = s; i < e; i++) const int N = 100; const int V = 10005; typedef long long ll; int n, w; ll dp[N][V]; ll ww[N], v[V]; int main() { cin >> n >> w; int s = 0; fore(i, 1, n + 1) { cin >> ww[i] >> v[i]; s += v[i]; } for...
#include <bits/stdc++.h> using namespace std; #define fore(i, s, e) for (int i = s; i < e; i++) const int N = 200; const int V = 2e5; typedef long long ll; int n, w; ll dp[N][V]; ll ww[N], v[V]; int main() { cin >> n >> w; int s = 0; fore(i, 1, n + 1) { cin >> ww[i] >> v[i]; s += v[i]; } fore(...
replace
6
8
6
8
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; /* short */ #define pb push_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v), rend(v) /* REPmacro */ #define FOR(i, a, b) for (int ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; /* short */ #define pb push_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v), rend(v) /* REPmacro */ #define FOR(i, a, b) for (int ...
replace
44
45
44
45
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long n, k; long long w[109], v[109]; long long dp[109][100009]; int main() { cin >> n >> k; for (int i = 0; i < n; i++) cin >> w[i] >> v[i]; for (int i = 0; i < n; i++) { for (int j = 1; j < 100009; j++) { dp[i][j] = 1000000000000009; } } dp...
#include <bits/stdc++.h> using namespace std; long long n, k; long long w[109], v[109]; long long dp[109][100009]; int main() { cin >> n >> k; for (int i = 0; i < n; i++) cin >> w[i] >> v[i]; for (int i = 0; i < n; i++) { for (int j = 1; j < 100009; j++) { dp[i][j] = 1000000000000009; } } dp...
replace
17
18
17
18
0
p03164
C++
Runtime Error
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #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 <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #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 <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
replace
36
38
36
40
0
p03164
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; long long N, maxW; long long dp[102][100002]; struct asdfklj { long long val, w; } arr[102]; long long knapsack(long long i, long long current) { if (current < 0) return INT_MAX; if (i == N) { if (current == 0) return 0; return INT_MAX; } long ...
#include <bits/stdc++.h> using namespace std; long long N, maxW; long long dp[102][100002]; struct asdfklj { long long val, w; } arr[102]; long long knapsack(long long i, long long current) { if (current < 0) return INT_MAX; if (i == N) { if (current == 0) return 0; return INT_MAX; } long ...
insert
18
18
18
20
TLE
p03164
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define loopi(x, y) for (int i = x; i < (y); i++) #define rloopi(x, y) for (int i = x; i >= (y); i--) #define rloopj(x, y) for (int j ...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define loopi(x, y) for (int i = x; i < (y); i++) #define rloopi(x, y) for (int i = x; i >= (y); i--) #define rloopj(x, y) for (int j ...
replace
38
42
38
42
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03164
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1LL << 60; int w[110], v[110]; long long dp[10010]; int main() { ios_base::sync_with_stdio(false); int n, W; cin >> n >> W; int V = 0; for (int i = 0; i < n; i++) { cin >> w[i] >> v[i]; V += v[i]; } /// dp...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1LL << 60; int w[110], v[110]; ll dp[100010]; int main() { ios_base::sync_with_stdio(false); int n, W; cin >> n >> W; int V = 0; for (int i = 0; i < n; i++) { cin >> w[i] >> v[i]; V += v[i]; } /// dp[v] = ...
replace
9
10
9
10
0
p03164
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include ...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include ...
replace
46
47
46
47
0
p03164
C++
Runtime Error
// https://atcoder.jp/contests/dp/tasks/dp_e #include <bits/stdc++.h> #define loop(i, a, b) for (i = (a); i < (b); i++) #define pb push_back #define eb emplace_back #define all(v) (v).begin(), (v).end() #define fr first #define sc second #define mk make_pair #define endl '\n' #define MOD 1000000007 using namespace std;...
// https://atcoder.jp/contests/dp/tasks/dp_e #include <bits/stdc++.h> #define loop(i, a, b) for (i = (a); i < (b); i++) #define pb push_back #define eb emplace_back #define all(v) (v).begin(), (v).end() #define fr first #define sc second #define mk make_pair #define endl '\n' #define MOD 1000000007 using namespace std;...
replace
19
21
19
21
0
p03164
C++
Runtime Error
#include <bits/stdc++.h> /* #pragma GCC optimize("-Ofast") //#pragma GCC optimize("trapv") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops")*/ #define I inline void #define S struct #define vi vector<int> #d...
#include <bits/stdc++.h> /* #pragma GCC optimize("-Ofast") //#pragma GCC optimize("trapv") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops")*/ #define I inline void #define S struct #define vi vector<int> #d...
replace
41
42
41
42
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define all(cont) cont.begin(), cont.end() #define pb push_back #define fi first #define se second #define DEBUG(x) cerr << (#x) << ": " << (x) << '\n' using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef long long ll; typedef unsigned long long ull; template <cla...
#include <bits/stdc++.h> #define all(cont) cont.begin(), cont.end() #define pb push_back #define fi first #define se second #define DEBUG(x) cerr << (#x) << ": " << (x) << '\n' using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef long long ll; typedef unsigned long long ull; template <cla...
replace
39
40
39
40
0
p03165
C++
Time Limit Exceeded
/* Author: Alam Khan AUST CSE 40th Batch */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vl; typedef deque<ll> dl; typedef stack<ll> stl; typedef set<ll> sl; typedef map<string, ll> msl; typedef map<ll, ll> mll; #define sf(n) scanf("%lld", &...
/* Author: Alam Khan AUST CSE 40th Batch */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vl; typedef deque<ll> dl; typedef stack<ll> stl; typedef set<ll> sl; typedef map<string, ll> msl; typedef map<ll, ll> mll; #define sf(n) scanf("%lld", &...
insert
47
47
47
50
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s, t; cin >> s >> t; ll a[s.length() + 1][t.length() + 1], i, j; memset(a, 0, sizeof(a)); for (i = 0; i <= s.length(); i++) { for (j = 0; j <= t.length(); j++) { if (i == 0 || j == 0) { a[i][j] = 0; ...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s, t; cin >> s >> t; ll a[s.length() + 1][t.length() + 1], i, j; memset(a, 0, sizeof(a)); for (i = 0; i <= s.length(); i++) { for (j = 0; j <= t.length(); j++) { if (i == 0 || j == 0) { a[i][j] = 0; ...
replace
24
25
24
25
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; string s, t; string dp2[2][3030] = {}; int main() { cin >> s >> t; int n = s.size(), m = t.size(); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (s.at(i - 1) =...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; string s, t; string dp2[2][3030] = {}; int main() { cin >> s >> t; int n = s.size(), m = t.size(); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (s.at(i - 1) =...
replace
13
16
13
15
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string s, t; int dp[3010][3010]; int main() { cin >> s >> t; int n = s.length(), m = t.length(); for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { if (i == 0 || j == 0) dp[i][j] = 0; if (s[i - 1] == t[j - 1]) { dp[i][j]...
#include <bits/stdc++.h> using namespace std; string s, t; int dp[3010][3010]; int main() { cin >> s >> t; int n = s.length(), m = t.length(); for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { if (i == 0 || j == 0) dp[i][j] = 0; else if (s[i - 1] == t[j - 1]) { dp[...
replace
16
17
16
17
0
p03165
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <functional> #include <iostream> #include <set> #include <utility> #include <vector> using namespace std; typedef unsigned long long ull; typedef pair<ull, ull> p; #define mp make_pair #define append push_back vector<ull> v; set<ull> s; multiset<ul...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <functional> #include <iostream> #include <set> #include <utility> #include <vector> using namespace std; typedef unsigned long long ull; typedef pair<ull, ull> p; #define mp make_pair #define append push_back vector<ull> v; set<ull> s; multiset<ul...
replace
167
168
167
168
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03165
C++
Runtime Error
// It gets easier day by day, but the hard part is to........ // "I am here." ~ All Might! #pragma optimise GCC(-O2) #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double #define pii pair<ll, ll> #define ve(x) vector<x> #define f(a, b, c) for (ll a = b; a < c; ...
// It gets easier day by day, but the hard part is to........ // "I am here." ~ All Might! #pragma optimise GCC(-O2) #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double #define pii pair<ll, ll> #define ve(x) vector<x> #define f(a, b, c) for (ll a = b; a < c; ...
replace
121
122
121
122
0
p03165
C++
Runtime Error
// #include"stdc++.h" #include <bits/stdc++.h> using namespace std; #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
// #include"stdc++.h" #include <bits/stdc++.h> using namespace std; #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
20
21
20
21
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int #define INF 1000000000000000000 #define fn(i, n) for (int i = 0; i < n; i += 1) int w[100100], v[100100]; int dp[1001][1001] = {0}; signed main() { string s, t; cin >> s >> t; int m = s.size(); int n = t.size(); fn(i, m + 1) { fn(j, ...
#include <bits/stdc++.h> using namespace std; #define int long long int #define INF 1000000000000000000 #define fn(i, n) for (int i = 0; i < n; i += 1) int dp[3001][3001] = {0}; signed main() { string s, t; cin >> s >> t; int m = s.size(); int n = t.size(); fn(i, m + 1) { fn(j, n + 1) { if (i == 0...
replace
5
7
5
7
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int #define Endl endl #define mod 998244353 #define mkp make_pair #define pb push_back #define cin(n) scanf("%d", &n) #define cout(n) printf("%d ", n) #define sf(n) scanf("%d", &n) #define pf(n) printf("%d ", n) #defin...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int #define Endl endl #define mod 998244353 #define mkp make_pair #define pb push_back #define cin(n) scanf("%d", &n) #define cout(n) printf("%d ", n) #define sf(n) scanf("%d", &n) #define pf(n) printf("%d ", n) #defin...
replace
40
41
40
41
0
p03165
C++
Runtime Error
#include <iostream> using namespace std; string ar[2][3050] = {}; string a, b; string bg(string l, string r) { if (l.size() > r.size()) { return l; } else { return r; } } int main() { cin >> a >> b; for (int i = 1; i <= a.size(); i++) { for (int j = 1; j <= b.size(); j++) { ar[i % 2][j] = bg...
#include <iostream> using namespace std; string ar[2][3050] = {}; string a, b; string bg(string l, string r) { if (l.size() > r.size()) { return l; } else { return r; } } int main() { cin >> a >> b; for (int i = 1; i <= a.size(); i++) { for (int j = 1; j <= b.size(); j++) { ar[i % 2][j] = bg...
replace
21
22
21
22
-11
p03165
C++
Runtime Error
#include <iostream> using namespace std; template <class T> bool max(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> int maxReturn(T a, T b) { if (a > b) { return a; } return b; } template <class T> bool min(T &a, T b) { if (a < b) { a = b; return t...
#include <iostream> using namespace std; template <class T> bool max(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> int maxReturn(T a, T b) { if (a > b) { return a; } return b; } template <class T> bool min(T &a, T b) { if (a < b) { a = b; return t...
replace
31
32
31
32
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; #define mod 1000000007 #define F first #define S second using namespace std; string a, b; ll memo[1005][1005]; ll solve(int i, int j) { if (i == a.size() || j == b.size()) return 0; if (~memo[i][j]) return memo[i][j]; ll ret = 0; if (a[i] == b[j]) ret =...
#include <bits/stdc++.h> typedef long long ll; #define mod 1000000007 #define F first #define S second using namespace std; string a, b; ll memo[3005][3005]; ll solve(int i, int j) { if (i == a.size() || j == b.size()) return 0; if (~memo[i][j]) return memo[i][j]; ll ret = 0; if (a[i] == b[j]) ret =...
replace
7
8
7
8
0
p03165
C++
Runtime Error
// g++ -std=gnu++14 a.cpp // #include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <st...
// g++ -std=gnu++14 a.cpp // #include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <st...
replace
58
59
58
59
-11
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; string s, t; ll dp[3007][3007]; int main() { cin >> s >> t; s += ';'; t += '.'; for (ll i = 0; i < s.length(); ++i) { for (ll j = 0; j < t.length(); ++j) { if (s[i] == t[j]) dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; string s, t; ll dp[3007][3007]; int main() { cin >> s >> t; s += ';'; t += '.'; for (ll i = 0; i < s.length(); ++i) { for (ll j = 0; j < t.length(); ++j) { if (s[i] == t[j]) dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i...
replace
24
25
24
25
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dir[1001][1001]; int dp[1001][1001]; string s1, s2; int solve(int i, int j) { if (dp[i][j] != -1) return dp[i][j]; if (i == s1.size() || j == s2.size()) { dir[i][j] = -1; return dp[i][j] = 0; } int anss = 0; int dik = -1; if (s1[i] == s2[j])...
#include <bits/stdc++.h> using namespace std; int dir[3001][3001]; int dp[3001][3001]; string s1, s2; int solve(int i, int j) { if (dp[i][j] != -1) return dp[i][j]; if (i == s1.size() || j == s2.size()) { dir[i][j] = -1; return dp[i][j] = 0; } int anss = 0; int dik = -1; if (s1[i] == s2[j])...
replace
2
4
2
4
0
p03165
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define float double const int LMT = 1000000000 + 5; #define int long long #define lp(i, n) for (i = 0; i < n; i++) const int N = 1005, M = 1005; int n, m, w[N], v[N], i, j; string a, b; int dp[N][M]; bool vis[N][M]; void solve(int n, int m) { for (in...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define float double const int LMT = 1000000000 + 5; #define int long long #define lp(i, n) for (i = 0; i < n; i++) const int N = 3005, M = 3005; int n, m, w[N], v[N], i, j; string a, b; int dp[N][M]; bool vis[N][M]; void solve(int n, int m) { for (in...
replace
7
8
7
8
0
p03165
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; const int maxn = 3005; int dp[maxn][maxn]; pair<int, int> dir[maxn][maxn]; string a, b; int main(int argc, char const *argv[]) { // freopen("in.txt", "r", stdin); cin >> a >> b; int n = a.size(), m = b.size(); for (int i = 0; i <= n; i++) { for (int j = 0; j <...
#include "bits/stdc++.h" using namespace std; const int maxn = 3005; int dp[maxn][maxn]; pair<int, int> dir[maxn][maxn]; string a, b; int main(int argc, char const *argv[]) { // freopen("in.txt", "r", stdin); cin >> a >> b; int n = a.size(), m = b.size(); for (int i = 0; i <= n; i++) { for (int j = 0; j <...
replace
32
33
32
33
-11
p03165
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() using in = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) const double PI = 3.14159265358979323846; const in MOD = 1000000007; const in INF...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() using in = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) const double PI = 3.14159265358979323846; const in MOD = 1000000007; const in INF...
replace
49
50
49
50
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[1007][1007]; int main() { memset(dp, 0, sizeof(dp)); string s, t; cin >> s >> t; for (int x = 1; x <= s.size(); x++) { for (int j = 1; j <= t.size(); j++) { if (s[x - 1] == t[j - 1]) dp[x][j] = 1 + dp[x - 1][j - 1]; else dp[...
#include <bits/stdc++.h> using namespace std; int dp[3007][3007]; int main() { memset(dp, 0, sizeof(dp)); string s, t; cin >> s >> t; for (int x = 1; x <= s.size(); x++) { for (int j = 1; j <= t.size(); j++) { if (s[x - 1] == t[j - 1]) dp[x][j] = 1 + dp[x - 1][j - 1]; else dp[...
replace
4
5
4
5
0
p03165
C++
Runtime Error
#include <iostream> using namespace std; int dp[3000][3000]; void lcs(string s1, string s2) { for (int i = 1; i <= s1.size(); i++) { for (int j = 1; j <= s2.size(); j++) { if (s1[i - 1] == s2[j - 1]) { dp[i][j] = dp[i - 1][j - 1] + 1; } else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1...
#include <iostream> using namespace std; int dp[5000][5000]; void lcs(string s1, string s2) { for (int i = 1; i <= s1.size(); i++) { for (int j = 1; j <= s2.size(); j++) { if (s1[i - 1] == s2[j - 1]) { dp[i][j] = dp[i - 1][j - 1] + 1; } else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1...
replace
4
5
4
5
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int dp[s.size() + 1][t.size() + 1]; for (int i = 0; i <= s.size(); i++) { for (int j = 0; j <= t.size(); j++) { if (i == 0 || j == 0) { dp[i][j] = 0; continue; } if (s[i - 1] == t[j - 1])...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int dp[s.size() + 1][t.size() + 1]; for (int i = 0; i <= s.size(); i++) { for (int j = 0; j <= t.size(); j++) { if (i == 0 || j == 0) { dp[i][j] = 0; continue; } if (s[i - 1] == t[j - 1])...
replace
19
22
19
22
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.14159265359 #define INF 1000100100 #define all(x) (x).begin(), (x).end() #define P pair<int, int> typedef long long ll; using namespace std; int main() { string s, t; cin >> s >> t; int sl = s.length(); int tl = t.length(); s...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.14159265359 #define INF 1000100100 #define all(x) (x).begin(), (x).end() #define P pair<int, int> typedef long long ll; using namespace std; int main() { string s, t; cin >> s >> t; int sl = s.length(); int tl = t.length(); s...
replace
39
40
39
40
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define N 311111 #define A 1111111 #define BLOCK 555 // ~sqrt(N) typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; const int INF = 1e9 + 5; ll bin_s...
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define N 311111 #define A 1111111 #define BLOCK 555 // ~sqrt(N) typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; const int INF = 1e9 + 5; ll bin_s...
replace
64
65
64
65
0
p03165
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define MAX 300 int d[MAX][MAX]; string a, b; int dp(int l, int r) { if (r < 0 || l < 0) return 0; if (d[l][r] == -1) { if (a[l] == b[r]) d[l][r] = dp(l - 1, r - 1) + 1; else d[l][r] = max({dp(l - 1, r), dp(l, r - 1)}); } return d[l][r]; } st...
#include "bits/stdc++.h" using namespace std; #define MAX 3000 int d[MAX][MAX]; string a, b; int dp(int l, int r) { if (r < 0 || l < 0) return 0; if (d[l][r] == -1) { if (a[l] == b[r]) d[l][r] = dp(l - 1, r - 1) + 1; else d[l][r] = max({dp(l - 1, r), dp(l, r - 1)}); } return d[l][r]; } s...
replace
2
3
2
3
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define optimize \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define INF 2000000020LL #define AL...
#include <bits/stdc++.h> #define optimize \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define INF 2000000020LL #define AL...
replace
65
66
65
70
0
p03165
C++
Runtime Error
#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 ...
replace
44
45
44
45
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define ull unsigned long long int #define ll long long #define int long long #define ld long double #define endl '\n' const int mod = 1e9 + 7; #define F first #define S second #define pb push_back #define mp make_pair #define trace(x) cerr << #x << " is " << x << endl; #define all(x) x.begin()...
#include <bits/stdc++.h> #define ull unsigned long long int #define ll long long #define int long long #define ld long double #define endl '\n' const int mod = 1e9 + 7; #define F first #define S second #define pb push_back #define mp make_pair #define trace(x) cerr << #x << " is " << x << endl; #define all(x) x.begin()...
replace
18
19
18
19
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string s1; string s2; cin >> s1 >> s2; int l1 = s1.length(); int l2 = s2.length(); int ai[l1][l2]; if (s1[0] == s2[0]) ai[0][0] = 1; else ai[0][0] = 0; for (int i = 1; i < l2; i++) { if (s1[0] == s2[i]) ai[0][i] = 1; else...
#include <bits/stdc++.h> using namespace std; int main() { string s1; string s2; cin >> s1 >> s2; int l1 = s1.length(); int l2 = s2.length(); int ai[l1][l2]; if (s1[0] == s2[0]) ai[0][0] = 1; else ai[0][0] = 0; for (int i = 1; i < l2; i++) { if (s1[0] == s2[i]) ai[0][i] = 1; else...
insert
58
58
58
60
TLE
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <un...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <un...
replace
47
48
47
48
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0); ios::sync_with_stdio(false); string s, t; cin >> s >> t; vector<vector<int>> dp(3000, vector<int>(3000, 0)); for (int i = 0; i < s.size(); i++) { for (int j = 0; j < t.size(); j++) { if (s[i] == t[j])...
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0); ios::sync_with_stdio(false); string s, t; cin >> s >> t; vector<vector<int>> dp(3001, vector<int>(3001, 0)); for (int i = 0; i < s.size(); i++) { for (int j = 0; j < t.size(); j++) { if (s[i] == t[j])...
replace
10
11
10
11
0
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; #define assem99 ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; #define assem99 ...
replace
54
55
54
55
0
p03165
C++
Runtime Error
#include "algorithm" #include "cstring" #include "iostream" #include "math.h" #include "string" #include "vector" using namespace std; typedef long long ll; string s, t; int dpsize[3010][3010]; // i,jでのlcs int main() { cin >> s >> t; int size_s = s.size(); int size_t = t.size(); for (int i = 0; i < 3010; i++...
#include "algorithm" #include "cstring" #include "iostream" #include "math.h" #include "string" #include "vector" using namespace std; typedef long long ll; string s, t; int dpsize[3010][3010]; // i,jでのlcs int main() { cin >> s >> t; int size_s = s.size(); int size_t = t.size(); for (int i = 0; i < 3010; i++...
replace
36
37
36
37
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 #define all(a) sort((a).begin(), (a).end()) // ソートのマクロ #define Re(a) reverse((a).begin(), (a).end()) #define YN(a) ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 #define all(a) sort((a).begin(), (a).end()) // ソートのマクロ #define Re(a) reverse((a).begin(), (a).end()) #define YN(a) ...
replace
18
20
18
20
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long string lcs(string s1, string s2) { ll int n = s1.length(); ll int m = s2.length(); if (n == 0 || m == 0) { return ""; } vector<vector<ll int>> dp(n + 1, vector<ll int>(m + 1, 0)); for (int i = 1; i <= n; i++) { for (int j = 1;...
#include <bits/stdc++.h> using namespace std; #define ll long long string lcs(string s1, string s2) { ll int n = s1.length(); ll int m = s2.length(); if (n == 0 || m == 0) { return ""; } vector<vector<ll int>> dp(n + 1, vector<ll int>(m + 1, 0)); for (int i = 1; i <= n; i++) { for (int j = 1;...
replace
33
34
33
34
0
p03165
C++
Time Limit Exceeded
#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...
insert
98
98
98
101
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int using namespace std; ll dp[3000][3000]; int main() { string p, q; cin >> p >> q; for (int i = 0; i <= p.length(); i++) { for (int j = 0; j <= q.length(); j++) { if (i == 0 || j == 0) { dp[i][j] = 0; } else if (p[i - 1] == q[j - 1]) { ...
#include <bits/stdc++.h> #define ll long long int using namespace std; ll dp[3001][3001]; int main() { string p, q; cin >> p >> q; for (int i = 0; i <= p.length(); i++) { for (int j = 0; j <= q.length(); j++) { if (i == 0 || j == 0) { dp[i][j] = 0; } else if (p[i - 1] == q[j - 1]) { ...
replace
3
4
3
4
0
p03165
C++
Runtime Error
/* * 未だ解けていない */ #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int MAX = 3000 + 10; int dp[MAX][MAX]; int main() { string s1; string s2; cin >> s1 >> s2; // vector<vector<int>> dp(s1.length() + 10, vector<int>(s2.length() + 10, 0)); for (int ...
/* * 未だ解けていない */ #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int MAX = 3000 + 10; int dp[MAX][MAX]; int main() { string s1; string s2; cin >> s1 >> s2; // vector<vector<int>> dp(s1.length() + 10, vector<int>(s2.length() + 10, 0)); for (int ...
insert
78
78
78
80
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int int mod = INT_MAX; int memo[3005][3005]; int n; string LCSstr(string &s1, string &s2, int i, int j, int len) { // base cases if ((i >= s1.size()) or (j >= s2.size()) or (len == 0)) return ""; // selfwork string ans; while (len > 0) { ...
#include <bits/stdc++.h> using namespace std; #define int long long int int mod = INT_MAX; int memo[3005][3005]; int n; string LCSstr(string &s1, string &s2, int i, int j, int len) { // base cases if ((i >= s1.size()) or (j >= s2.size()) or (len == 0)) return ""; // selfwork string ans; while (len > 0) { ...
delete
44
48
44
44
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 3007; int dp[MAXN][MAXN]; char s[MAXN], t[MAXN]; int main() { scanf(" %s", s + 1); scanf(" %s", t + 1); int n = strlen(s + 1), m = strlen(t + 1); for (int i = 1; i <= n / 2; i++) swap(s[i], s[n + 1 - i]); for (int j = 1; j <= m / 2; j++) s...
#include <bits/stdc++.h> using namespace std; const int MAXN = 3007; int dp[MAXN][MAXN]; char s[MAXN], t[MAXN]; int main() { scanf(" %s", s + 1); scanf(" %s", t + 1); int n = strlen(s + 1), m = strlen(t + 1); for (int i = 1; i <= n / 2; i++) swap(s[i], s[n + 1 - i]); for (int j = 1; j <= m / 2; j++) s...
replace
18
27
18
25
-6
d2fe1de6-9a29-42b1-9b91-8c5d4a81d0ce.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03165/C++/s668438060.cpp:22: int main(): Assertion `s[i] == t[j]' failed.
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // typedef tree<int, null_type, less<int>, rb_tree_tag, // tree_order_statistics_node_update> pbds; #define int long long #define pb push_back #define inf 1e9 #define mod 1000000007 const int maxn =...
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // typedef tree<int, null_type, less<int>, rb_tree_tag, // tree_order_statistics_node_update> pbds; #define int long long #define pb push_back #define inf 1e9 #define mod 1000000007 const int maxn =...
replace
33
34
33
34
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back using namespace std; int32_t main() { string a, b; cin >> a >> b; int n = a.length(); int m = b.length(); vector<vector<int>> d(n + 1, vector<int>(m + 1)); for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { d[i][j] = 0; } } for (...
#include <bits/stdc++.h> #define pb push_back using namespace std; int32_t main() { string a, b; cin >> a >> b; int n = a.length(); int m = b.length(); vector<vector<int>> d(n + 1, vector<int>(m + 1)); for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { d[i][j] = 0; } } for (...
replace
39
40
39
40
0
p03165
C++
Time Limit Exceeded
/* * * * * * * * * * * ** * * * saurabh8522 * * I will handle * * IT. * * * * * * * * * * * * * * **/ #include <bits/stdc++.h> #define mp(a, b) make_pair(a, b) #define pb push_back #define FastRead ...
/* * * * * * * * * * * ** * * * saurabh8522 * * I will handle * * IT. * * * * * * * * * * * * * * **/ #include <bits/stdc++.h> #define mp(a, b) make_pair(a, b) #define pb push_back #define FastRead ...
replace
102
107
102
108
TLE
p03165
C++
Memory Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <random> #include <regex> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <random> #include <regex> #include...
insert
314
314
314
317
MLE
p03165
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> std::string s, t; int dp[3001][3001]; int main() { std::cin >> s >> t; int n = s.length(); int m = t.length(); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;...
#include <algorithm> #include <iostream> #include <string> std::string s, t; int dp[3001][3001]; int main() { std::cin >> s >> t; int n = s.length(); int m = t.length(); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;...
replace
23
24
23
24
0
p03165
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> #define Rep(i, n) for (int i = 0; i < (n); ++i) #define Repd(i, n) for (int i = (n)-1; i >= 0; --i) #d...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> #define Rep(i, n) for (int i = 0; i < (n); ++i) #define Repd(i, n) for (int i = (n)-1; i >= 0; --i) #d...
replace
38
39
38
39
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair int main() { ios_base::sync_with_stdio(0); cin.tie(0); #ifndef ONLINE_JUDGE // for getting input from input.txt freopen("input.txt", "r+", stdin); // for writing output to output.txt freopen("outp...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair int main() { ios_base::sync_with_stdio(0); cin.tie(0); // #ifndef ONLINE_JUDGE // // for getting input from input.txt // freopen("input.txt", "r+", stdin); // // for writing output to out...
replace
11
17
11
17
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define brep(i, a, b) for (ll i = (a), i##_len = (b); i <= i##_len; i++) #define rrep(i, n) ...
#include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define brep(i, a, b) for (ll i = (a), i##_len = (b); i <= i##_len; i++) #define rrep(i, n) ...
replace
184
185
184
185
0
p03165
C++
Runtime Error
#pragma region template #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define brep(i, a, b) for (ll i = (a), i##_len = (b); i <= i##_len; i++) #define rrep(i, n) ...
#pragma region template #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define brep(i, a, b) for (ll i = (a), i##_len = (b); i <= i##_len; i++) #define rrep(i, n) ...
replace
190
204
190
218
0
p03165
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> #define FOR(i, i0, n) for (int i = (i0); i < (n); i++) #define COUT(val) cout << (val) << "\n"; using namespace std; using ll = long long int; int main(void) { string s, t; cin >> s >> t; int ns = s.size(), nt = t.size(); vector<vect...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define FOR(i, i0, n) for (int i = (i0); i < (n); i++) #define COUT(val) cout << (val) << "\n"; using namespace std; using ll = long long int; int main(void) { string s, t; cin >> s >> t; int ns = s.size(), nt = t.size(); vector<vect...
replace
25
26
25
26
0
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> #define ll long long #defi...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> #define ll long long #defi...
replace
111
112
111
112
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string s, t; int dp[3000][3000]; int main() { cin >> s >> t; int ls = s.length(); int lt = t.length(); for (int i = 1; i <= ls; i++) { for (int j = 1; j <= lt; j++) { if (s[i - 1] == t[j - 1]) { dp[i][j] = dp[i - 1][j - 1] + 1; } d...
#include <bits/stdc++.h> using namespace std; string s, t; int dp[4000][4000]; int main() { cin >> s >> t; int ls = s.length(); int lt = t.length(); for (int i = 1; i <= ls; i++) { for (int j = 1; j <= lt; j++) { if (s[i - 1] == t[j - 1]) { dp[i][j] = dp[i - 1][j - 1] + 1; } d...
replace
5
6
5
6
0
p03165
C++
Runtime Error
#define rep(i, n) REP(i, 0, n) #define REP(i, a, b) for (int i = a; i < (int)(b); i++) #include <bits/stdc++.h> typedef long long ll; using namespace std; template <class T> inline void chmax(T &a, const T &b) { if (a < b) a = b; } template <class T> inline void chmin(T &a, const T &b) { if (a > b) a = b; ...
#define rep(i, n) REP(i, 0, n) #define REP(i, a, b) for (int i = a; i < (int)(b); i++) #include <bits/stdc++.h> typedef long long ll; using namespace std; template <class T> inline void chmax(T &a, const T &b) { if (a < b) a = b; } template <class T> inline void chmin(T &a, const T &b) { if (a > b) a = b; ...
replace
38
39
38
39
0
p03165
C++
Runtime Error
#include <cstring> #include <fstream> #include <iostream> #define nmax 3001 using namespace std; ifstream fin("p.in"); ofstream fout("p.out"); int dist[nmax][nmax]; int main() { char s[nmax], t[nmax]; cin >> s >> t; int n = strlen(s), m = strlen(t); for (int i = 0; i <= n; i++) for (int j = 0; j <= m; j...
#include <cstring> #include <fstream> #include <iostream> #define nmax 3001 using namespace std; ifstream fin("p.in"); ofstream fout("p.out"); int dist[nmax][nmax]; int main() { char s[nmax], t[nmax]; cin >> s >> t; int n = strlen(s), m = strlen(t); for (int i = 0; i <= n; i++) for (int j = 0; j <= m; j...
replace
36
37
36
37
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define PI acos(-1) #define mx 110 int fx[] = {0, 0, -1, 1}; int fy[] = {1, -1, 0, 0}; char s1[mx], s2[mx]; char symbol[mx][mx]; int i, j, m, n, larr[mx][mx]; void print(int i, int j) { if (i == 0 || j == 0) return; if (symbol[i][j] == 'c') { ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define PI acos(-1) #define mx 3005 int fx[] = {0, 0, -1, 1}; int fy[] = {1, -1, 0, 0}; char s1[mx], s2[mx]; char symbol[mx][mx]; int i, j, m, n, larr[mx][mx]; void print(int i, int j) { if (i == 0 || j == 0) return; if (symbol[i][j] == 'c') { ...
replace
4
5
4
5
0
p03165
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> int main() { std::string s, t, result; std::cin >> s >> t; int DP[301][301]; for (int i = 0; i < (int)s.length(); i++) DP[i][0] = 0; for (int i = 0; i < (int)t.length(); i++) DP[0][i] = 0; for (int i = 1; i <= (int)s.length(); i++) { f...
#include <algorithm> #include <cmath> #include <iostream> int main() { std::string s, t, result; std::cin >> s >> t; int DP[3001][3001]; for (int i = 0; i < (int)s.length(); i++) DP[i][0] = 0; for (int i = 0; i < (int)t.length(); i++) DP[0][i] = 0; for (int i = 1; i <= (int)s.length(); i++) { ...
replace
7
8
7
8
0
p03165
C++
Time Limit Exceeded
// made by capeta160 #include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #define etm \ ...
// made by capeta160 #include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; #define etm \ ...
replace
365
380
365
390
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = int64_t; int main() { string s, t; cin >> s >> t; vector<vector<ll>> dp(s.size() + 1, vector<ll>(t.size() + 1, 0)); vector<vector<pair<ll, ll>>> pre( s.size() + 1, vector<pair<ll, ll>>(t.size() + 1, {-1, -1})); ll max_value = -1; for (ll i = ...
#include <bits/stdc++.h> using namespace std; using ll = int64_t; int main() { string s, t; cin >> s >> t; vector<vector<ll>> dp(s.size() + 1, vector<ll>(t.size() + 1, 0)); vector<vector<pair<ll, ll>>> pre( s.size() + 1, vector<pair<ll, ll>>(t.size() + 1, {-1, -1})); ll max_value = -1; for (ll i = ...
delete
53
54
53
53
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long int INF = 1LL << 60; int main() { string s, t; cin >> s; cin >> t; vector<vector<int>> dp(s.length() + 1, vector<int>(t.length(), 0)); for (int i = 0; i < s.length(); i++) { for (int j = 0; j < t.length(); j++) { i...
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long int INF = 1LL << 60; int main() { string s, t; cin >> s; cin >> t; vector<vector<int>> dp(s.length() + 1, vector<int>(t.length() + 1, 0)); for (int i = 0; i < s.length(); i++) { for (int j = 0; j < t.length(); j++) { ...
replace
12
13
12
13
0
p03165
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int f[3005][3005], l1, l2, p[3005][3005]; char s1[3005], s2[3005]; inline void print(int x, int y) { if (!x && !y) return; if (p[x][y] == 1) { print(x - 1, y - 1); printf("%c", s1[x]); } else if (p[x][y] == 3) print(x, ...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int f[3005][3005], l1, l2, p[3005][3005]; char s1[3005], s2[3005]; inline void print(int x, int y) { if (!x && !y) return; if (p[x][y] == 1) { print(x - 1, y - 1); printf("%c", s1[x]); } else if (p[x][y] == 3) print(x, ...
insert
21
21
21
25
0
p03165
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string s1, s2, ans = ""; cin >> s1 >> s2; int l1 = s1.size(), l2 = s2.size(); int dp[l2 + 1][l1 + 1]; for (int i = 0; i < l1 + 1; ++i) for (int j = 0; j < l2 + 1; ++j) dp[i][j] = 0; for (int i = 1; i < l2 + 1; ++i) for (i...
#include <iostream> #include <string> using namespace std; int main() { string s1, s2, ans = ""; cin >> s1 >> s2; int l1 = s1.size(), l2 = s2.size(); int dp[l2 + 1][l1 + 1]; for (int i = 0; i < l2 + 1; ++i) for (int j = 0; j < l1 + 1; ++j) dp[i][j] = 0; for (int i = 1; i < l2 + 1; ++i) for (i...
replace
9
11
9
11
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define int long long int #define IOS ios_base::sync_with_stdio(false), cin.tie(NULL); #define fr(i, a, b) for (int i = a; i <= b; i++) #define rf(j, b, a) for (int j = b; j >= a; j--) #define frr(k, a, b) for (int k = a; k <= b; k++) #define mp make_pair #define pb push_back #define MOD 100000...
#include <bits/stdc++.h> #define int long long int #define IOS ios_base::sync_with_stdio(false), cin.tie(NULL); #define fr(i, a, b) for (int i = a; i <= b; i++) #define rf(j, b, a) for (int j = b; j >= a; j--) #define frr(k, a, b) for (int k = a; k <= b; k++) #define mp make_pair #define pb push_back #define MOD 100000...
replace
14
19
14
20
0
p03165
C++
Runtime Error
/* Coded by peyha X */ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int NMAX = 1e3 + 1, AUCUN = 0; string s, t; char used[NMAX][NMAX]; int n, m, dp[NMAX][NMAX]; pair<int, int> last[NMAX][NMAX]; void retrieve(int k, int l) { if (k == 0 || l == 0) { return; } int nextK = las...
/* Coded by peyha X */ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int NMAX = 3 * 1e3 + 2, AUCUN = 0; string s, t; char used[NMAX][NMAX]; int n, m, dp[NMAX][NMAX]; pair<int, int> last[NMAX][NMAX]; void retrieve(int k, int l) { if (k == 0 || l == 0) { return; } int nextK =...
replace
12
13
12
13
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define rfor(i, n) for (int i = n - 1; i >= 0; --i) #define rmod(x, y) (((x % y) + y) % y) using namespace std; typedef vector<int>::iterator vit; typedef unsigned int uint; typedef unsigned short ushort; typedef long long ll; const int MAXN =...
#include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define rfor(i, n) for (int i = n - 1; i >= 0; --i) #define rmod(x, y) (((x % y) + y) % y) using namespace std; typedef vector<int>::iterator vit; typedef unsigned int uint; typedef unsigned short ushort; typedef long long ll; const int MAXN =...
replace
41
43
41
43
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define MX 1003 int dp[MX][MX]; int main() { string s, t; cin >> s >> t; for (int i = 1; i <= s.size(); ++i) { for (int j = 1; j <= t.size(); ++j) { if (s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1; else d...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define MX 3003 int dp[MX][MX]; int main() { string s, t; cin >> s >> t; for (int i = 1; i <= s.size(); ++i) { for (int j = 1; j <= t.size(); ++j) { if (s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1; else d...
replace
3
4
3
4
0
p03165
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie...
replace
55
56
55
56
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int m = s1.length(), n = s2.length(); int lookup[m + 1][n + 1]; memset(lookup, 0, sizeof lookup); int i, j; for (i = 1; i <= m; i++) { for (j = 1; j <= n; j++) { if (s1[i - 1] == s2[j - 1]) looku...
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int m = s1.length(), n = s2.length(); int lookup[m + 1][n + 1]; memset(lookup, 0, sizeof lookup); int i, j; for (i = 1; i <= m; i++) { for (j = 1; j <= n; j++) { if (s1[i - 1] == s2[j - 1]) looku...
replace
25
26
25
26
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string i1; string i2; cin >> i1 >> i2; long int Arr[i1.length() + 1][i2.length() + 1]; for (long int i = 0; i <= i2.length(); i++) { for (long int j = 0; j <= i1.length(); j++) { if (i == 0 || j == 0) { Arr[i][j] = 0; } else if...
#include <bits/stdc++.h> using namespace std; int main() { string i1; string i2; cin >> i1 >> i2; long int Arr[i2.length() + 1][i1.length() + 1]; for (long int i = 0; i <= i2.length(); i++) { for (long int j = 0; j <= i1.length(); j++) { if (i == 0 || j == 0) { Arr[i][j] = 0; } else if...
replace
6
7
6
7
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t, res = ""; cin >> s >> t; int n = s.size(), m = t.size(), i, j; int b[n + 2][m + 2]; for (i = 0; i <= n; i++) { b[i][0] = 0; } for (i = 0; i <= m; i++) { b[0][i] = 0; } for (i = 1; i <= n; i++) { for (j = 1; j <= m; j++...
#include <bits/stdc++.h> using namespace std; int main() { string s, t, res = ""; cin >> s >> t; int n = s.size(), m = t.size(), i, j; int b[n + 2][m + 2]; for (i = 0; i <= n; i++) { b[i][0] = 0; } for (i = 0; i <= m; i++) { b[0][i] = 0; } for (i = 1; i <= n; i++) { for (j = 1; j <= m; j++...
replace
26
27
26
27
0
p03165
C++
Runtime Error
#include <iostream> #include <string> using namespace std; // define maximum possible length of string X and Y #define MAX 20 // lookup[i][j] stores the length of LCS of substring X[0..i-1], Y[0..j-1] int lookup[MAX][MAX]; // Recursive Function to find Longest Common Subsequence of // string X[0..m-1] and Y[0..n-1] ...
#include <iostream> #include <string> using namespace std; // define maximum possible length of string X and Y #define MAX 3003 // lookup[i][j] stores the length of LCS of substring X[0..i-1], Y[0..j-1] int lookup[MAX][MAX]; // Recursive Function to find Longest Common Subsequence of // string X[0..m-1] and Y[0..n-1...
replace
5
6
5
6
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; // constant const ll MOD = 1e+9 + 7; const double EPS = 1e-10; #define REP(i, n) for (ll i = 0; i < n; i++) #define FOR(i, s, e) for (ll i = s; i < e; i++) #define ALL(x) (x).begin(), (x).end() #define RALL(x) (x).rbegin(), (x).rend() // debug #def...
#include <bits/stdc++.h> using namespace std; using ll = long long; // constant const ll MOD = 1e+9 + 7; const double EPS = 1e-10; #define REP(i, n) for (ll i = 0; i < n; i++) #define FOR(i, s, e) for (ll i = s; i < e; i++) #define ALL(x) (x).begin(), (x).end() #define RALL(x) (x).rbegin(), (x).rend() // debug #def...
replace
55
56
55
56
0
p03165
C++
Runtime Error
// Code by : Abhishek Tiwari // codechef.com/users/devil_within || hackerearth.com/@devil_within #include <bits/stdc++.h> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
// Code by : Abhishek Tiwari // codechef.com/users/devil_within || hackerearth.com/@devil_within #include <bits/stdc++.h> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
87
90
87
89
0
p03165
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; const int MAX = 1010; string a, b; int dp[MAX][MAX]; int sol(int m, int n) { if (!m or !n) return 0; int &ans = dp[m][n]; if (ans != -1) return ans; if (a[m - 1] == b[n - 1]) ans = 1 + sol(m - 1, n - 1); else ans = max(sol(m, n - 1), sol(m - 1, ...
#include "bits/stdc++.h" using namespace std; const int MAX = 3010; string a, b; int dp[MAX][MAX]; int sol(int m, int n) { if (!m or !n) return 0; int &ans = dp[m][n]; if (ans != -1) return ans; if (a[m - 1] == b[n - 1]) ans = 1 + sol(m - 1, n - 1); else ans = max(sol(m, n - 1), sol(m - 1, ...
replace
3
4
3
4
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX 1010 string a, b; int dp[MAX][MAX]; int get(int i = 0, int j = 0) { if (i == a.size() || j == b.size()) return 0; int &ret = dp[i][j]; if (ret + 1) return ret; ret = 0; if (a[i] == b[j]) return ret = 1 + get(i + 1, j + 1); return ret = ...
#include <bits/stdc++.h> using namespace std; #define MAX 3010 string a, b; int dp[MAX][MAX]; int get(int i = 0, int j = 0) { if (i == a.size() || j == b.size()) return 0; int &ret = dp[i][j]; if (ret + 1) return ret; ret = 0; if (a[i] == b[j]) return ret = 1 + get(i + 1, j + 1); return ret = ...
replace
3
4
3
4
0