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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | replace | 47 | 48 | 47 | 48 | TLE | |
p03165 | C++ | Runtime Error | // Created by ahmed_drawy on 11/09/19.
/// dp educational contest atcoder
#include <bits/stdc++.h>
#include <string.h>
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedMacroInspection"
using namespace std;
#define lp(i, start, end) for (int i = start; i < end; ++i)
#define lllp(i, start, end) for (... | // Created by ahmed_drawy on 11/09/19.
/// dp educational contest atcoder
#include <bits/stdc++.h>
#include <string.h>
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedMacroInspection"
using namespace std;
#define lp(i, start, end) for (int i = start; i < end; ++i)
#define lllp(i, start, end) for (... | replace | 40 | 41 | 40 | 41 | 0 | |
p03165 | C++ | Runtime Error | #include <cstdio> // 回溯输出
#include <cstring>
const int maxn = 3000;
char s[maxn], t[maxn];
int dp[maxn][maxn];
int max(int a, int b) { return a > b ? a : b; }
void print_string(int, int);
int main() {
scanf("%s %s", s + 1, t + 1);
memset(dp, 0, sizeof(dp));
int len1 = strlen(s + 1);
int len2 = strlen(... | #include <cstdio> // 回溯输出
#include <cstring>
const int maxn = 3000 + 5;
char s[maxn], t[maxn];
int dp[maxn][maxn];
int max(int a, int b) { return a > b ? a : b; }
void print_string(int, int);
int main() {
scanf("%s %s", s + 1, t + 1);
memset(dp, 0, sizeof(dp));
int len1 = strlen(s + 1);
int len2 = str... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <ctype.h>
#include <deque> //<< fixed << setprecision()
#include <iomanip>
#include <iostream>
#include <map>
#include <queue> //priority_queue
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
typedef long long... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <ctype.h>
#include <deque> //<< fixed << setprecision()
#include <iomanip>
#include <iostream>
#include <map>
#include <queue> //priority_queue
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
typedef long long... | replace | 59 | 60 | 59 | 60 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
string text1, text2, str;
getline(cin, text1);
getline(cin, text2);
int m = text1.size() + 1;
int n = text2.size() + 1;
text1 = '*' + text1;
text2 = '*' + text2;
int lcs[m][n];
for (int i = 0; i < n; i++)
lcs[0][i] = 0;
for (int i = 0;... | #include <bits/stdc++.h>
using namespace std;
int main() {
string text1, text2, str;
getline(cin, text1);
getline(cin, text2);
int m = text1.size() + 1;
int n = text2.size() + 1;
text1 = '*' + text1;
text2 = '*' + text2;
int lcs[m][n];
for (int i = 0; i < n; i++)
lcs[0][i] = 0;
for (int i = 0;... | replace | 28 | 41 | 28 | 38 | TLE | |
p03165 | C++ | Runtime Error | #ifndef TEMPLATE
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#ifdef LOCAL
#include <debug.h>
#else
#define db(...) 21
#endif
#define mp make_pair
#define sz(a) ((int)(a).size())
#define mem(x, v) memset((x), (v), sizeof((x)));
#define A(x) (x).begin(), (x).end()
#define re(... | #ifndef TEMPLATE
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#ifdef LOCAL
#include <debug.h>
#else
#define db(...) 21
#endif
#define mp make_pair
#define sz(a) ((int)(a).size())
#define mem(x, v) memset((x), (v), sizeof((x)));
#define A(x) (x).begin(), (x).end()
#define re(... | replace | 59 | 61 | 59 | 60 | -11 | |
p03165 | C++ | Runtime Error | //
// Created by Ciafrino on 1/6/19.
//
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#inc... | //
// Created by Ciafrino on 1/6/19.
//
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#inc... | replace | 33 | 34 | 33 | 34 | 0 | |
p03165 | C++ | Runtime Error | /*
* Note: This template uses some c++11 functions , so you have to compile it
* with c++11 flag. Example:- $ g++ -std=c++11 c++Template.cpp
*
*/
/******** All Required Header Files ********/
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <ext/pb_ds/assoc_container.hpp>
#i... | /*
* Note: This template uses some c++11 functions , so you have to compile it
* with c++11 flag. Example:- $ g++ -std=c++11 c++Template.cpp
*
*/
/******** All Required Header Files ********/
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <ext/pb_ds/assoc_container.hpp>
#i... | replace | 113 | 114 | 113 | 114 | 0 | |
p03165 | C++ | Time Limit Exceeded | #ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include <bits/stdc++.h>
#endif
using namespace std;
using ll = long long;
// constant
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 RREP(i, n) for (ll i = n; i >= 0; i--)
#defi... | #ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include <bits/stdc++.h>
#endif
using namespace std;
using ll = long long;
// constant
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 RREP(i, n) for (ll i = n; i >= 0; i--)
#defi... | delete | 78 | 80 | 78 | 78 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[3000][3000];
int main() {
string s, t;
cin >> s;
cin >> t;
int n = s.length();
int 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;
continue;
}
if (... | #include <bits/stdc++.h>
using namespace std;
int dp[3005][3005];
int main() {
string s, t;
cin >> s;
cin >> t;
int n = s.length();
int 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;
continue;
}
if (... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int DP[3001][3001];
string S, T, LCS;
void Print() {
int i = S.length(), j = T.length();
while (i && j) {
if (S[i - 1] == T[j - 1]) {
LCS += S[i - 1];
i--;
j--;
} else {
if (DP[i - 1][j] > DP[i][j - 1])
i--;
else
j--... | #include <bits/stdc++.h>
using namespace std;
int DP[3002][3002];
string S, T, LCS;
void Print() {
int i = S.length(), j = T.length();
while (i && j) {
if (S[i - 1] == T[j - 1]) {
LCS += S[i - 1];
i--;
j--;
} else {
if (DP[i - 1][j] > DP[i][j - 1])
i--;
else
j--... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++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 all(v) (v.begin(), v.end())
#define EACH(i, s) \
for (__typeo... | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++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 all(v) (v.begin(), v.end())
#define EACH(i, s) \
for (__typeo... | replace | 25 | 28 | 25 | 28 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[3003][3003] = {};
int main() {
string s, t;
cin >> s >> t;
int n = (int)s.size();
int m = (int)t.size();
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if (i * j == 0)
dp[i][j] = 0;
else if (s[i - 1] == t[j - 1])
... | #include <bits/stdc++.h>
using namespace std;
int dp[3003][3003] = {};
int main() {
string s, t;
cin >> s >> t;
int n = (int)s.size();
int m = (int)t.size();
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if (i * j == 0)
dp[i][j] = 0;
else if (s[i - 1] == t[j - 1])
... | replace | 27 | 28 | 27 | 28 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3 + 7;
string s, t;
int dp[N][N];
pair<int, int> construct[N][N];
int solve(int i, int j) {
if (i == s.size() || j == t.size()) {
return 0;
}
if (dp[i][j] != -1)
return dp[i][j];
if (s[i] == t[j]) {
construct[i][... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e3 + 7;
string s, t;
int dp[N][N];
pair<int, int> construct[N][N];
int solve(int i, int j) {
if (i == s.size() || j == t.size()) {
return 0;
}
if (dp[i][j] != -1)
return dp[i][j];
if (s[i] == t[j]) {
construct[i][... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1e+9;
int main() {
static int dp[3010][3010], ma = 0, me[3010][3010];
string s, t, ans;
cin >> s >> t;
for (int i = 0; i < s.length(); ++i) {
for (int j ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1e+9;
int main() {
static int dp[3010][3010], ma = 0, me[3010][3010];
string s, t, ans;
cin >> s >> t;
for (int i = 0; i < s.length(); ++i) {
for (int j ... | replace | 39 | 41 | 39 | 42 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
void doc() {
freopen("OB.inp", "r", stdin);
freopen("OB.out", "w", stdout);
}
const int MaxN = 3 * 1e3 + 5;
int f[MaxN][MaxN];
string s, t;
void Trace(int n, int m) {
if (n <= 0 || m <= 0)
return;
if (f[n][m] == f[n - 1][m])
Trace(n - 1, m);
else if (f... | #include <bits/stdc++.h>
using namespace std;
void doc() {
freopen("OB.inp", "r", stdin);
freopen("OB.out", "w", stdout);
}
const int MaxN = 3 * 1e3 + 5;
int f[MaxN][MaxN];
string s, t;
void Trace(int n, int m) {
if (n <= 0 || m <= 0)
return;
if (f[n][m] == f[n - 1][m])
Trace(n - 1, m);
else if (f... | replace | 54 | 55 | 54 | 55 | 0 | |
p03165 | C++ | Runtime Error | /// Journey to the End of earth ///
/// Gunjan Kumar ///
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <functional> // for less
// using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define s(n) scanf("%d", &n)
#define ls(... | /// Journey to the End of earth ///
/// Gunjan Kumar ///
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <functional> // for less
// using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define s(n) scanf("%d", &n)
#define ls(... | delete | 48 | 53 | 48 | 48 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 4096;
string s, t;
int dp[MAXN][MAXN];
int ls, lt;
int pre[MAXN][MAXN];
void dfs(int x, int y) {
if (!x && !y)
return;
if (pre[x][y] == 1) {
dfs(x - 1, y - 1);
cout << s[x];
} else if (pre[x][y] == 2) {
dfs(x, y - 1);
} else
d... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 4096;
string s, t;
int dp[MAXN][MAXN];
int ls, lt;
int pre[MAXN][MAXN];
void dfs(int x, int y) {
if (!x || !y)
return;
if (pre[x][y] == 1) {
dfs(x - 1, y - 1);
cout << s[x];
} else if (pre[x][y] == 2) {
dfs(x, y - 1);
} else
d... | replace | 11 | 12 | 11 | 12 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <vector>
using namespace std;
int n;
char s[3000], t[3000];
vector<char> rs;
int slen, tlen;
void read() {
cin >> s;
cin >> t;
slen = strlen(s);
tlen = strlen(t);
}
int dp[3005][3005];
int solve() {
int i, j;
for (i = 0; i <= strlen(s); i++) {
dp[i][0] = 0;
}
for (i... | #include <bits/stdc++.h>
#include <vector>
using namespace std;
int n;
char s[3000], t[3000];
vector<char> rs;
int slen, tlen;
void read() {
cin >> s;
cin >> t;
slen = strlen(s);
tlen = strlen(t);
}
int dp[3005][3005];
int solve() {
int i, j;
for (i = 0; i <= strlen(s); i++) {
dp[i][0] = 0;
}
for (i... | insert | 45 | 45 | 45 | 46 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define fast ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define fast ... | replace | 42 | 44 | 42 | 44 | 0 | |
p03165 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | replace | 260 | 262 | 260 | 262 | -11 | |
p03165 | 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 | 46 | 56 | 46 | 50 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
const ll mod = 1e9 + 7;
c... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
const ll mod = 1e9 + 7;
c... | replace | 38 | 39 | 38 | 39 | 0 |
TIME: 0.000113 sec
|
p03165 | C++ | Runtime Error |
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
#define vll vector<ll>
#define vvll vector<vll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define inf 1e18;
#define vfind(v, x) (find(all(v), x) !=... |
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
#define vll vector<ll>
#define vvll vector<vll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define inf 1e18;
#define vfind(v, x) (find(all(v), x) !=... | delete | 203 | 207 | 203 | 203 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set ... | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set ... | replace | 136 | 137 | 136 | 137 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
string S, T;
pair<int, int> dp[3009][3009];
int main() {
cin >> S >> T;
for (int i = 0; i <= 3000; i++) {
for (int j = 0; j <= 3000; j++)
dp[i][j] = make_pair(-1, -1);
}
dp[0][0] = make_pair(0, -1);
for (int i = 0; i <... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
string S, T;
pair<int, int> dp[3009][3009];
int main() {
cin >> S >> T;
for (int i = 0; i <= 3000; i++) {
for (int j = 0; j <= 3000; j++)
dp[i][j] = make_pair(-1, -1);
}
dp[0][0] = make_pair(0, -1);
for (int i = 0; i <... | replace | 25 | 26 | 25 | 26 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ppi pair<int, int>... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ppi pair<int, int>... | replace | 21 | 22 | 21 | 22 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
/*
code credits : ਜ਼ੈਲਦਾਰ
dashan jot singh
*/
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define inf LLONG_MAX
#define p pair<ll, ll>
string s, t;
ll a, b;
ll dp[3010][3010];
s... | #include <bits/stdc++.h>
/*
code credits : ਜ਼ੈਲਦਾਰ
dashan jot singh
*/
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define inf LLONG_MAX
#define p pair<ll, ll>
string s, t;
ll a, b;
ll dp[3010][3010];
s... | insert | 22 | 22 | 22 | 25 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
vector<vector<int>> dp(a.length() + 1, vector<int>(b.length() + 1, 0));
for (int i = 1; i <= a.length(); i++) {
for (int j = 1; j <= b.length(); j++) {
if (a[i - 1] == b[j - 1]) {
dp[i][j] = dp[i - 1][j - 1]... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
vector<vector<int>> dp(a.length() + 1, vector<int>(b.length() + 1, 0));
for (int i = 1; i <= a.length(); i++) {
for (int j = 1; j <= b.length(); j++) {
if (a[i - 1] == b[j - 1]) {
dp[i][j] = dp[i - 1][j - 1]... | replace | 18 | 19 | 18 | 19 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string LCS(string s, string t) {
int n = s.length();
int m = t.length();
// int dp[n+1][m+1];
int **dp = new int *[n + 1];
for (int i = 0; i <= n; i++) {
dp[i] = new int[m + 1];
}
// base case
for (int j = 0; j <= m; j++) {
dp[n][j] = 0;
}
for... | #include <bits/stdc++.h>
using namespace std;
string LCS(string s, string t) {
int n = s.length();
int m = t.length();
// int dp[n+1][m+1];
int **dp = new int *[n + 1];
for (int i = 0; i <= n; i++) {
dp[i] = new int[m + 1];
}
// base case
for (int j = 0; j <= m; j++) {
dp[n][j] = 0;
}
for... | replace | 41 | 42 | 41 | 42 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
string S, T;
int dp[1010][1010];
int main() {
cin >> S >> T;
int n = (int)S.size();
int m = (int)T.size();
// LCSの長さを求める
dp[0][0] = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (S[i] == T[j]) {... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
string S, T;
int dp[3010][3010];
int main() {
cin >> S >> T;
int n = (int)S.size();
int m = (int)T.size();
// LCSの長さを求める
dp[0][0] = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (S[i] == T[j]) {... | replace | 6 | 7 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
vector<vector<int>> dp(s.length() + 1, vector<int>(t.length() + 1));
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s[i] == t[j]) {
dp[i + 1][j + 1] = dp[i][j] + 1;
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
vector<vector<int>> dp(s.length() + 1, vector<int>(t.length() + 1));
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s[i] == t[j]) {
dp[i + 1][j + 1] = dp[i][j] + 1;
}... | replace | 18 | 19 | 18 | 19 | 0 | |
p03165 | C++ | Runtime Error | //
// Created by 13783 on 2020/4/2.
//
#include <iostream>
using namespace std;
string s, t;
const int len = 3e3;
int dp[len][len];
int n;
void solve() {
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s[i] == t[j]) {
dp[i + 1][j + 1] = dp[i][j] + 1;
} else
... | //
// Created by 13783 on 2020/4/2.
//
#include <iostream>
using namespace std;
string s, t;
const int len = 3e3 + 2;
int dp[len][len];
int n;
void solve() {
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s[i] == t[j]) {
dp[i + 1][j + 1] = dp[i][j] + 1;
} els... | replace | 6 | 7 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
// Your code here!
// int dp[3001][3001] = {{}};
vector<vector<int>> dp(3001, vector<int>(3001, 0));
string S, T;
cin >> S;
cin >> T;
for (int i = 1; i < S.size() + 1; i++) {
for (int j = 1; j < T.size() + 1; j++) {
dp[... | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
// Your code here!
// int dp[3001][3001] = {{}};
vector<vector<int>> dp(3001, vector<int>(3001, 0));
string S, T;
cin >> S;
cin >> T;
for (int i = 1; i < S.size() + 1; i++) {
for (int j = 1; j < T.size() + 1; j++) {
dp[... | replace | 24 | 36 | 24 | 41 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3005;
int dp[MAXN][MAXN];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s, t;
cin >> s >> t;
int len_s = (int)s.size();
int len_t = (int)t.size();
memset(dp, 0, sizeof dp);
for (int i = 1; i <= len_s; i++) {
for (i... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3005;
int dp[MAXN][MAXN];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s, t;
cin >> s >> t;
int len_s = (int)s.size();
int len_t = (int)t.size();
memset(dp, 0, sizeof dp);
for (int i = 1; i <= len_s; i++) {
for (i... | replace | 32 | 33 | 32 | 33 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// DEFINE and
// TYPEDEF--------------------------------------------------------------
// For actual content check from line 85
#define FORG(i, a, n) \
for (lld i = (lld)a; a < n ? i < (lld)n : (lld)n < i; ... | #include <bits/stdc++.h>
using namespace std;
// DEFINE and
// TYPEDEF--------------------------------------------------------------
// For actual content check from line 85
#define FORG(i, a, n) \
for (lld i = (lld)a; a < n ? i < (lld)n : (lld)n < i; ... | replace | 140 | 141 | 140 | 141 | -11 | |
p03165 | C++ | Runtime Error | /*
[Gnana Deepak]
[August 01, 2020 7:44 PM]
[F - LCS]
[https://atcoder.jp/contests/dp/tasks/dp_f]
[2000 ms]
[1024 MB]
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
using ld = long double;
#pragma GCC optimize("O3")
#pragma c... | /*
[Gnana Deepak]
[August 01, 2020 7:44 PM]
[F - LCS]
[https://atcoder.jp/contests/dp/tasks/dp_f]
[2000 ms]
[1024 MB]
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
using ld = long double;
#pragma GCC optimize("O3")
#pragma c... | replace | 83 | 84 | 83 | 84 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
int slen, tlen, dp[305][305] = {0};
cin >> s;
cin >> t;
slen = s.length();
tlen = t.length();
s = " " + s;
t = " " + t;
for (int i = 1; i <= slen; i++) {... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
int slen, tlen, dp[3005][3005] = {0};
cin >> s;
cin >> t;
slen = s.length();
tlen = t.length();
s = " " + s;
t = " " + t;
for (int i = 1; i <= slen; i++)... | replace | 10 | 11 | 10 | 11 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[3001][3001], i, j;
string s, t, ans;
int main() {
cin >> s >> t;
s += '$';
t += '%';
for (; i < s.size(); i++) {
for (j = 0; j < t.size(); j++) {
dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
dp[i][j + 1] = max(dp[i][j + 1], dp[i][j]);
if ... | #include <bits/stdc++.h>
using namespace std;
int dp[3002][3002], i, j;
string s, t, ans;
int main() {
cin >> s >> t;
s += '$';
t += '%';
for (; i < s.size(); i++) {
for (j = 0; j < t.size(); j++) {
dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
dp[i][j + 1] = max(dp[i][j + 1], dp[i][j]);
if ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
string s;
string t;
pair<int, int> nexty[3005][3005];
int dp[3005][3005];
int solve(int i, int j) {
if (i == s.size() || j == t.size()) {
return 0;
}
int &res = dp[i][j];
if (res != -1) {
return res;
}
if (s[i] == t[j]) {
ne... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
string s;
string t;
pair<int, int> nexty[3005][3005];
int dp[3005][3005];
int solve(int i, int j) {
if (i == s.size() || j == t.size()) {
return 0;
}
int &res = dp[i][j];
if (res != -1) {
return res;
}
if (s[i] == t[j]) {
ne... | replace | 30 | 31 | 30 | 31 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define nl "\n"
#define pb push_back
#define E esit(0)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
const int INF = 1e9 + 7;
int dp[1001][1001];
string s, s1, ans;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> s >> s1;... | #include <bits/stdc++.h>
#define nl "\n"
#define pb push_back
#define E esit(0)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
const int INF = 1e9 + 7;
int dp[3001][3001];
string s, s1, ans;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> s >> s1;... | replace | 9 | 10 | 9 | 10 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define vect vector<ll>
#define unmap unordered_map
#define pb push_back
#define pi 3.1415926536
#define mod int(1e9 + 7)
#define mp make_pair
#define testcases \
ll t; ... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define vect vector<ll>
#define unmap unordered_map
#define pb push_back
#define pi 3.1415926536
#define mod int(1e9 + 7)
#define mp make_pair
#define testcases \
ll t; ... | replace | 24 | 26 | 24 | 26 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <string>
using namespace std;
#define typeof(x) __typeof__(x)
#define bit(x, i) (x & (1 << i)) // select the bit of position i of x
#define lowbit(x) ((x) & ((x) ^ ((x)-1))) // get the lowest bit of x
#define hBit(msb, n) ... | #include <bits/stdc++.h>
// #include <string>
using namespace std;
#define typeof(x) __typeof__(x)
#define bit(x, i) (x & (1 << i)) // select the bit of position i of x
#define lowbit(x) ((x) & ((x) ^ ((x)-1))) // get the lowest bit of x
#define hBit(msb, n) ... | replace | 147 | 148 | 147 | 148 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iomanip>
#define FAST \
std::ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iomanip>
#define FAST \
std::ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 162 | 163 | 162 | 163 | -11 | |
p03165 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
const int MSIZE = 3003;
int dp[MSIZE][MSIZE];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s, t;
cin >> s >> t;
memset(dp, 0, sizeof dp);
int n = s.size();
int m = t.size();
s = " " + s;
t = " " + t;
for (int i = 1; i <=... | #include "bits/stdc++.h"
using namespace std;
const int MSIZE = 3003;
int dp[MSIZE][MSIZE];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s, t;
cin >> s >> t;
memset(dp, 0, sizeof dp);
int n = s.size();
int m = t.size();
s = " " + s;
t = " " + t;
for (int i = 1; i <=... | replace | 33 | 38 | 33 | 34 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (long long i = o; i < n; i++)
#define oneforall \
ios::sync_with_stdio(false); \
cin.tie(0);
typedef vector<int> vi;
typedef vector<long... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (long long i = o; i < n; i++)
#define oneforall \
ios::sync_with_stdio(false); \
cin.tie(0);
typedef vector<int> vi;
typedef vector<long... | replace | 22 | 24 | 22 | 24 | -11 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = long long;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<ll, ll>>>;
#define rep(i, n) for (int i = 0; i ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = long long;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<ll, ll>>>;
#define rep(i, n) for (int i = 0; i ... | replace | 99 | 100 | 99 | 100 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MAX = 1e3 + 10;
string A, B;
ll N, M;
ll dp[MAX][MAX];
int solve(int i, int j) {
if (i >= N || j >= M)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int ans = 0;
if (A[i] == B[j]) {
ans = 1 + solve(i + 1, j + 1);
} ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MAX = 3e3 + 10;
string A, B;
ll N, M;
ll dp[MAX][MAX];
int solve(int i, int j) {
if (i >= N || j >= M)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int ans = 0;
if (A[i] == B[j]) {
ans = 1 + solve(i + 1, j + 1);
} ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 5;
int n, m;
int dp[MAX_N][MAX_N];
char s[MAX_N], t[MAX_N], ans[MAX_N];
int main() {
// dp[i][j] = maximum lcs using first i chars from s and first j chars from t
// if s[i] == t[j], then there is a match, so, dp[i][j] = 1 + dp[i - 1][j - 1... | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3e3 + 5;
int n, m;
int dp[MAX_N][MAX_N];
char s[MAX_N], t[MAX_N], ans[MAX_N];
int main() {
// dp[i][j] = maximum lcs using first i chars from s and first j chars from t
// if s[i] == t[j], then there is a match, so, dp[i][j] = 1 + dp[i - 1][j - 1... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int MAX_LENGTH = 3012;
string s, t, dp[MAX_LENGTH][MAX_LENGTH];
int main() {
cin >> s >> t;
int s_length = s.size(), t_length = t.size();
if (s[0] == t[0])
dp[0][0] = s[0];
for (int i = 1; i < t_length; ++i) {
if (t[i] == s[0] && dp[0][i - 1].e... | #include <bits/stdc++.h>
using namespace std;
const int MAX_LENGTH = 3012;
string s, t, dp[2][MAX_LENGTH];
int main() {
cin >> s >> t;
int s_length = s.size(), t_length = t.size();
if (s[0] == t[0])
dp[0][0] = s[0];
for (int i = 1; i < t_length; ++i) {
if (t[i] == s[0] && dp[0][i - 1].empty())
... | replace | 5 | 6 | 5 | 6 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
using namespa... | #include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
using namespa... | replace | 24 | 25 | 24 | 25 | TLE | |
p03165 | C++ | Runtime Error | //
// Created by Pulak on 18-11-2019.
//
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int s1 = a.size();
int s2 = b.size();
vector<vector<int>> dp(5000, vector<int>(5000));
for (int i = 0; i <= s1; ++i) {
for (int j = 0; j <= s2; ++j) {
... | //
// Created by Pulak on 18-11-2019.
//
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int s1 = a.size();
int s2 = b.size();
vector<vector<int>> dp(5000, vector<int>(5000));
for (int i = 0; i <= s1; ++i) {
for (int j = 0; j <= s2; ++j) {
... | replace | 26 | 27 | 26 | 27 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define stop \
char nyaa; \
cin >> nyaa;
#define rep(i, n) for ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define stop \
char nyaa; \
cin >> nyaa;
#define rep(i, n) for ... | replace | 19 | 20 | 19 | 20 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// C++14 (GCC 5.4.1)
#define LLINF (1LL << 60)
typedef long long ll;
#define mod 1000000007
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
#define rrepd(i, a, b) for (int i = (a); i >= (b); i--)
template <typename T> inline bool ch... | #include <bits/stdc++.h>
using namespace std;
// C++14 (GCC 5.4.1)
#define LLINF (1LL << 60)
typedef long long ll;
#define mod 1000000007
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
#define rrepd(i, a, b) for (int i = (a); i >= (b); i--)
template <typename T> inline bool ch... | replace | 61 | 62 | 61 | 62 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int dp[3000][3000];
string li, ne;
int f(int i, int j) {
if (i == li.size() || j == ne.size())
return 0;
if (dp[i][j] != -1)
return dp[i][j];
if (li[i] == ne[j])
return dp[i][j]... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int dp[3001][3001];
string li, ne;
int f(int i, int j) {
if (i == li.size() || j == ne.size())
return 0;
if (dp[i][j] != -1)
return dp[i][j];
if (li[i] == ne[j])
return dp[i][j]... | replace | 9 | 10 | 9 | 10 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ios \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
const ll mod = ... | #include <bits/stdc++.h>
#define ll long long
#define ios \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
const ll mod = ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define Ds 1
#define Dt 2
#define Db 3
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define ff first
#define ss second
typedef long long ll;
typedef pair<int, int> pi... | #include <bits/stdc++.h>
using namespace std;
#define Ds 1
#define Dt 2
#define Db 3
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define ff first
#define ss second
typedef long long ll;
typedef pair<int, int> pi... | replace | 15 | 16 | 15 | 16 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9 + 7)
#define P pair<int, int>
#define PLL pair<ll, ll>
#define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define RFOR(i, m, n) for (int i = (... | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9 + 7)
#define P pair<int, int>
#define PLL pair<ll, ll>
#define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define RFOR(i, m, n) for (int i = (... | replace | 35 | 36 | 35 | 36 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int M = 3e3 + 4;
string s, t, ans = "";
int dp[M][M], a, b, cnt, vis[M][M];
void fun(int x, int y) {
if (x <= 0 || y <= 0 || cnt < 0)
return;
if (s[x] == t[y] && dp[x][y] == cnt) {
ans += s[x];
cnt--;
fun(x - 1, y - 1);
} else {
fun(x, y - 1)... | #include <bits/stdc++.h>
using namespace std;
const int M = 3e3 + 4;
string s, t, ans = "";
int dp[M][M], a, b, cnt, vis[M][M];
void fun(int x, int y) {
if (x <= 0 || y <= 0 || cnt < 0)
return;
if (s[x] == t[y] && dp[x][y] == cnt) {
ans += s[x];
cnt--;
fun(x - 1, y - 1);
} else {
if (dp[x][y -... | replace | 13 | 15 | 13 | 17 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3 + 2;
char res[N];
ll dp[N][N];
int main() {
string s, t;
cin >> s >> t;
ll ns = s.length();
ll nt = t.length();
for (int i = 1; i <= ns; i++) {
for (int j = 1; j <= nt; j++) {
if (s[i - 1] == t[j - 1])
dp[... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e3 + 2;
char res[N];
ll dp[N][N];
int main() {
string s, t;
cin >> s >> t;
ll ns = s.length();
ll nt = t.length();
for (int i = 1; i <= ns; i++) {
for (int j = 1; j <= nt; j++) {
if (s[i - 1] == t[j - 1])
dp[... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int solution() {
string s, t;
getline(cin, s);
getline(cin, t);
ll n = s.length();
ll m = t.length();
vector<vector<ll>> dp(n + 1, vector<ll>(m + 1, 0));
for (ll i = 1; i <= n; i++) {
for (ll j = 1; j <= m; j++) {
if (s[i - 1]... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int solution() {
string s, t;
getline(cin, s);
getline(cin, t);
ll n = s.length();
ll m = t.length();
vector<vector<ll>> dp(n + 1, vector<ll>(m + 1, 0));
for (ll i = 1; i <= n; i++) {
for (ll j = 1; j <= m; j++) {
if (s[i - 1]... | replace | 22 | 23 | 22 | 23 | 0 | |
p03165 | C++ | Runtime Error | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#define ii int64_t
#define PI 3.14
#define lli long long ... | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#define ii int64_t
#define PI 3.14
#define lli long long ... | replace | 39 | 40 | 39 | 40 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n);... | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n);... | replace | 31 | 32 | 31 | 32 | 0 | |
p03165 | C++ | Time Limit Exceeded | /*
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
//*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
... | /*
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
//*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
... | insert | 80 | 80 | 80 | 82 | TLE | |
p03165 | C++ | Runtime Error | /// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// ALLAH save us from COVID-19.Amin.
/// █▀█─█──█──█▀█─█─█
/// █▄█─█──█──█▄█─█▄█
/// █─█─█▄─█▄─█─█─█─█
/// كُلُّ نَفْسٍ ذَآئِقَةُ الْمَوْت
/// Every soul shall taste death.
/// TODO::
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_contain... | /// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// ALLAH save us from COVID-19.Amin.
/// █▀█─█──█──█▀█─█─█
/// █▄█─█──█──█▄█─█▄█
/// █─█─█▄─█▄─█─█─█─█
/// كُلُّ نَفْسٍ ذَآئِقَةُ الْمَوْت
/// Every soul shall taste death.
/// TODO::
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_contain... | replace | 105 | 106 | 105 | 106 | 0 | |
p03165 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
using namespace std;
// int dp[3100][3100];
int dp[50][50];
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); ++i) {
dp[i][0] = 0;
}
for (int j = 0; j < t.size(); ++j) {
dp[0][j] = 0;
}
// memset(dp, 0, sizeof(dp));... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int dp[3100][3100];
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); ++i) {
dp[i][0] = 0;
}
for (int j = 0; j < t.size(); ++j) {
dp[0][j] = 0;
}
// memset(dp, 0, sizeof(dp)); // kottinoga ra... | replace | 6 | 8 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int dp[n + 1][m + 1];
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[i][j]... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int dp[n + 1][m + 1];
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[i][j]... | replace | 19 | 20 | 19 | 20 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long maxn = 2000;
long long f[maxn + 5][maxn + 5];
int main() {
string s, s1 = "", ans = "";
long long i, j, m, n;
cin >> s1 >> s;
if (s1.length() > s.length())
swap(s1, s);
m = s.length();
n = s1.length();
s = 'l' + s;
s1 = 'l' + s1;
for (i... | #include <bits/stdc++.h>
using namespace std;
const long long maxn = 3000;
long long f[maxn + 5][maxn + 5];
int main() {
string s, s1 = "", ans = "";
long long i, j, m, n;
cin >> s1 >> s;
if (s1.length() > s.length())
swap(s1, s);
m = s.length();
n = s1.length();
s = 'l' + s;
s1 = 'l' + s1;
for (i... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int dp[3001][3001];
int lcs(string s, string t, int n, int m) {
if (n >= s.size() || m >= t.size()) {
dp[n][m] = 0;
return 0;
}
if (dp[n][m] != -1)
return dp[n][m];
int ans;
if (s[n] == t[m]) {
if (dp[n + 1][m + 1] == -1)
dp[n + 1][m + 1] = l... | #include <bits/stdc++.h>
using namespace std;
int dp[3001][3001];
int lcs(string &s, string &t, int n, int m) {
if (n >= s.size() || m >= t.size()) {
dp[n][m] = 0;
return 0;
}
if (dp[n][m] != -1)
return dp[n][m];
int ans;
if (s[n] == t[m]) {
if (dp[n + 1][m + 1] == -1)
dp[n + 1][m + 1] =... | replace | 3 | 4 | 3 | 4 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define IOS \
{ \
ios ::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
{ \
ios ::sync_with_stdio(false); \
cin.tie(0); ... | replace | 73 | 74 | 73 | 74 | 0 | |
p03165 | C++ | Runtime Error | // turmak-_-
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define nl "\n"
#define IOI return 0;
#define pb push_back
#define ll long long
#define ld long double
#define IOS \
ios_base ::sync_with_stdio(NULL); ... | // turmak-_-
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define nl "\n"
#define IOI return 0;
#define pb push_back
#define ll long long
#define ld long double
#define IOS \
ios_base ::sync_with_stdio(NULL); ... | replace | 25 | 27 | 25 | 27 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
#define w first
#define v second
#define ii pair<ll, ll>
using namespace std;
string s, t;
const int N = 1010;
int m, n;
int mem[N][N];
int dp(int i, int j) {
if (i == n || j == m)
return 0;
int &ret = mem[i][j];
if (ret != -1)
return ret;
ret = 0;
if (... | #include <bits/stdc++.h>
typedef long long ll;
#define w first
#define v second
#define ii pair<ll, ll>
using namespace std;
string s, t;
const int N = 3010;
int m, n;
int mem[N][N];
int dp(int i, int j) {
if (i == n || j == m)
return 0;
int &ret = mem[i][j];
if (ret != -1)
return ret;
ret = 0;
if (... | replace | 8 | 9 | 8 | 9 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e+7;
const int N = 1e3 + 5;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define fr(i, l, m) for (int i = l; i < m; i++)
#define vii vector<int>
#define vpr vector<pair<ll, ll>>
ll pwr(ll x, ll y)... | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e+7;
const int N = 3e3 + 5;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define fr(i, l, m) for (int i = l; i < m; i++)
#define vii vector<int>
#define vpr vector<pair<ll, ll>>
ll pwr(ll x, ll y)... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error |
// Target Expert
/*
* Author : raj1307 - Raj Singh
* Institute : Jalpaiguri Government Engineering College
* Date : 3.08.19
*/
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctime>
#i... |
// Target Expert
/*
* Author : raj1307 - Raj Singh
* Institute : Jalpaiguri Government Engineering College
* Date : 3.08.19
*/
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctime>
#i... | replace | 164 | 169 | 164 | 165 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
const int mod = 1000000007;
const ll INF = 1LL << 60;
int main() {
string S, T;
cin >> S >> T;
vector<vector<int>> dp(S.size() + 2, vector<int>(T.size() + 2, 0));
vector<vector<pair<int, int>>> par(
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
const int mod = 1000000007;
const ll INF = 1LL << 60;
int main() {
string S, T;
cin >> S >> T;
vector<vector<int>> dp(S.size() + 2, vector<int>(T.size() + 2, 0));
vector<vector<pair<int, int>>> par(
... | replace | 35 | 36 | 35 | 36 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i)
#define repprev(i, a, b) for (ll i = b - 1; i >= a; i--)
#define reprev(i, n) repprev(i, 0, n)
u... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i)
#define repprev(i, a, b) for (ll i = b - 1; i >= a; i--)
#define reprev(i, n) repprev(i, 0, n)
u... | replace | 285 | 286 | 285 | 286 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[2001][2001];
int main() {
string s, t;
cin >> s;
cin >> t;
int lens = s.length();
int lent = t.length();
// dp[i][j] is len lcs of 0-i-1 and 0-j-1
// dp[i][j] = if(s[i-1]==t[j-1]) 1 + dp[i-1][j-1]
// dp[i][j] = max(dp[i-1][j],dp[i][j-1])
// int dp[... | #include <bits/stdc++.h>
using namespace std;
int dp[3001][3001];
int main() {
string s, t;
cin >> s;
cin >> t;
int lens = s.length();
int lent = t.length();
// dp[i][j] is len lcs of 0-i-1 and 0-j-1
// dp[i][j] = if(s[i-1]==t[j-1]) 1 + dp[i-1][j-1]
// dp[i][j] = max(dp[i-1][j],dp[i][j-1])
// int dp[... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | /// Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_cxx;
#define FASTIO \
ios::sync_with_stdio(false); \
cin.tie(0); ... | /// Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_cxx;
#define FASTIO \
ios::sync_with_stdio(false); \
cin.tie(0); ... | replace | 78 | 81 | 78 | 81 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3;
string s, t;
int dp[N + 1][N + 1];
int f(unsigned int i, unsigned int j) {
if (i == s.size() || j == t.size())
return 0;
if (dp[i][j] != -1)
return dp[i][j];
if (s[i] == t[j])
return dp[i][j] = f(i + 1, j + 1) + 1;
return dp[i][j] = ma... | #include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1e3;
string s, t;
int dp[N + 1][N + 1];
int f(unsigned int i, unsigned int j) {
if (i == s.size() || j == t.size())
return 0;
if (dp[i][j] != -1)
return dp[i][j];
if (s[i] == t[j])
return dp[i][j] = f(i + 1, j + 1) + 1;
return dp[i][j] ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend... | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend... | replace | 108 | 109 | 108 | 109 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MAXN 3010
#define pii pair<int, int>
#define pb push_back
typedef long long ll;
using namespace std;
int n, m, dp[MAXN][MAXN];
int b[MAXN][MAXN];
string s, t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s >> t;
n = s.size();
m = t.size();
for (int ... | #include <bits/stdc++.h>
#define MAXN 3010
#define pii pair<int, int>
#define pb push_back
typedef long long ll;
using namespace std;
int n, m, dp[MAXN][MAXN];
int b[MAXN][MAXN];
string s, t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s >> t;
n = s.size();
m = t.size();
for (int ... | replace | 36 | 37 | 36 | 37 | 0 | |
p03165 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cmath>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <unistd.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typed... | #include <algorithm>
#include <cmath>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <unistd.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typed... | insert | 66 | 66 | 66 | 68 | MLE | |
p03165 | C++ | Runtime Error | //============================================================================
// Name : f
// Date : Wed Feb 20 10:59:11 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | //============================================================================
// Name : f
// Date : Wed Feb 20 10:59:11 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | replace | 58 | 60 | 58 | 61 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long int;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long int;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
... | replace | 21 | 22 | 21 | 22 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair
#define REP(i, n) for (i = 0; i < (n); ++i)
#define FOR(i, l, h) for (i = (l); i <= (h); ++i)
#define FORD(i, h, l) for (i = (h); i >= (l); --i)
#define max(a, b) a > b ? a : b
#define min(a, b) a > b ? b : a
using namespace std;
... | #include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair
#define REP(i, n) for (i = 0; i < (n); ++i)
#define FOR(i, l, h) for (i = (l); i <= (h); ++i)
#define FORD(i, h, l) for (i = (h); i >= (l); --i)
#define max(a, b) a > b ? a : b
#define min(a, b) a > b ? b : a
using namespace std;
... | replace | 25 | 26 | 25 | 26 | 0 | |
p03165 | C++ | Runtime Error | /*
kaafi fucked up
*/
#define SET
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#define DEBUG
#include <bits/stdc++.h>
#include <string>
#define pb push_back
#define mp make_pair
#define f(i, a, b) for (long long i = a; i < b; i++)
#define revf(i, b, a) f... | /*
kaafi fucked up
*/
#define SET
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#define DEBUG
#include <bits/stdc++.h>
#include <string>
#define pb push_back
#define mp make_pair
#define f(i, a, b) for (long long i = a; i < b; i++)
#define revf(i, b, a) f... | replace | 146 | 147 | 146 | 147 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string str = "";
string a, b;
cin >> a >> b;
int sa = a.length();
int sb = b.length();
int dp[sb + 1][sa + 1];
for (int i = 0; i < sa + 1; i++)
dp[0][i] = 0;
for (int i = 0; i < sb + 1; i++)
dp[i][0] = 0;
for (int i = 1; i < sb + 1; i+... | #include <bits/stdc++.h>
using namespace std;
int main() {
string str = "";
string a, b;
cin >> a >> b;
int sa = a.length();
int sb = b.length();
int dp[sb + 1][sa + 1];
for (int i = 0; i < sa + 1; i++)
dp[0][i] = 0;
for (int i = 0; i < sb + 1; i++)
dp[i][0] = 0;
for (int i = 1; i < sb + 1; i+... | replace | 23 | 24 | 23 | 24 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
int dp[3001][3001];
int main() {
char s[3001], s1[3001];
cin >> s >> s1;
int len = strlen(s), len1 = strlen(s1);
for (int i = 1; i <= len; i++) {
for (int j = 1; j <= len1; j++) {
if (... | #include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
int dp[3001][3001];
int main() {
char s[3001], s1[3001];
cin >> s >> s1;
int len = strlen(s), len1 = strlen(s1);
for (int i = 1; i <= len; i++) {
for (int j = 1; j <= len1; j++) {
if (... | replace | 21 | 22 | 21 | 22 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string a, b, s = "";
int arr[3001][3001], alen, blen;
void dp(string a, string b) {
alen = a.length(), blen = b.length();
for (int i = 0; i <= blen; i++) {
for (int j = 0; j <= alen; j++) {
int k = i - 1, l = j - 1;
if (i == 0 || j == 0)
arr[i]... | #include <bits/stdc++.h>
using namespace std;
string a, b, s = "";
int arr[3001][3001], alen, blen;
void dp(string a, string b) {
alen = a.length(), blen = b.length();
for (int i = 0; i <= blen; i++) {
for (int j = 0; j <= alen; j++) {
int k = i - 1, l = j - 1;
if (i == 0 || j == 0)
arr[i]... | replace | 22 | 33 | 22 | 34 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string a, b;
cin >> a;
cin >> b;
a = ' ' + a;
b = ' ' + b;
int A = a.length();
int B = b.length();
int dp[A][B];
for (int i = 0; i < A; i++) {
for (int j = 0; j < B; j++) {
if (i == 0 || j == 0) {
dp[i]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string a, b;
cin >> a;
cin >> b;
a = ' ' + a;
b = ' ' + b;
int A = a.length();
int B = b.length();
int dp[A][B];
for (int i = 0; i < A; i++) {
for (int j = 0; j < B; j++) {
if (i == 0 || j == 0) {
dp[i]... | replace | 27 | 28 | 27 | 28 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string s1, s2;
static int t[2001][2001];
void nhap() { cin >> s1 >> s2; }
void qhd() {
for (int i = 1; i <= (int)s1.length(); i++)
for (int j = 1; j <= (int)s2.length(); j++)
if (s1[i - 1] == s2[j - 1])
t[i][j] = t[i - 1][j - 1] + 1;
else
t... | #include <bits/stdc++.h>
using namespace std;
string s1, s2;
static int t[3005][3005];
void nhap() { cin >> s1 >> s2; }
void qhd() {
for (int i = 1; i <= (int)s1.length(); i++)
for (int j = 1; j <= (int)s2.length(); j++)
if (s1[i - 1] == s2[j - 1])
t[i][j] = t[i - 1][j - 1] + 1;
else
t... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;
int dp[3000 + 1][3000 + 1];
int main() {
string s, t, ans;
cin >> s >> t;
fill(dp[0], dp[3000 + 1], 0);
for ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;
int dp[3000 + 1][3000 + 1];
int main() {
string s, t, ans;
cin >> s >> t;
fill(dp[0], dp[3000 + 1], 0);
for ... | replace | 34 | 35 | 34 | 35 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fi first
#define sec second
#define MOD 1000000007
#define pb push_back
#define test cout << "debuged\n";
#define INF 10000000000
#define si 1000000
#define debug(x) cout << x << "\n";
int main() {
ios_base::sync_with_stdio(false);
cin... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fi first
#define sec second
#define MOD 1000000007
#define pb push_back
#define test cout << "debuged\n";
#define INF 10000000000
#define si 1000000
#define debug(x) cout << x << "\n";
int main() {
ios_base::sync_with_stdio(false);
cin... | replace | 15 | 19 | 15 | 16 | 0 | |
p03165 | C++ | Runtime Error | //============================================================================
// Name : f
// Date : Wed Feb 20 10:59:11 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | //============================================================================
// Name : f
// Date : Wed Feb 20 10:59:11 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/s... | replace | 74 | 76 | 74 | 77 | 0 | |
p03165 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <i... | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <i... | replace | 125 | 126 | 125 | 136 | TLE | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vect... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vect... | replace | 37 | 38 | 37 | 38 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[1002][1002];
string sa, sb;
int rec(int a, int b) {
if (a == sa.size() or b == sb.size())
return 0;
if (dp[a][b] != -1)
return dp[a][b];
// dp[a][b]=0;
if (sa[a] == sb[b]) {
dp[a][b] = rec(a + 1, b + 1) + 1;
} else
dp[a][b] = max(rec(a + ... | #include <bits/stdc++.h>
using namespace std;
int dp[3003][3003];
string sa, sb;
int rec(int a, int b) {
if (a == sa.size() or b == sb.size())
return 0;
if (dp[a][b] != -1)
return dp[a][b];
// dp[a][b]=0;
if (sa[a] == sb[b]) {
dp[a][b] = rec(a + 1, b + 1) + 1;
} else
dp[a][b] = max(rec(a + ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int N;
string s, t;
i... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int N;
string s, t;
i... | replace | 36 | 47 | 36 | 47 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string a, b;
int dp[1009][1009];
int solve(int idx1, int idx2) {
if (idx1 >= a.length() || idx2 >= b.length())
return 0;
if (dp[idx1][idx2] != -1)
return dp[idx1][idx2];
if (a[idx1] == b[idx2]) {
dp[idx1][idx2] = solve(idx1 + 1, idx2 + 1) + 1;
} else... | #include <bits/stdc++.h>
using namespace std;
string a, b;
int dp[3009][3009];
int solve(int idx1, int idx2) {
if (idx1 >= a.length() || idx2 >= b.length())
return 0;
if (dp[idx1][idx2] != -1)
return dp[idx1][idx2];
if (a[idx1] == b[idx2]) {
dp[idx1][idx2] = solve(idx1 + 1, idx2 + 1) + 1;
} else... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ms(x, t) memset(x, t, sizeof(x))
typedef long long int ll;
typedef unsigned long long int ull;
const int limit = 3e3 + 1;
const int inf = 1e7;
int main() {
string s, t;
cin >> s >> t;
int sl = s.length();
int tl = t.length();
int m[sl + 1][tl + 1];
stac... | #include <bits/stdc++.h>
using namespace std;
#define ms(x, t) memset(x, t, sizeof(x))
typedef long long int ll;
typedef unsigned long long int ull;
const int limit = 3e3 + 1;
const int inf = 1e7;
int main() {
string s, t;
cin >> s >> t;
int sl = s.length();
int tl = t.length();
int m[sl + 1][tl + 1];
stac... | replace | 27 | 29 | 27 | 29 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.