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++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define N (int)3e2 + 5
#define f1 first
#define s2 second
#define INF 9999999
#define pb push_back
#define ll long long
#define ull unsigned long long;
#define all(a) a.begin(), a.end()
#define fri(a) freopen(a, "r", stdin);
#define fro(a) freopen(a, "w", stdout);
string ... | #include <bits/stdc++.h>
using namespace std;
#define N (int)3e3 + 5
#define f1 first
#define s2 second
#define INF 9999999
#define pb push_back
#define ll long long
#define ull unsigned long long;
#define all(a) a.begin(), a.end()
#define fri(a) freopen(a, "r", stdin);
#define fro(a) freopen(a, "w", stdout);
string ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | // _/\\\\____________/\\\\______/\\\\\\\\\______/\\\________/\\\___/\\\\\\\\/\\____/\\\\\\\\\\_|
// _\/\\\\\\________/\\\\\\____/\\\\\\\\\\\\\___\/\\\________/\\\__\/\\\____\/\\\__\////\\\///__|
// _\/\\\//\\\____/\\\//\\\___/\\\/////////\\\__\/\\\________/\\\__\/\\\____\/\\\\____\/\\\_____|
// _\/\\\\///\\\/\\\/... | // _/\\\\____________/\\\\______/\\\\\\\\\______/\\\________/\\\___/\\\\\\\\/\\____/\\\\\\\\\\_|
// _\/\\\\\\________/\\\\\\____/\\\\\\\\\\\\\___\/\\\________/\\\__\/\\\____\/\\\__\////\\\///__|
// _\/\\\//\\\____/\\\//\\\___/\\\/////////\\\__\/\\\________/\\\__\/\\\____\/\\\\____\/\\\_____|
// _\/\\\\///\\\/\\\/... | replace | 34 | 36 | 34 | 36 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 2019
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 2019
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | replace | 36 | 37 | 36 | 37 | 0 | |
p03165 | C++ | Runtime Error | /*
lakshaygpt28
Lakshay Gupta
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vll = vector<ll>;
template <typ... | /*
lakshaygpt28
Lakshay Gupta
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vll = vector<ll>;
template <typ... | replace | 51 | 52 | 51 | 52 | 0 | |
p03165 | C++ | Runtime Error | // HTTF.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include "bits/stdc++.h"
#define YES "YES"
#define NO "NO"
#define YESNO OUT(three(solve(), YES, NO))
#define ECHO OUT(solve())
#define three(A, B, C) ((A) ? (B) : (C))
#define FOR(i, a, b) for (LL i = (a); i < (LL)(b); i++)
#define EFOR(i, a, b) f... | // HTTF.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include "bits/stdc++.h"
#define YES "YES"
#define NO "NO"
#define YESNO OUT(three(solve(), YES, NO))
#define ECHO OUT(solve())
#define three(A, B, C) ((A) ? (B) : (C))
#define FOR(i, a, b) for (LL i = (a); i < (LL)(b); i++)
#define EFOR(i, a, b) f... | replace | 80 | 86 | 80 | 82 | -11 | |
p03165 | C++ | Runtime Error | /* Dynamic Programming implementation of LCS problem */
#include <bits/stdc++.h>
using namespace std;
// Maximum string length
#define N 100
int dp[N][N];
string printLCS(string X, int m, int n) {
string s = "";
while (0 < m and 0 < n) {
if (dp[m][n] == dp[m][n - 1])
n--; // daaner tar soman hole
... | /* Dynamic Programming implementation of LCS problem */
#include <bits/stdc++.h>
using namespace std;
// Maximum string length
#define N 3000 + 1
int dp[N][N];
string printLCS(string X, int m, int n) {
string s = "";
while (0 < m and 0 < n) {
if (dp[m][n] == dp[m][n - 1])
n--; // daaner tar soman hole... | replace | 5 | 6 | 5 | 6 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <unordered_map>
#define M 1000000007
#define T 998244353
#define PI 3.142
#define ll long long
using namespace std;
int ldp[3001][3001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt"... | #include <bits/stdc++.h>
#include <unordered_map>
#define M 1000000007
#define T 998244353
#define PI 3.142
#define ll long long
using namespace std;
int ldp[3001][3001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int i, j;
for (i = 0; i < 3001; i++) {
... | delete | 14 | 19 | 14 | 14 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define quick \
ios::sync_with_stdio(false); \
cin.tie(0);
#define time cerr << (0.1 * clock()) / CLO... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define quick \
ios::sync_with_stdio(false); \
cin.tie(0);
#define time cerr << (0.1 * clock()) / CLO... | insert | 61 | 61 | 61 | 63 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
int main() {
string S, T;
cin >> S >> T;
S = " " + S;
T = " " + T;
vector<string> now(3010, ""), before(3010, "");
rep1(i, S.lengt... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
int main() {
string S, T;
cin >> S >> T;
S = " " + S;
T = " " + T;
vector<string> now(3010, ""), before(3010, "");
rep1(i, S.lengt... | replace | 28 | 29 | 28 | 30 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int n = s.length();
int m = t.length();
vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; j++) {
if (s[i - 1] == t[j - 1]) {
dp[i][j] =... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int n = s.length();
int m = t.length();
vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; j++) {
if (s[i - 1] == t[j - 1]) {
dp[i][j] =... | replace | 26 | 27 | 26 | 27 | 0 | |
p03165 | C++ | Runtime Error |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <str... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <str... | insert | 195 | 195 | 195 | 196 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll k;
int dp[3001][3001];
string final;
int lcs(string x, string y, int n, int m) {
if (n == 0 || m == 0) {
return 0;
}
if (dp[n][m] != -1) { // cout<<"here"<<endl;
return dp[n][m];
}
if (x[n - 1] == y[m - 1]) {
// final.push... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll k;
int dp[3001][3001];
string final;
int lcs(string &x, string &y, int n, int m) {
if (n == 0 || m == 0) {
return 0;
}
if (dp[n][m] != -1) { // cout<<"here"<<endl;
return dp[n][m];
}
if (x[n - 1] == y[m - 1]) {
// final.pu... | replace | 6 | 7 | 6 | 7 | TLE | |
p03165 | C++ | Runtime Error | #include <cstring>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int **dp = new int *[s2.length() + 1];
for (int i = 0; i <= s2.length(); i++) {
dp[i] = new int[s1.length()];
memset(dp[i], 0, s1.length() * sizeof(int));
}
for (int i = 1; i <=... | #include <cstring>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int **dp = new int *[s2.length() + 1];
for (int i = 0; i <= s2.length(); i++) {
dp[i] = new int[s1.length() + 1];
memset(dp[i], 0, (s1.length() + 1) * sizeof(int));
}
for (int i... | replace | 9 | 11 | 9 | 11 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
int ls = s.size();
int lt = t.size();
vector<vector<int>> dp(ls + 1, vector<int>(lt + 1));
rep(i, ls) {
rep(j, lt) {
if (s[i] == t[j]) {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
int ls = s.size();
int lt = t.size();
vector<vector<int>> dp(ls + 1, vector<int>(lt + 1));
rep(i, ls) {
rep(j, lt) {
if (s[i] == t[j]) {
... | replace | 24 | 25 | 24 | 25 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 100;
int n, W;
string a, b;
int dp[maxn], l[maxn][maxn];
stack<char> S;
int main() {
cin >> a >> b;
for (int j = 0; j < max(a.length(), b.length()); j++)
for (int i = 0; i < b.length(); i++)
l[j][i] = -1;
for (int i = 0; i < a.length()... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 100;
int n, W;
string a, b;
int dp[maxn], l[maxn][maxn];
stack<char> S;
int main() {
cin >> a >> b;
for (int j = 0; j < max(a.length(), b.length()); j++)
for (int i = 0; i < b.length(); i++)
l[j][i] = -1;
for (int i = 0; i < a.length()... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll int
const ll N = 3e3 + 5;
string s, t, dp[2][N];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> s >> t;
for (ll i = 0; i < s.size(); i++)
for (ll j = 0; j < t.size(); j++)
if (s[i] == t[j])
dp[i % 2][j + 1] = dp[!(i % 2)][j] + s[... | #include <bits/stdc++.h>
using namespace std;
#define ll int
const ll N = 3e3 + 5;
string s, t, dp[2][N];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> s >> t;
for (ll i = 0; i < s.size(); i++)
for (ll j = 0; j < t.size(); j++)
if (s[i] == t[j])
dp[i % 2][j + 1] = dp[!(i % 2)][j], dp[... | replace | 11 | 12 | 11 | 12 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
string s, t;
cin >> s >> t;
int l1 = s.length();
int l2 = t.length();
vector<vector<int>> dp(l1 + 1, vector<int>(l2 + 1, 0));
for (int i = 0; i <= l1; i++) {
for (int j = 0; j <= l2; j++) {
if (i == 0 || j == 0)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
string s, t;
cin >> s >> t;
int l1 = s.length();
int l2 = t.length();
vector<vector<int>> dp(l1 + 1, vector<int>(l2 + 1, 0));
for (int i = 0; i <= l1; i++) {
for (int j = 0; j <= l2; j++) {
if (i == 0 || j == 0)
... | replace | 24 | 25 | 24 | 25 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mp make_pair
const int N = 2e3 + 10, Max = 50 + 10;
const ll MOD = 998244353, OO = 1e14 + 2;
int dp[N][N];
string a, b;
vector<char> sol;
int solve(int i, int j) {
if (i == a.size() || j ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mp make_pair
const int N = 3e3 + 10, Max = 50 + 10;
const ll MOD = 998244353, OO = 1e14 + 2;
int dp[N][N];
string a, b;
vector<char> sol;
int solve(int i, int j) {
if (i == a.size() || j ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define X first
#define Y second
const int MAXN = 1e5 + 5;
string s, t;
int n, m;
int dp[105][105];
int main() {
cin >> s >> t;
n = s.length(), m = t.length();
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (s[i ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define X first
#define Y second
const int MAXN = 1e5 + 5;
string s, t;
int n, m;
int dp[3005][3005];
int main() {
cin >> s >> t;
n = s.length(), m = t.length();
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (s[... | replace | 9 | 10 | 9 | 10 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919;
const long long INFL = 1LL << 60;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919;
const long long INFL = 1LL << 60;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
... | replace | 22 | 23 | 22 | 23 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int dp[N][N];
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] = max(dp[i][j - 1], 1 + dp[i - 1][j - 1]);
} else... | #include <bits/stdc++.h>
using namespace std;
const int N = 10001;
int dp[N][N];
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] = max(dp[i][j - 1], 1 + dp[i - 1][j - 1]);
} els... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Memory Limit Exceeded |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <str... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <str... | replace | 195 | 196 | 195 | 196 | MLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string a, b;
int S[1001][1001];
vector<char> ans;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> a >> b;
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (a[i] == b[j]) {
S[i + 1][j + 1] = S... | #include <bits/stdc++.h>
using namespace std;
string a, b;
int S[3001][3001];
vector<char> ans;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> a >> b;
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (a[i] == b[j]) {
S[i + 1][j + 1] = S... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define int lo... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define int lo... | replace | 25 | 26 | 25 | 26 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
using namespace std;
int main(int argc, char const *argv[]) {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(N... | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t = 1;
// cin>>t;
while (t--) {
string inp1, inp2;
cin >> inp1 >> inp2;
ll n = inp1.size(), m = inp2.s... | replace | 6 | 11 | 6 | 8 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int SIZE = 1e3 + 5;
int DP[SIZE][SIZE];
char z[SIZE][SIZE];
string B = "0", A = "0", K = "0", P, Q;
void read() {
cin >> P >> Q;
A += P;
B += Q;
}
void COUNT_LCS() {
for (int i = 1; i <= A.size() - 1; i++)
for (int j = 1; j <= B.s... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int SIZE = 3e3 + 5;
int DP[SIZE][SIZE];
char z[SIZE][SIZE];
string B = "0", A = "0", K = "0", P, Q;
void read() {
cin >> P >> Q;
A += P;
B += Q;
}
void COUNT_LCS() {
for (int i = 1; i <= A.size() - 1; i++)
for (int j = 1; j <= B.s... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
string s, t;
int c[3000][3000] = {};
pair<int, int> w[3000][3000] = {};
string ans = "";
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s >> t;
c[0][0] = (s[0] == t[0]);
for (int i = 1; i < s.length(); i++) {
c[i][0] = (c[i - 1][0] ... | #include <bits/stdc++.h>
using namespace std;
string s, t;
int c[3000][3000] = {};
pair<int, int> w[3000][3000] = {};
string ans = "";
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s >> t;
c[0][0] = (s[0] == t[0]);
for (int i = 1; i < s.length(); i++) {
c[i][0] = (c[i - 1][0] ... | insert | 46 | 46 | 46 | 49 | TLE | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for (int i = n - 1; i >= 0; i--)
#define ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for (int i = n - 1; i >= 0; i--)
#define ... | replace | 73 | 74 | 73 | 74 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fore(i, init, n) for (long long i = init; i < n; i++)
#define FIN \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define fore(i, init, n) for (long long i = init; i < n; i++)
#define FIN \
ios::sync_with_stdio(0); \
cin.tie(0); ... | replace | 43 | 44 | 43 | 44 | -11 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define MAX 3000
using namespace std;
int dp[MAX + 1][MAX + 1];
string print_lcs(string &s, string &t, int len) {
string LCS = "";
int i = 0, j = 0;
while (len > 0) {
if (s[i] == t[j]) {
LCS += s[i];
i++;
j++;
len--;
} else {
if (dp[i][j + 1] > dp... | #include <bits/stdc++.h>
#define MAX 3000
using namespace std;
int dp[MAX + 1][MAX + 1];
string print_lcs(string &s, string &t, int len) {
string LCS = "";
int i = 0, j = 0;
while (len > 0) {
if (s[i] == t[j]) {
LCS += s[i];
i++;
j++;
len--;
} else {
if (dp[i][j + 1] > dp... | insert | 33 | 33 | 33 | 36 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
string s1;
string s2;
cin >> s1 >> s2;
int n = ... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
string s1;
string s2;
cin >> s1 >> s2;
int n = ... | replace | 33 | 34 | 33 | 34 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long lo... | #include <algorithm>
#include <bitset>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long lo... | replace | 61 | 62 | 61 | 62 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int recurse(int i, int j, vector<vector<int>> &dp, string s, string t) {
if (i == 0 || j == 0)
return 0;
else {
if (dp[i][j] != -1)
return dp[i][j];
else {
if (s[i - 1] == t[j - 1])
dp[i][j] = recurse(i - 1, j - 1, dp, s, t) + 1;
... | #include <bits/stdc++.h>
using namespace std;
int recurse(int i, int j, vector<vector<int>> &dp, string &s, string &t) {
if (i == 0 || j == 0)
return 0;
else {
if (dp[i][j] != -1)
return dp[i][j];
else {
if (s[i - 1] == t[j - 1])
dp[i][j] = recurse(i - 1, j - 1, dp, s, t) + 1;
... | replace | 4 | 5 | 4 | 5 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
using namespace std;
int dp[3005][3005];
int lcs(string a, string b, int n, int m) {
if (n == 0 or m == 0)
return 0;
if (dp[n][m] != -1)
return dp[n][m];
if (a[n - 1] == b[m - 1]) {
return dp[n][m] = 1 + lcs(a, b, n - 1, m - 1);
}
int x = lcs(a, b, ... | #include <bits/stdc++.h>
#define int long long
using namespace std;
int dp[3005][3005];
int lcs(string &a, string &b, int n, int m) {
if (n == 0 or m == 0)
return 0;
if (dp[n][m] != -1)
return dp[n][m];
if (a[n - 1] == b[m - 1]) {
return dp[n][m] = 1 + lcs(a, b, n - 1, m - 1);
}
int x = lcs(a, b... | replace | 6 | 7 | 6 | 7 | TLE | |
p03165 | C++ | Runtime Error | /*
@author: @sancodemonster
*/
#include <bits/stdc++.h>
#define flash ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define endl '\n'
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f(i, a, b) for (long long i = a; i < b; i++)
... | /*
@author: @sancodemonster
*/
#include <bits/stdc++.h>
#define flash ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define endl '\n'
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f(i, a, b) for (long long i = a; i < b; i++)
... | delete | 82 | 86 | 82 | 82 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Int int32_t
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pii pair<int, int>
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bitcnt(n) __builtin_popcountl... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Int int32_t
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pii pair<int, int>
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bitcnt(n) __builtin_popcountl... | replace | 48 | 49 | 48 | 49 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = ... | replace | 35 | 36 | 35 | 36 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int llu;
int dp[100][100];
/* Memoized LCS
int lcs(string a,string b,int n,int m){
if(n==0 || m==0){
return 0;
}
if(dp[n][m]!= (-1)){
return dp[n][m];
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int llu;
int dp[3001][3001];
/* Memoized LCS
int lcs(string a,string b,int n,int m){
if(n==0 || m==0){
return 0;
}
if(dp[n][m]!= (-1)){
return dp[n][m];
}... | replace | 6 | 7 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, m) for (long long i = 0; i < m; i++)
#define per(i, m) for (long long i = m - 1; i >= 0; i--)
#define FOR(i, n, m) for (long long i = n; i < m; i++)
#define ROF(i, n, m) for (long long i = m - 1; i >= n; i--)
#define SORT(v, n) ... | #include <bits/stdc++.h>
#define rep(i, m) for (long long i = 0; i < m; i++)
#define per(i, m) for (long long i = m - 1; i >= 0; i--)
#define FOR(i, n, m) for (long long i = n; i < m; i++)
#define ROF(i, n, m) for (long long i = m - 1; i >= n; i--)
#define SORT(v, n) ... | replace | 196 | 197 | 196 | 197 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, d;
cin >> s >> d;
char c[1010];
int p = s.size();
int q = d.size();
int dp[p + 2][q + 2];
for (int i = 0; i <= p; i++) {
for (int j = 0; j <= q; j++) {
if (i == 0 || j == 0) {
dp[i][j] = 0;
} else if (s[i - 1]... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, d;
cin >> s >> d;
char c[3010];
int p = s.size();
int q = d.size();
int dp[p + 2][q + 2];
for (int i = 0; i <= p; i++) {
for (int j = 0; j <= q; j++) {
if (i == 0 || j == 0) {
dp[i][j] = 0;
} else if (s[i - 1]... | replace | 6 | 7 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
const int maxn = 3010;
int dp[maxn][maxn];
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < 3010; i++) {
dp[i][0] = 0;
dp[0][i] = 0;
}
for (int i = 1; i <= s.size(); i++) {
for (int j = 1; j <= t.size(); j++) {
i... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
const int maxn = 3010;
int dp[maxn][maxn];
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < 3010; i++) {
dp[i][0] = 0;
dp[0][i] = 0;
}
for (int i = 1; i <= s.size(); i++) {
for (int j = 1; j <= t.size(); j++) {
i... | replace | 24 | 25 | 24 | 25 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
char DIR[3000][3000];
void printLCS(int l1, int l2, string str) {
if (l1 == 0 || l2 == 0) {
return;
}
if (DIR[l1][l2] == 'A') {
printLCS(l1 - 1, l2 - 1, str);
cout << str[l1 - 1];
} else if (DIR[l1][l2] == 'U') {
printLCS(l1 - 1, l2, str);
} els... | #include <bits/stdc++.h>
using namespace std;
char DIR[3005][3005];
void printLCS(int l1, int l2, string str) {
if (l1 == 0 || l2 == 0) {
return;
}
if (DIR[l1][l2] == 'A') {
printLCS(l1 - 1, l2 - 1, str);
cout << str[l1 - 1];
} else if (DIR[l1][l2] == 'U') {
printLCS(l1 - 1, l2, str);
} els... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string a, b;
long long n, m;
const long long N = 1e3 + 10;
long long dp[N][N];
long long dfs(long long x, long long y) {
if (x >= n)
return 0;
if (y >= m)
return 0;
if (dp[x][y] != -1)
return dp[x][y];
long long choice1 = 0;
long long choice2 = 0;
... | #include <bits/stdc++.h>
using namespace std;
string a, b;
long long n, m;
const long long N = 3e3 + 10;
long long dp[N][N];
long long dfs(long long x, long long y) {
if (x >= n)
return 0;
if (y >= m)
return 0;
if (dp[x][y] != -1)
return dp[x][y];
long long choice1 = 0;
long long choice2 = 0;
... | replace | 6 | 7 | 6 | 7 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MAX_N = 3000;
const int MAX_M = 3000;
void LCS(string s, string t) {
vector<vector<ll>> dp(MAX_N, vector<ll>(MAX_M));
vector<vector<pair<int, int>>> root(MAX_N, vector<pair<int, int>>(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MAX_N = 3000;
const int MAX_M = 3000;
void LCS(string s, string t) {
vector<vector<ll>> dp(MAX_N + 1, vector<ll>(MAX_M + 1));
vector<vector<pair<int, int>>> root(MAX_N + 1,
... | replace | 8 | 10 | 8 | 11 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03165 | C++ | Runtime Error | /*
Author : Simanta Deb Turja
*/
#include <bits/stdc++.h>
using namespace std;
#define Professor
using ll = long long;
using i64 = unsigned long long;
template <typename T> inline T Min(T a, T b, T c) { return min(a, min(b, c)); }
template <typename T> inline T Min(T a, T b, T c, T d) {
return min(a, min(b, mi... | /*
Author : Simanta Deb Turja
*/
#include <bits/stdc++.h>
using namespace std;
#define Professor
using ll = long long;
using i64 = unsigned long long;
template <typename T> inline T Min(T a, T b, T c) { return min(a, min(b, c)); }
template <typename T> inline T Min(T a, T b, T c, T d) {
return min(a, min(b, mi... | replace | 77 | 78 | 77 | 79 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1010;
string s1, s2;
int n, m;
int dp[N + 7][N + 7], dir[N + 7][N + 7];
int solve(int i, int j) {
if (i >= n || j >= m)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int ret1 = 0, ret2 = 0, ret3 = 0;
if (s1[i] == s2[j]) {
ret1 = solve(i + ... | #include <bits/stdc++.h>
using namespace std;
const int N = 3010;
string s1, s2;
int n, m;
int dp[N + 7][N + 7], dir[N + 7][N + 7];
int solve(int i, int j) {
if (i >= n || j >= m)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int ret1 = 0, ret2 = 0, ret3 = 0;
if (s1[i] == s2[j]) {
ret1 = solve(i + ... | replace | 2 | 3 | 2 | 3 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
using namesp... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
using namesp... | insert | 25 | 25 | 25 | 27 | 0 | |
p03165 | C++ | Runtime Error | // #pragma GCC optimize("03")
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define mod 1000000007
using namespace std;
int n, m;
int dp[3010][3010];
string a, b;
vector<char> sol;
ll getsum(int l, int r) { return dp[r] - dp[l - 1]; }
int main() {
// ifstream cin("tst.in");
//... | // #pragma GCC optimize("03")
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define mod 1000000007
using namespace std;
int n, m;
int dp[3010][3010];
string a, b;
vector<char> sol;
ll getsum(int l, int r) { return dp[r] - dp[l - 1]; }
int main() {
// ifstream cin("tst.in");
//... | replace | 36 | 37 | 36 | 37 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define ios \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define ios \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 32 | 33 | 32 | 33 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i, a, b) for (ll i = ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i, a, b) for (ll i = ... | replace | 48 | 49 | 48 | 49 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
int s_len = s.length(), t_len = t.length();
int dp[305][305];
for (int i = 0; i <= s_len; i++) {
for (int j = 0; j <= t_len; j++... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
int s_len = s.length(), t_len = t.length();
int dp[3005][3005];
for (int i = 0; i <= s_len; i++) {
for (int j = 0; j <= t_len; j... | replace | 13 | 14 | 13 | 14 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <string>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update> #define ordered_multiset
// tree<int,... | #include <bits/stdc++.h>
#include <string>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update> #define ordered_multiset
// tree<int,... | replace | 49 | 50 | 49 | 51 | -11 | |
p03165 | C++ | Runtime Error | #include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define double long double
#define int long long
#define pb push_back
#define Z(c) (int)(c).size()
#define L(c) c[Z(c) - 1]
#define F first
#define S second
#define nl "\n"
#define mii map<int, int>
#defi... | #include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define double long double
#define int long long
#define pb push_back
#define Z(c) (int)(c).size()
#define L(c) c[Z(c) - 1]
#define F first
#define S second
#define nl "\n"
#define mii map<int, int>
#defi... | replace | 58 | 59 | 58 | 59 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
#define FOR(i, a, b) for (ll i = (a); i < (b); (i)++)
#define DBG 1
#define TR(X) \
({ ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
#define FOR(i, a, b) for (ll i = (a); i < (b); (i)++)
#define DBG 0
#define TR(X) \
({ ... | replace | 10 | 11 | 10 | 11 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1e3 + 10;
int dp[N][N], al, bl, r, c;
string a, b;
vector<char> ans;
int main() {
cin >> a >> b;
al = a.length();
bl = b.length();
for (int i = 1; i <= al; i++) {
for (int j = 1; j <= bl; j++) {
if (a[i] == b[j])
dp[i][j] = ma... | #include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1e3 + 10;
int dp[N][N], al, bl, r, c;
string a, b;
vector<char> ans;
int main() {
cin >> a >> b;
al = a.length();
bl = b.length();
for (int i = 1; i <= al; i++) {
for (int j = 1; j <= bl; j++) {
if (a[i - 1] == b[j - 1])
dp[i]... | replace | 16 | 17 | 16 | 17 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln "\n"
#define pb push_back
#define pll pair<ll, ll>
#define ppll pair<ll, pll>
#define vll vector<ll>
#define vpll vector<pll>
#define vvll vector<vector<ll>>
#define sll stack<ll>
#define qll queue<ll>
#define mp make_pair
#define f first
#de... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln "\n"
#define pb push_back
#define pll pair<ll, ll>
#define ppll pair<ll, pll>
#define vll vector<ll>
#define vpll vector<pll>
#define vvll vector<vector<ll>>
#define sll stack<ll>
#define qll queue<ll>
#define mp make_pair
#define f first
#de... | replace | 48 | 58 | 48 | 57 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
string ch, ch1;
int n, m, dp[4000][4000];
int lcs(int i, int j) {
if (i == n || j == m)
return 0;
int x, y;
if (ch[i] == ch1[j])
return dp[i][j] = 1 + lcs(i + 1, j + 1);
x = lcs(i + 1, j);
y = lcs(i, j + 1);
return dp[i][j] = max(x, y);
}
int main() {
... | #include <bits/stdc++.h>
using namespace std;
string ch, ch1;
int n, m, dp[4000][4000];
int lcs(int i, int j) {
if (i == n || j == m)
return 0;
if (dp[i][j] != -1)
return dp[i][j];
int x, y;
if (ch[i] == ch1[j])
return dp[i][j] = 1 + lcs(i + 1, j + 1);
x = lcs(i + 1, j);
y = lcs(i, j + 1);
ret... | insert | 7 | 7 | 7 | 9 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define fi first
#define se second
const int N = 3030;
const long long mod = 1e9 + 9;
using namespace std;
string s, t;
int d[N][N];
int p[N][N];
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
cin >> s >> t;
... | #include <bits/stdc++.h>
#define fi first
#define se second
const int N = 3030;
const long long mod = 1e9 + 9;
using namespace std;
string s, t;
int d[N][N];
int p[N][N];
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
cin >> s >> t;
... | replace | 36 | 37 | 36 | 37 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(n) \
for (int i = 0; i < n; i++) \
;
#define FI(n) \
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(n) \
for (int i = 0; i < n; i++) \
;
#define FI(n) \
... | delete | 18 | 23 | 18 | 18 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define pb push_back
#define pp pair<int, int>
#define rep(i, l, r) for (int i = l; i < r; i++)
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt.txt", "r", stdin);
freopen(... | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define pb push_back
#define pp pair<int, int>
#define rep(i, l, r) for (int i = l; i < r; i++)
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt.txt","r",stdin);
//... | replace | 10 | 14 | 10 | 14 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[3010][3010];
int main() {
int dp[1010][1010];
string S, T;
cin >> S;
cin >> T;
memset(dp, 0, sizeof(dp));
for (int i = 0; i < S.size(); i++) {
for (int j = 0; j < T.size(); j++) {
if (S[i] == T[j])
dp[i + 1][j + 1] = dp[i][j] + 1;
... | #include <bits/stdc++.h>
using namespace std;
int dp[3010][3010];
int main() {
string S, T;
cin >> S;
cin >> T;
memset(dp, 0, sizeof(dp));
for (int i = 0; i < S.size(); i++) {
for (int j = 0; j < T.size(); j++) {
if (S[i] == T[j])
dp[i + 1][j + 1] = dp[i][j] + 1;
dp[i + 1][j + 1] = ma... | delete | 5 | 6 | 5 | 5 | 0 | |
p03165 | C++ | Runtime Error | #include "bits/stdc++.h"
using ll = long long;
using namespace std;
// 0 -> a-1
#define rep(i, a) for (int i = 0; (i) < (int)(a); (i)++)
// a -> b-1
#define reps(i, a, b) for (int i = (int)(a); (i) < (int)(b); (i)++)
// a-1 -> 0
#define rrep(i, a) for (int i = (int)a - 1; (i) >= 0; (i)--)
// a-1 -> b
#define rreps(i... | #include "bits/stdc++.h"
using ll = long long;
using namespace std;
// 0 -> a-1
#define rep(i, a) for (int i = 0; (i) < (int)(a); (i)++)
// a -> b-1
#define reps(i, a, b) for (int i = (int)(a); (i) < (int)(b); (i)++)
// a-1 -> 0
#define rrep(i, a) for (int i = (int)a - 1; (i) >= 0; (i)--)
// a-1 -> b
#define rreps(i... | insert | 116 | 116 | 116 | 119 | -6 | fd82defb-768c-4af5-b06e-5601a0b7c94b.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03165/C++/s909525431.cpp:118: void init(): Assertion `res.length() == dp[l[0]][l[1]]' failed.
|
p03165 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define FOR(i, a, b) f... | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define FOR(i, a, b) f... | replace | 42 | 43 | 42 | 43 | TLE | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
void print_err() { cerr << "\n"; }
template <class T, class... Arg> void print_err(T x, Arg &&...args) {
cerr << x << " ";
print_err(args...);
}
template <class T> void print_container(T &cont) {
for (auto iter : cont) {
cerr << iter << " ";
}
cerr << "\n";
}
... | #include <bits/stdc++.h>
using namespace std;
void print_err() { cerr << "\n"; }
template <class T, class... Arg> void print_err(T x, Arg &&...args) {
cerr << x << " ";
print_err(args...);
}
template <class T> void print_container(T &cont) {
for (auto iter : cont) {
cerr << iter << " ";
}
cerr << "\n";
}
... | replace | 71 | 72 | 71 | 72 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define int long long
#define MOD 998244353
using namespace std;
int32_t main() {
string a, b;
cin >> a >> b;
int m = a.length();
int n = b.length();
int dp[300][300] = {0};
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (a[i - 1] == ... | #include <bits/stdc++.h>
#define pb push_back
#define int long long
#define MOD 998244353
using namespace std;
int32_t main() {
string a, b;
cin >> a >> b;
int m = a.length();
int n = b.length();
int dp[3001][3001] = {0};
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (a[i - 1] =... | replace | 10 | 11 | 10 | 11 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long dp[3005][3005];
int main() {
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
for (int i = 1; i <= n; i++)
for (int j... | #include <bits/stdc++.h>
using namespace std;
long long dp[3005][3005];
int main() {
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
for (int i = 1; i <= n; i++)
for (int j... | replace | 27 | 28 | 27 | 28 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long int
using namespace std;
int main() {
string a, b;
cin >> a >> b;
ll aa, bb;
// cout<<1;
aa = a.size();
bb = b.size();
// cout<<2;
vector<vector<ll>> a... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long int
using namespace std;
int main() {
string a, b;
cin >> a >> b;
ll aa, bb;
// cout<<1;
aa = a.size();
bb = b.size();
// cout<<2;
vector<vector<ll>> a... | insert | 36 | 36 | 36 | 38 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define LL long long
using namespace std;
int dp[1005][1005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
memset(dp, 0, sizeof(dp));
string s, t;
cin >> s;
cin >> t;
for (int i = 0; i <= s.size(); ++i)
for (int j = 0; j <= t.size(); ++j) {
... | #include <bits/stdc++.h>
#define LL long long
using namespace std;
int dp[3005][3005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
memset(dp, 0, sizeof(dp));
string s, t;
cin >> s;
cin >> t;
for (int i = 0; i <= s.size(); ++i)
for (int j = 0; j <= t.size(); ++j) {
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int N = 1e5;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
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.si... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int N = 1e5;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
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.si... | replace | 28 | 29 | 28 | 29 | 0 | |
p03165 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
// define maximum possible length of string X and Y
#define MAX 20
// lookup[i][j] stores the length of LCS of substring X[0..i-1], Y[0..j-1]
int lookup[MAX][MAX];
// Recursive Function to find Longest Common Subsequence of
// string X[0..m-1] and Y[0..n-1]
... | #include <iostream>
#include <string>
using namespace std;
// define maximum possible length of string X and Y
#define MAX 3005
// lookup[i][j] stores the length of LCS of substring X[0..i-1], Y[0..j-1]
int lookup[MAX][MAX];
// Recursive Function to find Longest Common Subsequence of
// string X[0..m-1] and Y[0..n-1... | replace | 5 | 6 | 5 | 6 | 0 | |
p03165 | C++ | Runtime Error | // Main maut ko takiya, aur kafan ko chaadar banakar audhta hoon!
#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;
using ll = long long;
using ld = long double;
#d... | // Main maut ko takiya, aur kafan ko chaadar banakar audhta hoon!
#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;
using ll = long long;
using ld = long double;
#d... | replace | 167 | 172 | 167 | 172 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
#define forr(i, m, n) for (int i = (m); i <= (n); i++)
#define DBG 0
#define MAXN 3001
string z[MAXN][MAXN];
int main() {
size_t ns, nt;
int cnt;
string s, t, str;
cin >> s >> t;
ns = s.size();
nt = t.size();
if (DBG) {
cout << "s:" << s << " t:" << t << " ns... | #include <iostream>
using namespace std;
#define forr(i, m, n) for (int i = (m); i <= (n); i++)
#define DBG 0
#define MAXN 3001
string z[MAXN][MAXN];
int main() {
size_t ns, nt;
int cnt;
string s, t, str;
cin >> s >> t;
ns = s.size();
nt = t.size();
if (DBG) {
cout << "s:" << s << " t:" << t << " ns... | replace | 27 | 32 | 27 | 37 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define ii pair<int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll, ll>
#define vv vector
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLI... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define ii pair<int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll, ll>
#define vv vector
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLI... | replace | 43 | 44 | 43 | 44 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string a, b;
cin >> a >> b;
ll i, j, m = a.length(), n = ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string a, b;
cin >> a >> b;
ll i, j, m = a.length(), n = b.length();
int dp[m + 1][n + 1];
memset(dp, 0, sizeof dp);
for (i = 1; i <= m; i++) {
for (j... | delete | 6 | 11 | 6 | 6 | 0 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
s = " " + s;
t = " " + t;
int dp[110][110] = {0};
for (int y = 0; y < (int)s.size(); y++) {
for (int x = 0; x < (int)t.size()... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
s = " " + s;
t = " " + t;
int dp[3010][3010] = {0};
for (int y = 0; y < (int)s.size(); y++) {
for (int x = 0; x < (int)t.size... | replace | 13 | 14 | 13 | 14 | 0 | |
p03165 | C++ | Runtime Error |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int>>
#define fin(ar, k, n) \
for (int i = k; i < n; i++) ... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int>>
#define fin(ar, k, n) \
for (int i = k; i < n; i++) ... | replace | 28 | 29 | 28 | 29 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;
#define forn(i, n) for (int i = 0; i < n; i++)
#define mp makepair
#define pb push_back
string s, t;
string ans;
int main() {
cin >> ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;
#define forn(i, n) for (int i = 0; i < n; i++)
#define mp makepair
#define pb push_back
string s, t;
string ans;
int main() {
cin >> ... | replace | 18 | 19 | 18 | 19 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define fastread \
std::ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define endl '\n'
#define pb push... | #include <bits/stdc++.h>
#define fastread \
std::ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define endl '\n'
#define pb push... | replace | 38 | 43 | 38 | 43 | TLE | |
p03165 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n; i >= 0; i--)
#define REP(i, s, t) for (int i = s; i <= t; i++)
#define RREP(i, s, t) for (int i = s; i >= t; i--)
#define dump(x) cerr << #x << " = " << (x) << endl;
#d... | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n; i >= 0; i--)
#define REP(i, s, t) for (int i = s; i <= t; i++)
#define RREP(i, s, t) for (int i = s; i >= t; i--)
#define dump(x) cerr << #x << " = " << (x) << endl;
#d... | replace | 29 | 30 | 29 | 30 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s1;
cin >> s1;
string s2;
cin >> s2;
int n = s1.size();
int m = s2.size();
int dp[n + 1][n + 1];
memset(dp, 0, sizeof(dp));
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if (i == 0 || j == 0)
d... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s1;
cin >> s1;
string s2;
cin >> s2;
int n = s1.size();
int m = s2.size();
vector<vector<int>> dp;
for (int i = 0; i < s1.size() + 1; i++) {
vector<int> temp;
for (int j = 0; j < s2.size() + 1; j++)
temp.push_back(0)... | replace | 13 | 15 | 13 | 20 | 0 | |
p03165 | C++ | Time Limit Exceeded | /* Author- Abhijeet Trigunait */
#include <bits/stdc++.h>
#define lld long long int
#define F first
#define S second
#define P pair<int, int>
#define pb push_back
#define mod 1e9 + 7
#define setbits(x) __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define gcd(x, y) __gcd(x, y)
#define endl '\n'
using... | /* Author- Abhijeet Trigunait */
#include <bits/stdc++.h>
#define lld long long int
#define F first
#define S second
#define P pair<int, int>
#define pb push_back
#define mod 1e9 + 7
#define setbits(x) __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define gcd(x, y) __gcd(x, y)
#define endl '\n'
using... | replace | 36 | 37 | 36 | 37 | TLE | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long n, m, w[100000], v[1000000], kq = -5;
long long f[5000][5000];
string s, t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> s >> t;
s = ' ' + s;
t = ' ' + t;
for (long i = 1; i < s.size(); i++) {
for (long j = 1; j < t.s... | #include <bits/stdc++.h>
using namespace std;
long n, m, w[100000], v[1000000], kq = -5;
long long f[5000][5000];
string s, t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> s >> t;
s = ' ' + s;
t = ' ' + t;
for (long i = 1; i < s.size(); i++) {
for (long j = 1; j < t.s... | insert | 28 | 28 | 28 | 29 | -11 | |
p03165 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered... | insert | 134 | 134 | 134 | 136 | 0 | |
p03165 | C++ | Runtime Error | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#incl... | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#incl... | replace | 94 | 95 | 94 | 95 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace __gnu_pbds;
#define fr(i, j, n) for (long long i = j; i < (n); ++i)
#define bk(i, j, n) for (long long i = j; i >= n; --i)
#define pb push_... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace __gnu_pbds;
#define fr(i, j, n) for (long long i = j; i < (n); ++i)
#define bk(i, j, n) for (long long i = j; i >= n; --i)
#define pb push_... | replace | 73 | 74 | 73 | 74 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
// #pragma GCC optimize ("O3")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pii pair<int, int>
#define point pair<double, double>
#define segment pair<point, point>
#define circle pair<point, double> // titik pusat, radius
#define li... | #include <bits/stdc++.h>
// #pragma GCC optimize ("O3")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pii pair<int, int>
#define point pair<double, double>
#define segment pair<point, point>
#define circle pair<point, double> // titik pusat, radius
#define li... | replace | 164 | 165 | 164 | 165 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
int main() {
string s, t;
int m, n;
cin >> s >> t;
m = s.size();
n = t.size();
int dp[m + 1][n + 1][2]; // last [2] here 0 stores value and 1 will store from
// the valve came
// 1 if it came from diagona... | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
int main() {
string s, t;
int m, n;
cin >> s >> t;
m = s.size();
n = t.size();
int dp[m + 1][n + 1][2]; // last [2] here 0 stores value and 1 will store from
// the valve came
// 1 if it came from diagona... | insert | 55 | 55 | 55 | 57 | 0 | |
p03165 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define F first
#define S second
#define pb push_back
#define ld long double
ll mod = 1000000007;
string ans;
ll func1(vector<vector<pll>> &dp, string s, string t, int a, int b) {
if (a == 0 || b == 0)
return 0;
if (dp... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define F first
#define S second
#define pb push_back
#define ld long double
ll mod = 1000000007;
string ans;
ll func1(vector<vector<pll>> &dp, string &s, string &t, int a, int b) {
if (a == 0 || b == 0)
return 0;
if (... | replace | 12 | 13 | 12 | 13 | TLE | |
p03165 | C++ | Time Limit Exceeded | /******************************************
* AUTHOR : RAJAGOPALAN *
* NICK : ARNO *
* INSTITUTION : VIT *
******************************************/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ... | /******************************************
* AUTHOR : RAJAGOPALAN *
* NICK : ARNO *
* INSTITUTION : VIT *
******************************************/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ... | replace | 57 | 58 | 57 | 85 | TLE | |
p03165 | C++ | Runtime Error | /*
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |// '.
/ \\||| : |||// \
/ _||||| -:- |||||- \
... | /*
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |// '.
/ \\||| : |||// \
/ _||||| -:- |||||- \
... | replace | 135 | 138 | 135 | 138 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define int long long int
#define pb push_back
#define fi(n) for (int i = 0; i < n; i++)
#define fi1(n) for (int i = 1; i < n; i++)
#define fj(n) for (int j = 0; j < n; j++)
#define fj1(n) for (int j = 1; j < n; j++)
#define rep(z, a, n) for (z = a; z < ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define int long long int
#define pb push_back
#define fi(n) for (int i = 0; i < n; i++)
#define fi1(n) for (int i = 1; i < n; i++)
#define fj(n) for (int j = 0; j < n; j++)
#define fj1(n) for (int j = 1; j < n; j++)
#define rep(z, a, n) for (z = a; z < ... | delete | 64 | 67 | 64 | 64 | 0 | |
p03165 | C++ | Runtime Error | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define N 3000
int flag[N][N], dp[N][N];
char s1[N], s2[N];
void LCS() {
memset(dp, 0, sizeof(dp));
memset(flag, 0, sizeof(flag));
int n = strlen(s1), m = strlen(s2);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++) {
... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define N 3001
int flag[N][N], dp[N][N];
char s1[N], s2[N];
void LCS() {
memset(dp, 0, sizeof(dp));
memset(flag, 0, sizeof(flag));
int n = strlen(s1), m = strlen(s2);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++) {
... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dp[3400][3400];
int main() {
string s, t;
getline(cin, s);
getline(cin, t);
if (s.size() < t.size())
s.swap(t);
for (int i = 0; i < s.size() + 1; ++i) {
for (int j = 0; j < t.size() + 1; ++j) {
if (i == 0 || j == 0) {
dp[i][j] = 0;
... | #include <bits/stdc++.h>
using namespace std;
int dp[3400][3400];
int main() {
string s, t;
getline(cin, s);
getline(cin, t);
if (s.size() < t.size())
s.swap(t);
for (int i = 0; i < s.size() + 1; ++i) {
for (int j = 0; j < t.size() + 1; ++j) {
if (i == 0 || j == 0) {
dp[i][j] = 0;
... | replace | 28 | 29 | 28 | 29 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int dp[1001][1001];
int lcs(string a, string b, int m, int n) {
if (m == 0 || n == 0)
return 0;
if (dp[m][n] != -1)
return dp[m][n];
if (a[m - 1] == b[n - 1])
return dp[m][n] = 1 + lcs(a, b, m - 1, n - 1);
return dp[m][n] = max(lcs(a, b... | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int dp[3001][3001];
int lcs(string a, string b, int m, int n) {
if (m == 0 || n == 0)
return 0;
if (dp[m][n] != -1)
return dp[m][n];
if (a[m - 1] == b[n - 1])
return dp[m][n] = 1 + lcs(a, b, m - 1, n - 1);
return dp[m][n] = max(lcs(a, b... | replace | 3 | 4 | 3 | 4 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define INF (1 << 29)
#define MAX_N 1000010
/* ちゃんと考えてわかって実装 */
int main(void) {
string s, t;
cin >> s >> t;
int dp[3000][3000];
for (int i = 0; i <= s.size(); i++)
dp[0][i] = 0;
for (int i = 0; i <= t.size(); i++... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define INF (1 << 29)
#define MAX_N 1000010
/* ちゃんと考えてわかって実装 */
int main(void) {
string s, t;
cin >> s >> t;
int dp[3001][3001];
for (int i = 0; i <= s.size(); i++)
dp[0][i] = 0;
for (int i = 0; i <= t.size(); i++... | replace | 12 | 13 | 12 | 13 | -11 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int lookup[20][20];
string str = "";
void LCS(string p, string q, int m, int n) {
if (m == 0 || n == 0)
return;
if (p[m - 1] == q[n - 1]) {
str += p[m - 1];
return LCS(p, q, m - 1, n - 1);
}
if (lookup[m - 1][n] > lookup[m][n - 1])
return LCS(p,... | #include <bits/stdc++.h>
using namespace std;
int lookup[3005][3005];
string str = "";
void LCS(string p, string q, int m, int n) {
if (m == 0 || n == 0)
return;
if (p[m - 1] == q[n - 1]) {
str += p[m - 1];
return LCS(p, q, m - 1, n - 1);
}
if (lookup[m - 1][n] > lookup[m][n - 1])
return LC... | replace | 4 | 5 | 4 | 5 | 0 | |
p03165 | C++ | Runtime Error | #define ll long long int
#include <bits/stdc++.h>
// #include <fstream>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf push_front
#define vi vector<ll>
#define pii pair<ll, ll>
#define qi queue<ll>
#define mem(a, b) memset(a, b, sizeof(a))
#define print(a) ... | #define ll long long int
#include <bits/stdc++.h>
// #include <fstream>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf push_front
#define vi vector<ll>
#define pii pair<ll, ll>
#define qi queue<ll>
#define mem(a, b) memset(a, b, sizeof(a))
#define print(a) ... | replace | 118 | 119 | 118 | 122 | 0 |
Time elapsed: 34ms
|
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve() {
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int arr[n + 1][m + 1];
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if ((i == 0) || (j == 0))
arr[i]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve() {
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int arr[n + 1][m + 1];
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
if ((i == 0) || (j == 0))
arr[i]... | delete | 49 | 55 | 49 | 49 | 0 | |
p03165 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie... | replace | 9 | 10 | 9 | 10 | 0 | |
p03165 | C++ | Time Limit Exceeded | /***********************************
*******AUTHOR SHASHI KANT **********
****GMAIL Shshiksnt140895@gmail.com*
************************************
***********************************/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
/*class graph
{
map<int,list<int>>adj;
public :
... | /***********************************
*******AUTHOR SHASHI KANT **********
****GMAIL Shshiksnt140895@gmail.com*
************************************
***********************************/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
/*class graph
{
map<int,list<int>>adj;
public :
... | replace | 42 | 43 | 42 | 43 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.