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; int dp[3001][3001]; int idx[3001][3001]; bool already[3001][3001]; string a, b; int Solve(int x = 0, int y = 0) { if (already[x][y]) return dp[x][y]; if (x == a.size() || y == b.size()) dp[x][y] = 0; else { dp[x][y] = Solve(x + 1, y); int i = y; ...
#include <bits/stdc++.h> using namespace std; int dp[3001][3001]; int idx[3001][3001]; bool already[3001][3001]; string a, b; int Solve(int x = 0, int y = 0) { if (already[x][y]) return dp[x][y]; already[x][y] = true; if (x == a.size() || y == b.size()) dp[x][y] = 0; else { dp[x][y] = Solve(x + 1...
insert
12
12
12
13
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[1001][1001]; string s, t, ans; int main() { 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] = max({dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1]}); else ...
#include <bits/stdc++.h> using namespace std; int dp[3001][3001]; string s, t, ans; int main() { 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] = max({dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1]}); else ...
replace
2
3
2
3
0
p03165
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
insert
87
87
87
89
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int m = s.length(); int n = t.length(); int dp[m + 1][n + 1]; for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { dp[i][j] = 0; } } for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; ...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int m = s.length(); int n = t.length(); int dp[m + 1][n + 1]; for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { dp[i][j] = 0; } } for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; ...
replace
25
26
25
26
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++) #define FORN(i, b, a) for (int i = (b); _a = (a); i >= _a; i--) #define REP(i, n) for (int i = 0, _n = n; i < n; i++) #define ll long long #define pii pair<int, int> #define re return #define vi vector<int> #define pb push_back #def...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++) #define FORN(i, b, a) for (int i = (b); _a = (a); i >= _a; i--) #define REP(i, n) for (int i = 0, _n = n; i < n; i++) #define ll long long #define pii pair<int, int> #define re return #define vi vector<int> #define pb push_back #def...
replace
37
38
37
38
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAX = 3005; int dp[MAX][MAX]; int main() { string s, t; cin >> s; cin >> 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] = 1 + dp[i - 1][j - 1]; } else { ...
#include <bits/stdc++.h> using namespace std; const int MAX = 3005; int dp[MAX][MAX]; int main() { string s, t; cin >> s; cin >> 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] = 1 + dp[i - 1][j - 1]; } else { ...
replace
28
29
28
29
0
p03165
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long LL; typedef pair<LL, LL> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; const int ...
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long LL; typedef pair<LL, LL> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; const int ...
insert
31
31
31
32
MLE
p03165
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
insert
142
142
142
144
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define pb emplace_back #define fi first #define se second #define int long long using namespace std; mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int l) { uniform_int_distribution<int> uid(0, l - 1); return uid(rang); } int a[3001][3001]; ...
#include <bits/stdc++.h> #define pb emplace_back #define fi first #define se second #define int long long using namespace std; mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int l) { uniform_int_distribution<int> uid(0, l - 1); return uid(rang); } int a[3001][3001]; ...
replace
16
20
16
20
0
p03165
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> using std::max; int LCS(char *s1, char *s2, char *res) { int i, j, M, N, k = 0, upbd; M = strlen(s1); N = strlen(s2); int **dp; dp = new int *[M + 2]; for (i = 0; i < M + 2; i++) dp[i] = new int[N + 2]; for (i = 0; i < N + 2; i++) dp[0][i]...
#include <algorithm> #include <cstdio> #include <cstring> using std::max; int LCS(char *s1, char *s2, char *res) { int i, j, M, N, k = 0, upbd; M = strlen(s1); N = strlen(s2); int **dp; dp = new int *[M + 2]; for (i = 0; i < M + 2; i++) dp[i] = new int[N + 2]; for (i = 0; i < N + 2; i++) dp[0][i]...
replace
51
77
51
52
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAX_N = 1005; string s, t; int n, m; int dp[MAX_N][MAX_N]; pair<int, int> pre[MAX_N][MAX_N]; int main() { cin >> s >> t; n = s.size(), m = t.size(); s = '0' + s; t = '0' + t; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { // if(s...
#include <bits/stdc++.h> using namespace std; const int MAX_N = 3005; string s, t; int n, m; int dp[MAX_N][MAX_N]; pair<int, int> pre[MAX_N][MAX_N]; int main() { cin >> s >> t; n = s.size(), m = t.size(); s = '0' + s; t = '0' + t; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { // if(s...
replace
2
3
2
3
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int dp[3000][3000]; void helper(string &s, string &t, int len) { string LCS; int i = 0, j = 0; while (len) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else if (dp[i][j + 1] > dp[i + 1][j]) j++; else i++...
#include <bits/stdc++.h> using namespace std; int dp[3000][3000]; void helper(string &s, string &t, int len) { string LCS; int i = 0, j = 0; while (len) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else if (dp[i][j + 1] > dp[i + 1][j]) j++; else i++...
replace
20
21
20
21
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[1001][1001]; int main() { string s, t; cin >> s >> t; string ans = ""; for (int i = 0; i <= s.length(); i++) { for (int j = 0; j <= t.length(); j++) { if (i == 0 or 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 dp[3001][3001]; int main() { string s, t; cin >> s >> t; string ans = ""; for (int i = 0; i <= s.length(); i++) { for (int j = 0; j <= t.length(); j++) { if (i == 0 or j == 0) dp[i][j] = 0; else if (s[i - 1] == t[j - 1]) { dp[i][j...
replace
2
3
2
3
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n = s.length(), m = t.length(); 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; } } for (int i = 1; i <= n; i++) { fo...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n = s.length(), m = t.length(); 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; } } for (int i = 1; i <= n; i++) { fo...
replace
23
24
23
24
0
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i...
replace
29
32
29
32
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03165
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; #undef INT_MIN #undef INT_MAX #define LL long long #define INT_MIN -2147483647 #define INT_MAX 1000000009 #define LL_MIN -9223372036854775807 #define LL_MAX 9223372036854775807 string s...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; #undef INT_MIN #undef INT_MAX #define LL long long #define INT_MIN -2147483647 #define INT_MAX 1000000009 #define LL_MIN -9223372036854775807 #define LL_MAX 9223372036854775807 string s...
replace
51
52
51
52
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define MAX 3000 int dp[MAX + 1][MAX + 1]; string getLCS(string &s, string &t, int len) { string LCS; int i = 0, j = 0; while (len > 0) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else { if...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MAX 3000 int dp[MAX + 1][MAX + 1]; string getLCS(string &s, string &t, int len) { string LCS; int i = 0, j = 0; while (len > 0) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else { if...
replace
26
27
26
27
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; vector<vector<int>> dp(s.size() + 1, vector<int>(t.size() + 1)); 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] = max(dp[i][j], 1 + dp[i - 1][j...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; vector<vector<int>> dp(s.size() + 1, vector<int>(t.size() + 1)); 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] = max(dp[i][j], 1 + dp[i - 1][j...
replace
17
18
17
18
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long int arr[1000000][2], ans[105][100003]; vector<long long int> crr; long long int W, N; int dp[3005][3005]; vector<char> lcs(string s, string t) { int n = s.size(); int m = t.size(); for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if...
#include <bits/stdc++.h> using namespace std; long long int arr[1000000][2], ans[105][100003]; vector<long long int> crr; long long int W, N; int dp[3005][3005]; vector<char> lcs(string s, string t) { int n = s.size(); int m = t.size(); for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if...
replace
57
59
57
59
-11
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int arr[100005]; int dp[3005][3005]; int anss = 0; char rep[100005]; int c = 0; string str1, str2; int lcs(int first, int last) { if (first <= 0 | last <= 0) { return 0; } if (dp[first][last] != -1) return dp[first][last]; if (str1[...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int arr[100005]; int dp[3005][3005]; int anss = 0; char rep[100005]; int c = 0; string str1, str2; int lcs(int first, int last) { if (first <= 0 | last <= 0) { return 0; } if (dp[first][last] != -1) return dp[first][last]; if (str1[...
replace
18
19
18
19
0
p03165
C++
Runtime Error
/* It's better to sleep happy and tired rather than disappointed and frustrated There's only 1 thing that's impossible and that is defeating a man who doesn't give up */ #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define mx2 102 #define mx3 1003 #define mx4 ...
/* It's better to sleep happy and tired rather than disappointed and frustrated There's only 1 thing that's impossible and that is defeating a man who doesn't give up */ #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define mx2 102 #define mx3 1003 #define mx4 ...
replace
32
33
32
33
0
p03165
C++
Runtime Error
/** * author: Atreus **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e3 + 10; int dp[maxn][maxn], par[maxn][maxn]; int main() { ios_base::sync_with_stdio(false); string s, t; cin >> s >> t; for (int i = 1; i <= s.size(); i++) { for (int j = 1; j <= t.size()...
/** * author: Atreus **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 3e3 + 10; int dp[maxn][maxn], par[maxn][maxn]; int main() { ios_base::sync_with_stdio(false); string s, t; cin >> s >> t; for (int i = 1; i <= s.size(); i++) { for (int j = 1; j <= t.size()...
replace
8
9
8
9
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int dp[3001][3001]; int fun(string s1, string s2, int n, int m) { if (n == 0 || m == 0) return dp[n][m] = 0; else if (dp[n][m] != -1) return dp[n][m]; else if (s1[n - 1] == s2[m - 1]) return dp[n][m] = 1 + fun(s1, s2, n - 1, m - 1); else return dp[n]...
#include <bits/stdc++.h> using namespace std; int dp[3001][3001]; int fun(string s1, string s2, int n, int m) { if (n == 0 || m == 0) return dp[n][m] = 0; else if (dp[n][m] != -1) return dp[n][m]; else if (s1[n - 1] == s2[m - 1]) return dp[n][m] = 1 + fun(s1, s2, n - 1, m - 1); else return dp[n]...
replace
21
22
21
30
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
replace
53
54
53
54
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <unordered_map> #define inputarr(a, n) \ for (ll i = 0; i < n; i++) \ cin >> a[i]; #define prllarr(a, n) ...
#include <bits/stdc++.h> using namespace std; #include <unordered_map> #define inputarr(a, n) \ for (ll i = 0; i < n; i++) \ cin >> a[i]; #define prllarr(a, n) ...
replace
88
89
88
89
0
p03165
C++
Runtime Error
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; template <class T> using V = vector<T>; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 1000000007; ll gcd(ll a, ll b) { return b ? gcd(...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; template <class T> using V = vector<T>; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 1000000007; ll gcd(ll a, ll b) { return b ? gcd(...
replace
34
35
34
35
0
p03165
C++
Runtime Error
/*------U Have To DO It------*/ /* BY-> RicoProg */ /* ___ __|__| | |___ */ #include <bits/stdc++.h> using namespace std; //---------------------------------------------------MACROS---------------------------------------------------------- #define ll long long #define beg(i, n) for (...
/*------U Have To DO It------*/ /* BY-> RicoProg */ /* ___ __|__| | |___ */ #include <bits/stdc++.h> using namespace std; //---------------------------------------------------MACROS---------------------------------------------------------- #define ll long long #define beg(i, n) for (...
replace
62
64
62
68
-11
p03165
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> using namespace std; string s, t; int f[3001][3001]; int main() { cin >> s >> t; for (int i = s.size(); i >= 0; i--) { for (int j = t.size(); j >= 0; j--) { if (s[i] == t[j]) { f[i][j] = f[i + 1][j + 1] + 1; continue; } f...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; string s, t; int f[3100][3100]; int main() { cin >> s >> t; for (int i = s.size(); i >= 0; i--) { for (int j = t.size(); j >= 0; j--) { if (s[i] == t[j]) { f[i][j] = f[i + 1][j + 1] + 1; continue; } f...
replace
5
6
5
6
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string A; string B; cin >> A; cin >> B; int n = A.length(); int m = B.length(); int dp[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < ...
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string A; string B; cin >> A; cin >> B; int n = A.length(); int m = B.length(); int dp[n + 1][m + 1]; for (int i = 0; i <= n; i++) { for (int j ...
replace
15
18
15
18
0
p03165
C++
Time Limit Exceeded
#include "bits/stdc++.h" #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define all(V) (V).begin(), (V).end() ...
#include "bits/stdc++.h" #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define all(V) (V).begin(), (V).end() ...
insert
32
32
32
33
TLE
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ff first #define ss second us...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ff first #define ss second us...
insert
55
55
55
57
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const int N = (1e3) + 3; int memo[N][N]; string s1, s2; int n, m; void lcs(int n, int m) { for (int i = 0; i <= n; ++i) { memo[i][0] = 0; } for (int i = 0; i <= m; ++i) { memo[0][i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const int N = (3e3) + 3; int memo[N][N]; string s1, s2; int n, m; void lcs(int n, int m) { for (int i = 0; i <= n; ++i) { memo[i][0] = 0; } for (int i = 0; i <= m; ++i) { memo[0][i...
replace
6
7
6
7
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define re reverse using namespace std; signed main() { string b, c, a, d; cin >> b >> c; int lcs[1005][1005] = {}; for (int j = 1; j <= b.size(); j++) { for (int k = 1; k <= c.size(); k++) { if (b[j - 1] == c[k - 1]) lcs[j][k] = lcs[j - 1][k - 1] + 1; else ...
#include <bits/stdc++.h> #define re reverse using namespace std; signed main() { string b, c, a, d; cin >> b >> c; int lcs[3005][3005] = {}; for (int j = 1; j <= b.size(); j++) { for (int k = 1; k <= c.size(); k++) { if (b[j - 1] == c[k - 1]) lcs[j][k] = lcs[j - 1][k - 1] + 1; else ...
replace
6
7
6
7
0
p03165
C++
Runtime Error
#include <algorithm> #include <bitset> #include <chrono> #include <cstdio> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, x, y) for (ll i = x; i <= y; i++) #define SIZE(a) ll(a.size()) #define vll ...
#include <algorithm> #include <bitset> #include <chrono> #include <cstdio> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, x, y) for (ll i = x; i <= y; i++) #define SIZE(a) ll(a.size()) #define vll ...
replace
33
34
33
34
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e3 + 5; const int INF = 1e9 + 7; #define ll long long #define pb push_back #define endl '\n' #define fast_io \ ios_base::sync_with_stdio(false); \ ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 3e3 + 5; const int INF = 1e9 + 7; #define ll long long #define pb push_back #define endl '\n' #define fast_io \ ios_base::sync_with_stdio(false); \ ...
replace
3
4
3
4
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define vi vector<int> #define vb vector<bool> #define pii pair<int, int> #define mod 1000000007 #define ss second #define ff first #define vpii vector<pii> #define vvi vector<vi> #define pb push_back #define vs vector<string> int pow...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define vi vector<int> #define vb vector<bool> #define pii pair<int, int> #define mod 1000000007 #define ss second #define ff first #define vpii vector<pii> #define vvi vector<vi> #define pb push_back #define vs vector<string> int pow...
replace
27
28
27
28
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int dp[100][100]; string getLCS(string &s, string &t, int len) { int i = 0, j = 0; string LCS; while (len > 0) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else { if (dp[i][j + 1] > dp[i + 1][j]) j++; ...
#include <bits/stdc++.h> using namespace std; int dp[3005][3005]; string getLCS(string &s, string &t, int len) { int i = 0, j = 0; string LCS; while (len > 0) { if (s[i] == t[j]) { LCS.push_back(s[i]); i++; j++; len--; } else { if (dp[i][j + 1] > dp[i + 1][j]) j++; ...
replace
3
4
3
4
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define INF (1LL << 60) #define int long long #define magic 100000 using namespace std; int dp[3001][3001]; // i, j // dp[i][j] : lcs of s[1:i] and t[1:j] string ans; int32_t main() { string s, t; cin >> s >> t; for (int i = 0; i < (int)s.size(); i++) { for (int j = 0; j < (int)t.si...
#include <bits/stdc++.h> #define INF (1LL << 60) #define int long long #define magic 100000 using namespace std; int dp[3001][3001]; // i, j // dp[i][j] : lcs of s[1:i] and t[1:j] string ans; int32_t main() { string s, t; cin >> s >> t; for (int i = 0; i < (int)s.size(); i++) { for (int j = 0; j < (int)t.si...
replace
22
23
22
23
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #include <string> #define ll long long #define ld long double // #define endl '\n' #define With_the_name_of_Allah \ ios::sync_with_stdio(0); \ ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> #include <string> #define ll long long #define ld long double // #define endl '\n' #define With_the_name_of_Allah \ ios::sync_with_stdio(0); \ ios_base::sync_with_stdio(0); ...
replace
49
50
49
50
0
p03165
C++
Runtime Error
/* MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMNmmmNNMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNMMNNNMMMMMMMNNNNNNNNMMMMNmddNNMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNmmNNNNNNNNNNNNNNNNNNNmmmNNNNNNNNdyhmNMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMM...
/* MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMNmmmNNMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNMMNNNMMMMMMMNNNNNNNNMMMMNmddNNMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNmmNNNNNNNNNNNNNNNNNNNmmmNNNNNNNNdyhmNMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMM...
replace
188
189
188
189
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mmax(a, b, c) max(a, max(b, c)) #define mmin(a, b, c) min(a, min(b, c)) #define M 1000000007 #define V vector #define F(a, b, c) for (a = b; a <= c; ++a) #define I cin #define O cout #define pb push_back #define all(x) x.begin(), x.end() #de...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mmax(a, b, c) max(a, max(b, c)) #define mmin(a, b, c) min(a, min(b, c)) #define M 1000000007 #define V vector #define F(a, b, c) for (a = b; a <= c; ++a) #define I cin #define O cout #define pb push_back #define all(x) x.begin(), x.end() #de...
insert
33
33
33
34
-11
p03165
C++
Runtime Error
#include <algorithm> #include <functional> #include <iomanip> //! for setprecision(10) #include <iostream> #include <math.h> #include <string> #include <vector> #include <cstring> #include <limits.h> #include <map> #include <queue> #include <set> #include <utility> using namespace std; typedef long long LL; #defin...
#include <algorithm> #include <functional> #include <iomanip> //! for setprecision(10) #include <iostream> #include <math.h> #include <string> #include <vector> #include <cstring> #include <limits.h> #include <map> #include <queue> #include <set> #include <utility> using namespace std; typedef long long LL; #defin...
replace
86
87
86
87
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // T+N // #pragma GCC optimize ("O3") // #pragma GCC target ("sse4") #define endl "\n" typedef long long ll; typedef long double ld; typedef unsigned long long ull; template <class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } templat...
#include <bits/stdc++.h> using namespace std; // T+N // #pragma GCC optimize ("O3") // #pragma GCC target ("sse4") #define endl "\n" typedef long long ll; typedef long double ld; typedef unsigned long long ull; template <class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } templat...
replace
26
27
26
27
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define pb push_back typedef long long ll; typedef long double ld; int main() { // ios_base::sync_with_stdio(false); // cin.tie(NULL); ll i, j, N = 3e2 + 10; ll dp[N][N]; for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { dp[i][...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define pb push_back typedef long long ll; typedef long double ld; int main() { // ios_base::sync_with_stdio(false); // cin.tie(NULL); ll i, j, N = 3e3 + 10; ll dp[N][N]; for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { dp[i][...
replace
11
12
11
12
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; int arr[1001][1001]; int main() { string s1, s2; cin >> s1 >> s2; int n1 = s1.length(), n2 = s2.length(); for (int i = 0; i < n1 + 1; i++) { for (int j = 0; j < n2 + 1; j++) { if (i == 0 || j == 0) arr[i][j] = 0; else { ...
#include <bits/stdc++.h> #include <iostream> using namespace std; int arr[3001][3001]; int main() { string s1, s2; cin >> s1 >> s2; int n1 = s1.length(), n2 = s2.length(); for (int i = 0; i < n1 + 1; i++) { for (int j = 0; j < n2 + 1; j++) { if (i == 0 || j == 0) arr[i][j] = 0; else { ...
replace
4
5
4
5
0
p03165
C++
Runtime Error
// Abhigyan's Code: // YOU DON'T DARE TO COPY :) #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define checker cout << "CHECKED" #define modulo 1000000007 ll dp[1000][1000]; void lcs(string x, string y) { ll s1 = x.size(); ll s2 = y.size(); for (ll...
// Abhigyan's Code: // YOU DON'T DARE TO COPY :) #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define checker cout << "CHECKED" #define modulo 1000000007 ll dp[10000][10000]; void lcs(string x, string y) { ll s1 = x.size(); ll s2 = y.size(); for (...
replace
10
11
10
11
0
p03165
C++
Runtime Error
/*BINH :))*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long llu; #define IO \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
/*BINH :))*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long llu; #define IO \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
25
26
25
26
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ff first #define ss second #define pb push_back #define pf push_front #define mp make...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ff first #define ss second #define pb push_back #define pf push_front #define mp make...
replace
41
42
41
42
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define pii pair<int, int> #define f first #define s second #define p 1000000007 using namespace std; string s, t; int a[3000][3000]; int b[3000][3000]; int lcs(int i, int j) { if (i == -1 || j == -1) return 0; if (s[i] == t[j]) { b[i][j] = 1; return a[i][j] = lcs(i - 1, j - 1) ...
#include <bits/stdc++.h> #define pii pair<int, int> #define f first #define s second #define p 1000000007 using namespace std; string s, t; int a[3000][3000]; int b[3000][3000]; int lcs(int i, int j) { if (i == -1 || j == -1) return 0; if (a[i][j] != -1) return a[i][j]; if (s[i] == t[j]) { b[i][j] = 1...
insert
12
12
12
14
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
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define all(v) ((v).begin()), ((v).end()) #define sz(v) ((int)((v).size())) #define clr(v, d) memset(v, d, sizeof(v)) #define rep(i, v) for (int i = 0; i < sz(v); ++i) #define lp(i, n) for (in...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define all(v) ((v).begin()), ((v).end()) #define sz(v) ((int)((v).size())) #define clr(v, d) memset(v, d, sizeof(v)) #define rep(i, v) for (int i = 0; i < sz(v); ++i) #define lp(i, n) for (in...
replace
58
59
58
59
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vll; const ll inf = 1e18 + 7; const int maxn = 1e3 + 10; const int maxq = 5e2 + 10; const int alf = 26; const ll dlm = 1e9 + 7; const int del = 998244353; const int eps = 1e-7; int dp[maxn][maxn]; pair<int,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vll; const ll inf = 1e18 + 7; const int maxn = 3e3 + 10; const int maxq = 5e2 + 10; const int alf = 26; const ll dlm = 1e9 + 7; const int del = 998244353; const int eps = 1e-7; int dp[maxn][maxn]; pair<int,...
replace
8
9
8
9
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ld long double #define all(x) (x.begin()), (x.end()) #define sz(x) ((ll)x.size()) #define FAST_IO \ ios_base ::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); using namespace std; #ifdef L...
#include <bits/stdc++.h> #define ll long long #define ld long double #define all(x) (x.begin()), (x.end()) #define sz(x) ((ll)x.size()) #define FAST_IO \ ios_base ::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); using namespace std; #ifdef L...
replace
13
14
13
14
0
Running Time: 0.042397 s.
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
replace
51
52
51
52
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define int long long int #define endl "\n" #define pb push_back #define mp make_pair #define ff first #define ss s...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define int long long int #define endl "\n" #define pb push_back #define mp make_pair #define ff first #define ss s...
replace
53
54
53
54
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define nl '\n' #define vec vector<ll> #define pr pair<ll, ll> #define vecp vector<pr> #define pq priority_queue<ll> #define pqp priority_queue<pr> #define ff first #define ss second #define f(i, a, b) for (ll i = (ll)a; i < (ll)b;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define nl '\n' #define vec vector<ll> #define pr pair<ll, ll> #define vecp vector<pr> #define pq priority_queue<ll> #define pqp priority_queue<pr> #define ff first #define ss second #define f(i, a, b) for (ll i = (ll)a; i < (ll)b;...
replace
76
77
76
77
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ld long double #define endl "\n" #define ull unsigned long long #define ALL(v) ((v).begin()), ((v).end()) #define INCREASING(v) sort(ALL(v)) #define DECREASING(v) INCREASING(v), reverse(ALL(v)) #define SZ(v) ((int)((v).size())) #define LP(c, x, n) for (int c = x; c ...
#include <bits/stdc++.h> #define ll long long #define ld long double #define endl "\n" #define ull unsigned long long #define ALL(v) ((v).begin()), ((v).end()) #define INCREASING(v) sort(ALL(v)) #define DECREASING(v) INCREASING(v), reverse(ALL(v)) #define SZ(v) ((int)((v).size())) #define LP(c, x, n) for (int c = x; c ...
replace
24
25
24
25
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #define M 100 int m, n; int MAT[M][M]; char str1[M], str2[M]; int LCS() { for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { if (i == 0 || j == 0) {...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #define M 3001 int m, n; int MAT[M][M]; char str1[M], str2[M]; int LCS() { for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { if (i == 0 || j == 0) ...
replace
8
9
8
9
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define deb(x) cout << #x << " " << x << endl; #define foi(a, b) for (int i = a; i < b; i++) #define foj(a, b) for (int j = a; j < b; j++) #define fod(a, b) for (int i = a; i > b; i--) #define MAX 1e9 #define MIN -1e9 #define nl co...
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define deb(x) cout << #x << " " << x << endl; #define foi(a, b) for (int i = a; i < b; i++) #define foj(a, b) for (int j = a; j < b; j++) #define fod(a, b) for (int i = a; i > b; i--) #define MAX 1e9 #define MIN -1e9 #define nl co...
replace
46
48
46
48
0
p03165
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #d...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #d...
replace
40
41
40
41
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define MAX 3000 #define ll long long #define mod (1000000000 + 7) #define Fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; int T[MAX][MAX]; string L...
#include <bits/stdc++.h> #define MAX 3010 #define ll long long #define mod (1000000000 + 7) #define Fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; int T[MAX][MAX]; string L...
replace
1
2
1
2
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #define int long long #define pb push_back #define F first #define S second #define endl "\n" #define rep(i, a, b) for (int i = a; i < (int)b; i++) #define req(i, a, b) for (int i = (int)b - 1; i >= a; i--) #define all(a) (a).begin(), (a).end() #define ret(x) ...
#include <bits/stdc++.h> using namespace std; // #define int long long #define pb push_back #define F first #define S second #define endl "\n" #define rep(i, a, b) for (int i = a; i < (int)b; i++) #define req(i, a, b) for (int i = (int)b - 1; i >= a; i--) #define all(a) (a).begin(), (a).end() #define ret(x) ...
replace
84
89
84
87
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; // const ll MOD = 998244353; const ll INF = MOD * MOD; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; // const ll MOD = 998244353; const ll INF = MOD * MOD; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint...
replace
1,698
1,728
1,698
1,726
0
p03165
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define mkp make_pair #define pr(num) cout << num << "\n" #define max(a, b) ((a) > (b) ? (...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define mkp make_pair #define pr(num) cout << num << "\n" #define max(a, b) ((a) > (b) ? (...
replace
29
30
29
30
0
p03165
C++
Runtime Error
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */ #include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define all(x) x.begin(), x.en...
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */ #include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define all(x) x.begin(), x.en...
replace
35
36
35
36
0
p03165
C++
Runtime Error
/* Simplicity and Goodness */ #include <bits/stdc++.h> using namespace std; #define scn(n) scanf("%d", &n) #define lscn(n) scanf("%lld", &n) #define pri(n) printf("%d ", (int)(n)) #define prin(n) printf("%d\n", (int)(n)) #define lpri(n) printf("%lld ", n) #define lprin(n) printf("%lld\n", n) #define deb(x) cout << #x ...
/* Simplicity and Goodness */ #include <bits/stdc++.h> using namespace std; #define scn(n) scanf("%d", &n) #define lscn(n) scanf("%lld", &n) #define pri(n) printf("%d ", (int)(n)) #define prin(n) printf("%d\n", (int)(n)) #define lpri(n) printf("%lld ", n) #define lprin(n) printf("%lld\n", n) #define deb(x) cout << #x ...
replace
26
27
26
27
0
p03165
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; string lcs(string s1, string s2) { string ret; int n = s1.length(), m = s2.length(); vector<vector<int>> dp(n + 1, vector<int>(m + 1)); for (int i = 0; i < n; i++) { dp[i][0] = 0; } for (int i = 0; i < m; i++) { dp[0][...
#include <algorithm> #include <iostream> #include <vector> using namespace std; string lcs(string s1, string s2) { string ret; int n = s1.length(), m = s2.length(); vector<vector<int>> dp(n + 1, vector<int>(m + 1)); for (int i = 0; i < n; i++) { dp[i][0] = 0; } for (int i = 0; i < m; i++) { dp[0][...
replace
26
27
26
27
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; cin >> s >> t; ll dp[t.size() + 1][s.size() + 1]; for (ll i = 0; i <= s.size(); i++) dp[0][i] = 0; for (ll i = 0; i <= t.size(); i++) dp[i][0] = 0; for (l...
#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; cin >> s >> t; ll dp[t.size() + 1][s.size() + 1]; for (ll i = 0; i <= s.size(); i++) dp[0][i] = 0; for (ll i = 0; i <= t.size(); i++) dp[i][0] = 0; for (l...
replace
28
29
28
29
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fore(i, s, e) for (int i = s; i < e; i++) typedef long long ll; const int N = 3005; ll dp[N][N]; string s, t, r; ll calc(int i, int j) { if (i == s.size() || j == t.size()) return 0; ll &r = dp[i][j]; if (r != -1) return r; if (s[i] == t[j])...
#include <bits/stdc++.h> using namespace std; #define fore(i, s, e) for (int i = s; i < e; i++) typedef long long ll; const int N = 3005; ll dp[N][N]; string s, t, r; ll calc(int i, int j) { if (i == s.size() || j == t.size()) return 0; ll &r = dp[i][j]; if (r != -1) return r; if (s[i] == t[j])...
replace
33
42
33
41
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define sz(x) (int)x.size() #define yes cout << "Yes\n" #define no cout << "No\n" #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ft first #define sd second typedef pair<int, int> pii; typedef long double ld; typedef ve...
#include <bits/stdc++.h> using namespace std; #define int long long #define sz(x) (int)x.size() #define yes cout << "Yes\n" #define no cout << "No\n" #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ft first #define sd second typedef pair<int, int> pii; typedef long double ld; typedef ve...
delete
68
73
68
68
TLE
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define maxn 1005 using namespace std; char s[maxn], t[maxn], ans[maxn]; int n, m, cc, dp[maxn][maxn], px[maxn][maxn], py[maxn][maxn]; void dfs(int x, int y) { if (x == 0 && y == 0) return; int xx = px[x][y], yy = py[x][y]; if (xx < x && yy < y) ans[++cc] = s[xx]; dfs(xx, yy);...
#include <bits/stdc++.h> #define maxn 3005 using namespace std; char s[maxn], t[maxn], ans[maxn]; int n, m, cc, dp[maxn][maxn], px[maxn][maxn], py[maxn][maxn]; void dfs(int x, int y) { if (x == 0 && y == 0) return; int xx = px[x][y], yy = py[x][y]; if (xx < x && yy < y) ans[++cc] = s[xx]; dfs(xx, yy);...
replace
1
2
1
2
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef pair<ll, ll> pll; string s1, s2; int dp[3000][3000]; pii prv[3000][3000]; string ans; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> s1 >> s2; for (int i = 1; i <= s1.size(); i++) for (int...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef pair<ll, ll> pll; string s1, s2; int dp[3001][3001]; pii prv[3001][3001]; string ans; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> s1 >> s2; for (int i = 1; i <= s1.size(); i++) for (int...
replace
7
9
7
9
-11
p03165
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> //PBDS #include <ext/pb_ds/tree_policy.hpp> //PBDS #define int long long int #define vi vector<int> #define vii vector<pair<int, int>> #define pi pair<int, int> #define fast \ ios_ba...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> //PBDS #include <ext/pb_ds/tree_policy.hpp> //PBDS #define int long long int #define vi vector<int> #define vii vector<pair<int, int>> #define pi pair<int, int> #define fast \ ios_ba...
replace
42
43
42
43
0
p03165
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main(int argc, char *argv[]) { string s, t; cin >> s; cin >> t; // int dp[3003][3003]; i...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main(int argc, char *argv[]) { string s, t; cin >> s; cin >> t; int dp[3003][3003]; std...
replace
18
20
18
19
0
p03165
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define umap unordered_map #define flush fflush(stdout) #define all(v) v.begin(), v.end() #define st first #define nd second #define ln '\n' #define MAX 1000000009 #define MOD 1000000007 #define N 3005 using namespace std; typedef long long ll; typedef ...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define umap unordered_map #define flush fflush(stdout) #define all(v) v.begin(), v.end() #define st first #define nd second #define ln '\n' #define MAX 1000000009 #define MOD 1000000007 #define N 3005 using namespace std; typedef long long ll; typedef ...
replace
43
44
43
44
0
p03165
C++
Runtime Error
// ¯\_(ツ)_/¯ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define pb push_back #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).e...
// ¯\_(ツ)_/¯ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define pb push_back #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).e...
delete
20
23
20
20
0
p03165
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ln '\n'; int lim = 1e6; int inf = 1e9 + 7; ll dp[3001][3001]; pair<int, int> nextdp[3001][3001]; ll solve(int i, int j, int n1, int n2, string s1, string s2) { if (i == n1 or j == n2) { return 0; } if (dp[i][j] != -1) { return dp[...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ln '\n'; int lim = 1e6; int inf = 1e9 + 7; ll dp[3001][3001]; pair<int, int> nextdp[3001][3001]; ll solve(int i, int j, int n1, int n2, string &s1, string &s2) { if (i == n1 or j == n2) { return 0; } if (dp[i][j] != -1) { return d...
replace
8
9
8
9
TLE
p03165
C++
Runtime Error
#include "bits/stdc++.h" #include <string> using namespace std; int n1, n2; short dp[3000][3000]; char bt[3000][3000]; int main() { char a[3000], b[3000]; cin >> a; cin >> b; n1 = strlen(a); n2 = strlen(b); for (int i = 0; i <= n1; i++) { for (int j = 0; j <= n2; j++) { if (i == 0 || j == 0) {...
#include "bits/stdc++.h" #include <string> using namespace std; int n1, n2; short dp[3001][3001]; char bt[3001][3001]; int main() { char a[3000], b[3000]; cin >> a; cin >> b; n1 = strlen(a); n2 = strlen(b); for (int i = 0; i <= n1; i++) { for (int j = 0; j <= n2; j++) { if (i == 0 || j == 0) {...
replace
6
8
6
8
0
p03165
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bits/stdc++.h> #include <bitset> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <sstream> // istringstream buffer(myString); #include <stack> #include <stdio.h> #include <string> #...
#include <algorithm> #include <array> #include <assert.h> #include <bits/stdc++.h> #include <bitset> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <sstream> // istringstream buffer(myString); #include <stack> #include <stdio.h> #include <string> #...
replace
122
123
122
123
0
p03165
C++
Time Limit Exceeded
/* """Bismillahir Rahmanur Rahim""" */ #include <bits/stdc++.h> using namespace std; #define pi 2 * acos(0.0) #define ll long long int #define pb push_back #define pf push_front const ll sz = 1000001; #define ek(x) __builtin_popcount(x) #define ses '\n' #define stm istringstream #define sob(x) x.beg...
/* """Bismillahir Rahmanur Rahim""" */ #include <bits/stdc++.h> using namespace std; #define pi 2 * acos(0.0) #define ll long long int #define pb push_back #define pf push_front const ll sz = 1000001; #define ek(x) __builtin_popcount(x) #define ses '\n' #define stm istringstream #define sob(x) x.beg...
replace
33
34
33
34
TLE
p03166
C++
Time Limit Exceeded
#include "bits/stdc++.h" #pragma GCC optimize "03" using namespace std; #define int long long int #define pb push_back #define pii pair<int, int> #define fi first #define se second #define rep(i, a, b) for (int i = a; i < b; ++i) #define dbg(x) \ { cerr...
#include "bits/stdc++.h" #pragma GCC optimize "03" using namespace std; #define int long long int #define pb push_back #define pii pair<int, int> #define fi first #define se second #define rep(i, a, b) for (int i = a; i < b; ++i) #define dbg(x) \ { cerr...
replace
53
59
53
57
TLE
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb push_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #define ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb push_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #define ...
insert
133
133
133
134
TLE
p03166
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(...
insert
49
49
49
51
TLE
p03166
C++
Time Limit Exceeded
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include ...
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include ...
replace
51
52
51
52
TLE
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int f(vector<vector<int>> &E, vector<int> &dp, int s) { if (dp[s] != -1) { return dp[s]; } else { int ans = 0; for (int i = 0; i < E[s].size(); i++) { ans = max(ans, f(E, dp, E[s][i]) + 1); } return ans; } } int main() { int N, M; cin >> ...
#include <bits/stdc++.h> using namespace std; int f(vector<vector<int>> &E, vector<int> &dp, int s) { if (dp[s] != -1) { return dp[s]; } else { int ans = 0; for (int i = 0; i < E[s].size(); i++) { ans = max(ans, f(E, dp, E[s][i]) + 1); } dp[s] = ans; return ans; } } int main() { in...
insert
10
10
10
11
TLE
p03166
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int N, M; vector<int> next_verts[100000]; vector<int> longest_path_length_from_vert(100000, -1); int calc_longest_path_from(int now) { if (longest_path_length_from_vert[now] >= 0) { return longest_path_length_from_vert[now]; } if (next_verts[now].si...
#include <iostream> #include <vector> using namespace std; int N, M; vector<int> next_verts[100000]; vector<int> longest_path_length_from_vert(100000, -1); int calc_longest_path_from(int now) { if (longest_path_length_from_vert[now] >= 0) { return longest_path_length_from_vert[now]; } if (next_verts[now].si...
insert
22
22
22
23
TLE
p03166
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define FORN(i, j, k) for (int i = j; i < k; i++) #define FORR(i, j, k) for (int i = j; i >= k; i--) #...
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define FORN(i, j, k) for (int i = j; i < k; i++) #define FORR(i, j, k) for (int i = j; i >= k; i--) #...
replace
26
27
26
27
0
p03166
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX 10010 vector<int> g[MAX]; int main() { int n, m; cin >> n >> m; int in[MAX] = {0}; for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; u--; v--; in[v]++; g[u].push_back(v); } queue<int> q; int d[MAX] = {0}; for (int i =...
#include <bits/stdc++.h> using namespace std; #define MAX 100010 vector<int> g[MAX]; int main() { int n, m; cin >> n >> m; int in[MAX] = {0}; for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; u--; v--; in[v]++; g[u].push_back(v); } queue<int> q; int d[MAX] = {0}; for (int i ...
replace
2
3
2
3
0
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define forn(i, o, n) for (int i = o; i < n; i++) #define int long long // #define endl "\n" #define mod 1000000007 #define double long double #define pb p...
#include <bits/stdc++.h> // #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define forn(i, o, n) for (int i = o; i < n; i++) #define int long long // #define endl "\n" #define mod 1000000007 #define double long double #define pb p...
replace
12
13
12
13
TLE
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using VI = vector<ll>; using VV = vector<VI>; using VS = vector<string>; // tourist set template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using VI = vector<ll>; using VV = vector<VI>; using VS = vector<string>; // tourist set template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typ...
replace
220
242
220
247
TLE
p03166
C++
Runtime Error
#include <algorithm> #include <iostream> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; unordered_map<int, vector<int>> edges; vector<ll> dp(10002, 0); bool visited[10002] = {false}; ll helper(int i) { if (visited[i]) return dp[i]; // 访问过的节点,直接返回i节点的Longest Path else { ...
#include <algorithm> #include <iostream> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; unordered_map<int, vector<int>> edges; vector<ll> dp(100002, 0); bool visited[100002] = {false}; ll helper(int i) { if (visited[i]) return dp[i]; // 访问过的节点,直接返回i节点的Longest Path else ...
replace
9
11
9
11
0
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll int using namespace __gnu_pbds; using namespace std; #define mod 1000000007 #define endl "\n" #define pb push_back #define ff first #define ss second #define mp make_pair #define lb lower_bound #define f(i,...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll int using namespace __gnu_pbds; using namespace std; #define mod 1000000007 #define endl "\n" #define pb push_back #define ff first #define ss second #define mp make_pair #define lb lower_bound #define f(i,...
insert
29
29
29
30
TLE
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define pb push_back #define mp make_pair #define ff first #define ss second using namespace std; vector<vector<int>> g; vector<int> dp; int dfs(int root) { for (int i = 0; i < g[root].size(); i++) { int u = g[root][i]; int x = dfs(u...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define pb push_back #define mp make_pair #define ff first #define ss second using namespace std; vector<vector<int>> g; vector<int> dp; int dfs(int root) { if (dp[root] != -1) return dp[root]; for (int i = 0; i < g[root].size(); i++) ...
insert
11
11
11
13
TLE
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ co...
#include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ co...
replace
34
35
34
36
TLE
p03166
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long const int nax = 10010; vector<int> adj[nax]; int in_degree[nax], dist[nax]; bool vis[nax]; void dfs(int a) { vis[a] = true; for (int x : adj[a]) { dist[x] = max(dist[x], dist[a] + 1); --in_degree[x]; if (in_degree[x] == 0) dfs(x)...
#include <bits/stdc++.h> using namespace std; #define ll long long const int nax = 1e5 + 5; vector<int> adj[nax]; int in_degree[nax], dist[nax]; bool vis[nax]; void dfs(int a) { vis[a] = true; for (int x : adj[a]) { dist[x] = max(dist[x], dist[a] + 1); --in_degree[x]; if (in_degree[x] == 0) dfs(...
replace
4
5
4
5
0
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define endl '\n' #define N 1000001 #define mod 1e9 + 7 using namespace std; typedef long long ll; vector<vector<ll>> v(100001); ll dp[100001]; ll sol(ll a) { if (dp[a] != -1) return dp[a]; ll res = 0; for (ll i = 0; i < v[a].size(); i++) { res = max(res, sol(v[a][i]) + 1); } ...
#include <bits/stdc++.h> #define endl '\n' #define N 1000001 #define mod 1e9 + 7 using namespace std; typedef long long ll; vector<vector<ll>> v(100001); ll dp[100001]; ll sol(ll a) { if (dp[a] != -1) return dp[a]; ll res = 0; for (ll i = 0; i < v[a].size(); i++) { res = max(res, sol(v[a][i]) + 1); } ...
replace
15
16
15
16
TLE
p03166
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; vector<vector<int>> adj; vector<int> ans, visited; void dfs(int cur) { int amax = -1; visited[cur] = 1; for (int i : adj[cur]) { dfs(i); if (amax < ans[i]) amax = ans[i]; } ans[cur] = amax + 1; } int main() { int n, m, x, y; cin >>...
#include <iostream> #include <vector> using namespace std; vector<vector<int>> adj; vector<int> ans, visited; void dfs(int cur) { int amax = -1; visited[cur] = 1; for (int i : adj[cur]) { if (!visited[i]) dfs(i); if (amax < ans[i]) amax = ans[i]; } ans[cur] = amax + 1; } int main() { i...
replace
10
11
10
12
TLE
p03166
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef std::vector<ll> lls; constexpr ll INF = 1LL << 60; constexpr ll MOD = 998244353L; template <class T> inline void chmin(T &a, T b) { if (a > b) a = b; } template <class T> inline void chmax(T &a, T b) { if (a < b) a = b; } template <...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef std::vector<ll> lls; constexpr ll INF = 1LL << 60; constexpr ll MOD = 998244353L; template <class T> inline void chmin(T &a, T b) { if (a > b) a = b; } template <class T> inline void chmax(T &a, T b) { if (a < b) a = b; } template <...
insert
64
64
64
65
TLE
p03166
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int M = 1e3 + 3; int n, k, vis[M], ans, dp[M]; vector<int> adj[M], g[M], lf; int dfs(int u) { int &ret = dp[u]; if (ret != -1) return ret; ret = 1; for (int i : adj[u]) { ret = max(ret, dfs(i) + 1); } return ret; } int main() { scanf("%d %d",...
#include <bits/stdc++.h> using namespace std; const int M = 1e5 + 5; int n, k, vis[M], ans, dp[M]; vector<int> adj[M], g[M], lf; int dfs(int u) { int &ret = dp[u]; if (ret != -1) return ret; ret = 1; for (int i : adj[u]) { ret = max(ret, dfs(i) + 1); } return ret; } int main() { scanf("%d %d",...
replace
4
5
4
5
0
p03166
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> using namespace std; int dfs(int currentnode, vector<vector<int>> &g, unordered_set<int> visited, unordered_set<int> &currentvisit, int dp[], int &ans) { if (visited.find(currentnode) == visited.end()) // already visited this,dp array has the answer { ...
#include <bits/stdc++.h> #include <iostream> using namespace std; int dfs(int currentnode, vector<vector<int>> &g, unordered_set<int> &visited, unordered_set<int> &currentvisit, int dp[], int &ans) { if (visited.find(currentnode) == visited.end()) // already visited this,dp array has the answer { ...
replace
4
5
4
5
TLE