submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s923681223 | p02235 | C++ | #include<bits/stdc++.h>
using namespace std;
int lcs(string s1,string s2){
int c[s1+1][s2+1];
int m=s1.size(),n=s2.size();
int mx=0;
s1=' '+s1;
s2=' '+s2;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(s1[i]==s2[j]){
c[i][j]=c[i-1][j-1]+1;
}else{
c[i][j]=max(c[i-1][j],c[i][j-1]);
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:5:11: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
5 | int c[s1+1][s2+1];
| ~~^~
| | |
| | int
| std::string {aka std::__cxx... |
s245495989 | p02235 | C++ | import sys
def dp_init(m, n):
return [[0] * n] * m
def solve(str_a, str_b):
dp = dp_init(len(str_a), len(str_b))
return rec(len(str_a), len(str_b), str_a, str_b, dp)
def rec(i, j, str_a, str_b, dp):
if i == 0 or j == 0:
return 0
if dp[i][j] > 0:
return dp[i][j]
if str_a[i-1] =... | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s160243445 | p02235 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y)
{
int c[N + 1][N + 1];
int m = X.size;
int n = Y.size;
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 0; i <= m; i++)c[i][0] = 0;
for (int j = 1; j <= n; j++)c[0][j] ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:13:19: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} ... |
s172104535 | p02235 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, p[N + 1], m[N + 1][N + 1];
cin >> n;
for (int i = 1; i <= n; i++) cin >> p[i - 1] >> p[i];
for (int i = 1; i <= n; i++) m[i][i] = 0;
for (int l = 2; l <= n; l++)
{
for (int i = 1; i <= n; i++)
{
int j = i + l - 1;
m[i][j... | a.cc: In function 'int main()':
a.cc:7:18: error: 'N' was not declared in this scope
7 | int n, p[N + 1], m[N + 1][N + 1];
| ^
a.cc:9:45: error: 'p' was not declared in this scope
9 | for (int i = 1; i <= n; i++) cin >> p[i - 1] >> p[i];
| ... |
s717838813 | p02235 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int q; cin >> q;
string A, B; cin >> A >> B;
for (int i=0; i<q; i++) {
vector<vector<int>> LCS(A.length()+1, vector<int>(B.length()+1,0));
for (int j=1; j<=A.length(); j++) {
for (int k=1; k<=B.length(); k++) {
if(A[j]==B[k]) LCS[j]... | a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before '}' token
15 | cout << LCS[A.length()][B.length()]
| ^
| ;
16 | }
| ~
|
s144456207 | p02235 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int q; cin >> q;
string A, B;
for (int i=0; i<q; i++) {
cin >> A >> B;
vector<vector<int>> LCS(A.length()+1, vector<int>(B.length()+1,0));
int ans=0;
for (int j=1; j<=A.length(); j++) {
for (int k=1; k<=B.length(); k++) {
if... | a.cc: In function 'int main()':
a.cc:15:33: error: expected ')' before ';' token
15 | ans = max(ans, LCS[j][k];
| ~ ^
| )
|
s750423990 | p02235 | C++ | #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
#define MAX_N 1000
#define MAX_M 1000
void solve();
string s, t;
int dp[MAX_N + 1][MAX_M + 1];
void solve(){
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 + 1][j ... | a.cc:35:1: error: extended character is not valid in an identifier
35 | return 0;
| ^
a.cc: In function 'int main()':
a.cc:35:1: error: '\U00003000return' was not declared in this scope
35 | return 0;
| ^~~~~~~~
|
s003125687 | p02235 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
int lcs(string X, string Y){
int x = X.size();
int y = Y.size();
int d[y+1][x+1];
memset(d, 0, sizeof(d));
for(int i = 1; i <= y; i++){
char a = Y[i];
for(int j = 1; j <= x; j+... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:15:3: error: 'memset' was not declared in this scope
15 | memset(d, 0, sizeof(d));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <algorithm>
+++ |+#in... |
s459633461 | p02235 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]){
int n;
cin >> n;
for (int r = 0; r < n; r++) {
string x, y;
cin >> x >> y;
string dp[y.length() + 1][x.length() + 1];
for (int i = 0; i < y.length(); i++) {
for (int j = 0; j < x.length(); j++) {
if(y[... | a.cc: In function 'int main(int, char**)':
a.cc:25:16: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
25 | ans = max(ans, dp[y.length()][i].length());
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:6... |
s962451061 | p02235 | C++ | #include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T>
bool chmax(T &a, const T &b) {
if(a<b) {
a=b;
return false;
}
return true;
}
using namespace std;
int dp[1003][1003];
int main() {
int q; cin>>q;
rep(_,q) {
memset(dp,0,size... | a.cc: In function 'int main()':
a.cc:21:9: error: 'memset' was not declared in this scope
21 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include <cstr... |
s876260697 | p02235 | C++ | #include <iostream>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
using namespace std;
//int dat[1024][1024];
int getLcbLen(char* x,... | a.cc: In function 'int main()':
a.cc:33:50: error: 'strlen' was not declared in this scope
33 | printf("%d\n", getLcbLen(x, (int)strlen(x), y, (int)strlen(y)));
| ^~~~~~
a.cc:15:1: note: 'strlen' is defined in header '<cstring>'; this is probably... |
s349098925 | p02235 | C++ | leng :: Int
leng = 1001
getPos :: Int -> Int -> Int
getPos y x = y * leng + x
lcs :: String -> String -> Int -> Int
lcs in1 in2 = (map lcs_func [0 ..] !!)
where
lcs_func n
| (length in1) == 1 || (length in2) == 1 = if (head in1) == (head in2) then 1 else 0
| (head in1) == (head in2) = (l... | a.cc:1:1: error: 'leng' does not name a type; did you mean 'long'?
1 | leng :: Int
| ^~~~
| long
|
s579711906 | p02235 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
int main(){
char str1[1000],str2[1000];
int LCS[1000][1000]={0};
int length1,length2;
int n;
std::ios::sync_with_stdio(false);
scanf("%d",&n);
for(int s=1;s<=n;s++){
while(cin>>str1>>str2){
length1=strlen(str1);
len... | a.cc: In function 'int main()':
a.cc:13:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
13 | while(cin>>str1>>str2){
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream ci... |
s590196681 | p02235 | C++ | def lcs(x, y)
for i in range(1, len(x)):
for j in range(1, lem(y)):
if x[i] = y[j]:
c[i][j] = c[i-1][j-1] + 1
elif c[i-1][j]>c[i][j-1]:
c[i][j] = c[i-1][j]
else:
c[i][j] = c[i][j-1]
q = input()
x = [' ' for row in range(n+1)]
y = [' ' for row in range(n+1)]
c = [['... | a.cc:1:1: error: 'def' does not name a type
1 | def lcs(x, y)
| ^~~
|
s696478449 | p02235 | C++ | def lcs(x, y)
for i in range(1, len(x)):
for j in range(1, lem(y)):
if x[i] = y[j]:
c[i][j] = c[i-1][j-1] + 1
elif c[i-1][j]>c[i][j-1]:
c[i][j] = c[i-1][j]
else:
c[i][j] = c[i][j-1]
q = input()
x = [' ' for row in range(n+1)]
y = [' ' for row in range(n+1)]
c = [['... | a.cc:1:1: error: 'def' does not name a type
1 | def lcs(x, y)
| ^~~
|
s176341785 | p02235 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define MAX_SEQ 1000
int main() {
int n; cin >> n;
for(int i=0;i<n;i++) {
int subseq_len = 0;
char seq1[MAX_SEQ+1];
char seq2[MAX_SEQ+1];
vector<char> seq_sub;
cin >> seq1;
cin >> seq2;
for(int seq1_it=0;seq1[seq1_it]!='\0';se... | a.cc: In function 'int main()':
a.cc:18:39: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, char&)'
18 | vector<char>::iterator it = find(seq_sub.begin(), seq_sub.end(), seq1[seq1_it]);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~... |
s746873640 | p02235 | C++ | import java.util.Scanner;
public class alds1_10 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = null, Y = null;
int[][] dp = new int[1001][1001];
int q = sc.nextInt();
for (int i = 0; i < q; ++i) {
X = sc.next();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class alds1_10 {
| ^~~~~~
|
s684811353 | p02235 | C++ | import java.util.*;
public class alds1_10 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = null, Y = null;
int[][] dp = new int[1001][1001];
int q = sc.nextInt();
for (int i = 0; i < q; ++i) {
X = sc.next();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class alds1_10 {
| ^~~~~~
|
s267018590 | p02235 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = null, Y = null;
int[][] dp = new int[1001][1001];
int q = sc.nextInt();
for (int i = 0; i < q; ++i) {
X = sc.next();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s399101154 | p02235 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = null, Y = null;
int[][] dp = new int[1001][1001];
int q = sc.nextInt();
for (int i = 0; i < q; ++i) {
X = sc.next();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s887918690 | p02235 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int dp[1010][1010];
int solve() {
string s,t;
cin >> s >> t;
int max_s = s.length();
int max_t = t.length();
memset(dp,0, sizeof(int) * 1010 * 1010);
for (int i = 1; i <= max_s; i++) {
for (int j = 1; j <= max_t; j++) {
... | a.cc: In function 'int solve()':
a.cc:21:9: error: 'memset' was not declared in this scope
21 | memset(dp,0, sizeof(int) * 1010 * 1010);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cmath>
+++ |+#... |
s195571296 | p02235 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#define VARIABLE(x) cerr << #x... | a.cc: In function 'int main()':
a.cc:36:49: error: '__max' was not declared in this scope
36 | else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
| ^~~~~
|
s789298834 | p02235 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#define VARIABLE(x) cerr << #x... | a.cc: In function 'int main()':
a.cc:36:49: error: '__max' was not declared in this scope
36 | else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
| ^~~~~
|
s481220709 | p02235 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#define VARIABLE(x) cerr << #x... | a.cc: In function 'int main()':
a.cc:38:49: error: '__max' was not declared in this scope
38 | else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
| ^~~~~
|
s973190760 | p02235 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
static const N = 100;
int main(){
int n, p[N+1], m[N+1][N+1];
cin >> n;
for (int i=1; i<=n; i++){
cin >> p[i-1] >> p[i];
}
for (int i=1; i<=n; i++) m[i][i] = 0;
for (int l=2; l <= n; l++){
for (int i=1; i<=n-l+1; i++){
int j = i + l - 1;
m... | a.cc:5:14: error: 'N' does not name a type
5 | static const N = 100;
| ^
a.cc: In function 'int main()':
a.cc:8:18: error: 'N' was not declared in this scope
8 | int n, p[N+1], m[N+1][N+1];
| ^
a.cc:11:24: error: 'p' was not declared in this scope
11 | ... |
s977722646 | p02235 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
using namespace std;
int LCS(int len[],char S[][1001]){//???????????????2?????§?????????
int DP[1001][1001] = {};
for (int i = 1; i <= len[0]; i++) {
for (int j = 1; j <= len[1]; j++) {
if(S[0][i-1] =... | a.cc: In function 'void solve()':
a.cc:26:5: error: 'len' was not declared in this scope; did you mean 'mblen'?
26 | len[0] = strlen(S[0]);
| ^~~
| mblen
a.cc: In function 'int main()':
a.cc:37:25: error: 'n' was not declared in this scope
37 | for (int i = 0; i < n; i++) {
| ... |
s308682099 | p02235 | C++ | #include<iostream>
#include<vector>b
using namespace std;
int main()
{
int kurikaeshi;
vector<int> answer;
cin >> kurikaeshi;
for (int variable = 0;variable < kurikaeshi;++variable) {
char X[1024], Y[1024];
int LX = 0, LY = 0;
vector<vector<int>> L;
cin >> X >> Y;
for (int i = 0;X[i] != 0;++i) LX += 1;
... | a.cc:2:9: fatal error: vector>: No such file or directory
2 | #include<vector>b
| ^~~~~~~~~
compilation terminated.
|
s581094295 | p02235 | C++ | #include<iostream>
#include<vector>b
using namespace std;
int main()
{
int kurikaeshi;
vector<int> answer;
cin >> kurikaeshi;
for (int variable = 0;variable < kurikaeshi;++variable) {
char X[1024], Y[1024];
int LX = 0, LY = 0;
vector<vector<int>> L;
cin >> X >> Y;
for (int i = 0;X[i] != 0;++i) LX += 1;
... | a.cc:2:9: fatal error: vector>: No such file or directory
2 | #include<vector>b
| ^~~~~~~~~
compilation terminated.
|
s121459939 | p02235 | C++ | #include<iostream>
#include<vector>b
using namespace std;
int main()
{
int kurikaeshi;
vector<int> answer;
cin >> kurikaeshi;
for (int variable = 0;variable < kurikaeshi;++variable) {
char X[1024], Y[1024];
int LX = 0, LY = 0;
vector<vector<int>> L;
cin >> X >> Y;
for (int i = 0;X[i] != 0;++i) LX += 1;
... | a.cc:2:9: fatal error: vector>: No such file or directory
2 | #include<vector>b
| ^~~~~~~~~
compilation terminated.
|
s294134012 | p02235 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;
int... | a.cc: In function 'void solve()':
a.cc:22:9: error: 'memset' was not declared in this scope
22 | memset(dp,0,1001*1001);
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <math.h>
+++ |+#include <cstrin... |
s490107738 | p02235 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int n, xl, yl, dp[1003][1003]; char x[1003], y[1003];
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%s", x); xl = strlen(x);
scanf("%s", y); yl = strlen(y);
memset(dp, 0, sizeof(dp));
for(int i = 1; i <= xl; i++) {
for(int j ... | a.cc: In function 'int main()':
a.cc:8:38: error: 'strlen' was not declared in this scope
8 | scanf("%s", x); xl = strlen(x);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 |... |
s143908797 | p02235 | C++ | v#include <iostream>
#include <string>
#include <algorithm>
//#define FOR(i,a,b) for(int i=(a);i<(b);++i)
//#define REP(i,n) FOR(i,0,n)
using namespace std;
static const int N = 10000;
// longest common sequence
int lcs(string X, string Y){
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl ... | a.cc:1:2: error: stray '#' in program
1 | v#include <iostream>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/... |
s057228809 | p02235 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <random>
#include <cstdlib>
#define Loop(i, n) for(int i =... | a.cc: In function 'int dp(int, int)':
a.cc:28:23: error: 'INT_MIN' was not declared in this scope
28 | if (memo[a][b] != INT_MIN) return memo[a][b];
| ^~~~~~~
a.cc:17:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
16 | #... |
s392342936 | p02235 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int dp[1001][1001];
int q;
void solve(){
char x[1001],y[1001];
scanf("%s %s",x,y);
int lx = strlen(x);
int ly = strlen(y);
for(int i=0;i<=lx;i++){
for(int j=0;j<=ly;j++){
if(i==0||j==0) dp[i][j] = 0;
else if(x[i]==y[j]) dp[i][j] = dp[... | a.cc: In function 'void solve()':
a.cc:11:12: error: 'strlen' was not declared in this scope
11 | int lx = strlen(x);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstring>
... |
s044607942 | p02235 | C++ | #include <iostream>
using namespace std;
/**
* lcs(m,n) =
* if x[m] == y[n] lcs[m-1,n-1]+1
* max(lcs[m-1,n],lcs[m,n-1])
*
*/
string x, y;
const int q = 150;
int c[q][q];
int lcs(int m, int n)
{
if (m == -1 || n== -1) return 0;
if (x[m] == y[n]) return lcs(m-1,n-1) + 1;
int & cc = c[m][n];
if (cc != -... | a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
35 | memset(c, -1, sizeof(c));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstr... |
s794386317 | p02235 | C++ | #include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))
int q;
int dp[1000][1000];
std::string s, t;
int rec( int i, int j )
{
int &ret = dp[i][j];
if( ~ret )
return ret;
if( i == s.size() || j == t.size() )... | a.cc: In function 'int rec(int, int)':
a.cc:26:17: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
26 | ret = std::max( { ret, rec( i+1, j ), rec( i, j+1 ) } );
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s271490652 | p02235 | C++ | #include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))
int q;
int dp[1000][1000];
std::string s, t;
int rec( int i, int j )
{
int &ret = dp[i][j];
if( ~ret )
return ret;
if( i == s.size() || j == t.size() )... | a.cc: In function 'int rec(int, int)':
a.cc:26:17: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
26 | ret = std::max( { ret, rec( i+1, j ), rec( i, j+1 ) } );
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s478504972 | p02235 | C++ | #include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))
int q;
int dp[1000][1000];
std::string s, t;
int rec( int i, int j )
{
int &ret = dp[i][j];
if( ~ret )
return ret;
if( i == s.size() || j == t.size() )... | a.cc: In function 'int main()':
a.cc:5:18: error: 'memset' was not declared in this scope
5 | #define clr(a,v) memset((a),(v),sizeof(a))
| ^~~~~~
a.cc:38:5: note: in expansion of macro 'clr'
38 | clr( dp, -1 );
| ^~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; ... |
s236445007 | p02235 | C++ | #include<iostream>
#include<string>
using namespace std;
int lcs[1001][1001];
/*int lcs(string a,string b)
{
if(a.length()<=0||b.length()<=0)
{
return 0;
}
else if(a[a.length()-1]==b[b.length()-1])
{
return 1+lcs(a.substr(0,a.length()-1),b.substr(0,b.length()-1));
}
else
... | a.cc:58:1: error: expected declaration before '}' token
58 | }
| ^
|
s794047315 | p02235 | C++ | #include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
using namespace std;
const int MAX = 1000;
static int n, m;
static char S[150][MAX], T[150][MAX];
static int ans[150][MAX];
void solve(int in)
{
int count_max = 0;
for (int i = n - 1; i >= 0; i--) {
count_max = 0;
for (int j = n - 1; j >= ... | a.cc: In function 'int main()':
a.cc:42:21: error: 'strlen' was not declared in this scope
42 | n = strlen(S[i]);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#... |
s744091362 | p02235 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;
int dp[1001][1001];
int main() {
int b;
scanf("%d", &b);
char e[1001];
char f[1001];
for (int c = 0; c < b; c++) {
scanf("%s%s", e, f);
for (int g = 0; g <= strlen(... | a.cc: In function 'int main()':
a.cc:18:38: error: 'strlen' was not declared in this scope
18 | for (int g = 0; g <= strlen(e); g++) {
| ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'... |
s923602214 | p02235 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;
int dp[1001][1001];
int main() {
int b;
scanf("%d", &b);
char e[1001];
char f[1001];
for (int c = 0; c < b; c++) {
scanf("%s%s", e, f);
for (int g = 0; g <= strlen(... | a.cc: In function 'int main()':
a.cc:18:38: error: 'strlen' was not declared in this scope
18 | for (int g = 0; g <= strlen(e); g++) {
| ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'... |
s142147327 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X=' '+X;
Y=' '+Y;
for(i=1;i<=m;i++) c[i][0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m;i++){
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ^
| ;
a.cc: In function 'int main()':
a.cc:35:7: error: 'i' was not declared in this scope
35 | for(i=0;i<n;i++){
... |
s232825438 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X=' '+X;
Y=' '+Y;
for(i=1;i<=m;i++) c[i][0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m;i++){
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ^
| ;
a.cc: In function 'int main()':
a.cc:35:7: error: 'i' was not declared in this scope
35 | for(i=0;i<n;i++){
... |
s483752507 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X=' '+X;
Y=' '+Y;
for(i=1;i<=m;i++) c[i][0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m;i++){
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ^
| ;
a.cc: In function 'int main()':
a.cc:37:23: error: 'enl' was not declared in this scope
37 | cout<<lcs(s1,s... |
s516845296 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X=' '+X;
Y=' '+Y;
for(i=1;i<=m;i++) c[i][0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m;i++){
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ^
| ;
|
s067386956 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X=' '+X;
Y=' '+Y;
for(i=1;i<=m;i++) c[i][0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m;i++){
... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ^
| ;
|
s876491157 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int i,j;
int maxl=0;
X= ' ' + X;
Y= ' ' + Y;
for(i=1;i<=m;i++) c[i]c[0]=0;
for(j=1;j<=n;j++) c[0]c[j]=0;
for(i=1;i<=m... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:16:25: error: expected ';' before 'c'
16 | for(i=1;i<=m;i++) c[i]c[0]=0;
| ^
| ;
a.cc:17:25: error: expected ';' before 'c'
17 | for(j=1;j<=n;j++) c[0]c[j]=0;
| ... |
s287924169 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
usig name std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(X[i]==Y[j]){
c[i][j]=c[i-1][j-1]+1;
... | a.cc:4:1: error: 'usig' does not name a type
4 | usig name std;
| ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
6 | int lcs(string X,string Y){
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/inc... |
s338761880 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++) c[i][0]=0;
for(int j=1;j<=n;j++) c[0][j]=0;
for(int i=1;i<=m;i++){
for(int j... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:24:30: error: 'ma' was not declared in this scope; did you mean 'm'?
24 | maxl=ma(maxl,c[i][j]);
| ^~
| m
a.cc: In function 'int main()':
a.cc:35:21: error: no mat... |
s083059965 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
usig namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
if(X[i]==Y[j]){
c[i][j]=c[i-1][j-1... | a.cc:4:1: error: 'usig' does not name a type
4 | usig namespace std;
| ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
6 | int lcs(string X,string Y){
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /us... |
s152592344 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
usig namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++)c[i][0]=0;
for(int j=1;j<=n;j++)c[0][j]=0;
for(int i=1;i<=m;i++){
fo... | a.cc:4:1: error: 'usig' does not name a type
4 | usig namespace std;
| ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
6 | int lcs(string X,string Y){
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /us... |
s020722184 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
usig namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++)c[i][0]=0;
for(int j=1;j<=n;j++)c[0][j]=0;
for(int i=1;i<=m;i++){
fo... | a.cc:4:1: error: 'usig' does not name a type
4 | usig namespace std;
| ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
6 | int lcs(string X,string Y){
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /us... |
s519048963 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
usig namespace std;
static const int N=1000;
int lcs(string X,string Y){
int c[N+1][N+1];
int m=X.size();
int n=Y.size();
int maxl=0;
X=' '+X;
Y=' '+Y;
for(int i=1;i<=m;i++)c[i][0]=0;
for(int j=1;j<=n;j++)c[0][j]=0;
for(int i=1;i<=m;i++){
fo... | a.cc:4:1: error: 'usig' does not name a type
4 | usig namespace std;
| ^~~~
a.cc:6:9: error: 'string' was not declared in this scope
6 | int lcs(string X,string Y){
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /us... |
s606529497 | p02235 | C++ | #include <iostream>
#include <string>
#include <algprithm>
using namespace std;
static const int N = 1000;
int lcs ( string X, string Y ) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for ( int i = 1; i <= m; i++ ) {
for ( int j = 1; j <= n; j++ ) {
if ... | a.cc:3:10: fatal error: algprithm: No such file or directory
3 | #include <algprithm>
| ^~~~~~~~~~~
compilation terminated.
|
s537783075 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N =1000;
int lcs(string, string Y) {
int c[N+1][N+1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if (X[i] =... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:8:11: error: 'X' was not declared in this scope
8 | int m = X.size();
| ^
a.cc:18:19: error: 'mx' was not declared in this scope; did you mean 'm'?
18 | c[i][j] = mx(c[i - 1][j], c[i][j = 1]);
| ^~
... |
s263303131 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N+1][N+1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if (X[i... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:18:19: error: 'mx' was not declared in this scope; did you mean 'm'?
18 | c[i][j] = mx(c[i - 1][j], c[i][j = 1]);
| ^~
| m
a.cc:20:18: error: 'mxl' was not declared in this scope; did you mean 'maxl'?
... |
s304004240 | p02235 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
using namespace std;
int main(void) {
char X[100], Y[100];
char *S;
int q;
cin >> q;
for (int i = 0;i < q;i++) {
cin >> X;
... | a.cc: In function 'int main()':
a.cc:26:21: error: 'strstr' was not declared in this scope
26 | S = strstr(X, Y);
| ^~~~~~
a.cc:11:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include <cstdlib>
+++ |+#... |
s851781708 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:18:19: error: 'mx' was not declared in this scope; did you mean 'm'?
18 | c[i][j] = mx(c[i - 1][j], c[i][j = 1]);
| ^~
| m
a.cc:20:18: error: 'mxl' was not declared in this scope; did you mean 'maxl'?
... |
s084145394 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:18:19: error: 'mx' was not declared in this scope; did you mean 'm'?
18 | c[i][j] = mx(c[i - 1][j], c[i][j = 1]);
| ^~
| m
a.cc:20:18: error: 'mxl' was not declared in this scope; did you mean 'maxl'?
... |
s348031321 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:20:18: error: 'mxl' was not declared in this scope; did you mean 'maxl'?
20 | maxl = max(mxl, c[i][j]);
| ^~~
| maxl
a.cc: In function 'int main()':
a.cc:27:14: error: no match for 'operator>' (operand typ... |
s286829535 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:20:18: error: 'mxl' was not declared in this scope; did you mean 'maxl'?
20 | maxl = max(mxl, c[i][j]);
| ^~~
| maxl
a.cc: In function 'int main()':
a.cc:27:14: error: no match for 'operator>' (operand typ... |
s450814336 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int main()':
a.cc:27:14: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
27 | int n; cin > n;
| ~~~ ^ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.... |
s568072472 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for (int i = 1; i <= m; i++){
for ( int j = 1; j <= n; j++ ){
if ... | a.cc: In function 'int main()':
a.cc:27:14: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
27 | int n; cin > n;
| ~~~ ^ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.... |
s300187832 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X,string Y){
int c[N + 1][N + 1];
int m=X.size();
int n=Y.size();
int maxl=0;
X= ' ' + X;
Y= ' ' + Y;
for(int i=1;i<=m;i++) c[i][0]=0;
for(int j=1;j<=n;j++) c[0][j]=0;
for(int ... | a.cc: In function 'int main()':
a.cc:36:19: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
36 | cout << lcs(s1-1,s2-1) << endl;
| ~~^~
| | |
| | int
| st... |
s483457435 | p02235 | C++ | #include <stdio.h>
int t[1001][1001];
int main(){
char X[1000],Y[1000];
int i, j, n, x, y, k;
scanf("%d",&n);
for(k=0; k<n; k++){
scanf("%s%s",X+1,Y+1);
x=strlen(X+1);
y=strlen(Y+1);
for(i=1; i<=x; i++)
for(j=0; j<=y;j++)
t[i][j]=0;
for(i=1;i<=x;i++){
for(j=1;j<=y;... | a.cc: In function 'int main()':
a.cc:13:7: error: 'strlen' was not declared in this scope
13 | x=strlen(X+1);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 |
|
s136412289 | p02235 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for ( int i = 1; i <= m; i++) c[i][0] = 0;
for ( int j = 1; i <= n; j++) ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:14:20: error: 'i' was not declared in this scope
14 | for ( int j = 1; i <= n; j++) c[0][j] = 0;
| ^
|
s104954913 | p02235 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int lcs( string X , string Y) {
int c[ N + 1 ][ N + 1 ] ;
int m = X.size() ;
int n = Y.size() ;
int max1 = 0 ;
X = ' ' + X[0] ;
Y = ' ' + Y[0] ;
for(int i = 1 ; i<m ; i++) {
for(int j = 1; j < n; j++){
if (X[i] == Y[j]) {
c[i][j]=c[i... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:6:8: error: 'N' was not declared in this scope
6 | int c[ N + 1 ][ N + 1 ] ;
| ^
a.cc:15:10: error: 'c' was not declared in this scope
15 | c[i][j]=c[i -1][j - 1] + 1;
| ^
a.cc:16:1: error: expected primary-expressio... |
s196100732 | p02235 | C++ | #include <stdio.h>
#include <string.h>
int main(){
char str_s[128], str_p[128];
int a[100]=0;
int i, j, c, h, n, m;
scanf("%d",n);
for(i=0;i < n;i++){
scanf("%s",str_s);
scanf("%s",str_p);
n=strlen(str_s);
m=strlen(str_p);
c=0;
h=0;
for(i=0;i < n;i++){
... | a.cc: In function 'int main()':
a.cc:6:15: error: array must be initialized with a brace-enclosed initializer
6 | int a[100]=0;
| ^
|
s148031564 | p02235 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int lcs( string X , string Y) {
int c[ N + 1 ][ N + 1 ] ;
int m = X.size() ;
int n = Y.size() ;
int max1 = 0 ;
X = ' ' + X ;
Y = ' ' + Y ;
for(int i = 1 ; i <= m ; i++) c[i][0] = 0 ;
for(int j = 1 ; j <= n ; j++) c[0][j] = 0 ;
for(int i = 1 ; ... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:6:8: error: 'N' was not declared in this scope
6 | int c[ N + 1 ][ N + 1 ] ;
| ^
a.cc:13:33: error: 'c' was not declared in this scope
13 | for(int i = 1 ; i <= m ; i++) c[i][0] = 0 ;
| ^
a.cc:15:33: ... |
s123783305 | p02235 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
static const int N = 1000 ;
int lcs( string X , string Y) {
int c[ N + 1 ][ N + 1 ] ;
int m = X.size() ;
int n = Y.size() ;
int max1 = 0 ;
X = ' ' + X ;
Y = ' ' + Y ;
for(int i = 1 ; i <= m ; i++) c[i][0] = 0 ;
for(int j = 1 ; j... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:23:1: error: expected primary-expression before '?' token
23 | ?????????}
| ^
a.cc:23:2: error: expected primary-expression before '?' token
23 | ?????????}
| ^
a.cc:23:3: error: expected primary-expression before '?' token
23 | ?????????... |
s241033723 | p02235 | C++ |
#include<iostream>
#include<string>
#include<algorithm>
#define N 1000
using namespace std;
int lcs(string X, string Y) {
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
for ( int i = 1; i <= m; i++ ) c[i][0] = 0;
for ( int j = 1; j <= n; j++ ) c[0][j] = 0;
for ( int i = 1; i <= m; i++ ){
for... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:23:17: error: expected ';' before '}' token
23 | return c[m][n]
| ^
| ;
24 | }
| ~
|
s996539642 | p02235 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y){
int c[N + 1][N + 1];
int m = X.xize();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for(int i = 1; i <= m; i++)
c[i][0] = 0;
for(int j = 1; j <= n; j++)
c... | a.cc: In function 'int lcs(std::string, std::string)':
a.cc:11:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'xize'; did you mean 'size'?
11 | int m = X.xize();
| ^~~~
| size
a.cc: In function 'int main()':
a.cc:44:... |
s525247164 | p02235 | C++ |
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char len1[1001], len2[1001];
LCS(int x, int y){
int i,j,c[1001][1001];
for(i=0;i<=x;i++){
... | a.cc:2:1: error: expected unqualified-id before '?' token
2 | ?
| ^
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:58:
/usr/include/stdlib.h:98:8: error: 'size_t' does not name a type
98 | extern size_t __ctype_get_mb_... |
s815663579 | p02235 | C++ | #include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;
int lcs(string X, string Y){
int c[N + 1][N + 1]{
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for( int i = 1; i <= m; i++) c[i][0] = 0;
for( int j = 1; j <= n; j++) c[0... | a.cc:4:7: error: expected nested-name-specifier before 'namespase'
4 | using namespase std;
| ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
7 | int lcs(string X, string Y){
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/s... |
s708336367 | p02235 | C++ | #include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;
int lcs(string X, string Y){
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for( int i = 1; i <= m; i++) c[i][0] = 0;
for( int j = 1; j <= n; j++) c[0... | a.cc:4:7: error: expected nested-name-specifier before 'namespase'
4 | using namespase std;
| ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
7 | int lcs(string X, string Y){
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/s... |
s409257981 | p02235 | C++ | #include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;
int lcs(string X, string Y){
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for( int i = 1; i <= m; i++) c[i][0] = 0;
for( int j = 1; j <= n; j++) c[0... | a.cc:4:7: error: expected nested-name-specifier before 'namespase'
4 | using namespase std;
| ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
7 | int lcs(string X, string Y){
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/s... |
s133310510 | p02235 | C++ | #include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;
int lcs(string X, string Y){
int c[N + 1][N + 1];
int m = X.size();
int n = Y.size();
int maxl = 0;
X = ' ' + X;
Y = ' ' + Y;
for( int i = 1; i <= m; i++) c[i][0] = 0;
for( int j = 1; j <= n; j++) c[0... | a.cc:4:7: error: expected nested-name-specifier before 'namespase'
4 | using namespase std;
| ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
7 | int lcs(string X, string Y){
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/s... |
s978713000 | p02235 | C++ | 27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
#include<vector>
#include<limits.h>
#include<string>
using namespace std;
int LCS(string a, string b){
int m=a.size();
int n=b.size();
int T[m+1][n+1];
int i,j;
for (i=0;i<m+1;i++) T[i][0]=i;
for (j=0;j<n+1;j++) T[0][j]=j;
f... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 27
| ^~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from... |
s826495045 | p02235 | C++ | #include<stdio.h>
#include<string.h>
#define MAX 1001
??
int LCSLength(char [], char []);
??
int main()
{
????int i, q, Z[MAX];
????char X[MAX], Y[MAX];
??
????scanf("%d", &q);
????for(i=0; i<q; i++)
????????{
????????????scanf("%s", X);
????????????scanf("%s", Y);
????????????Z[i] = LCSLength(X, Y);
????????}
??
????f... | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
a.cc:6:1: error: expected unqualified-id before '?' token
6 | ??
| ^
a.cc:27:1: error: expected unqualified-id before '?' token
27 | ??
| ^
|
s910285914 | p02235 | C++ | #include<stdio.h>
??
int LCS(char x[], char y[]) {
????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
????int c[1001][1001];
??????
????while (flag == 0)
????{
????????if (x[xn] != '\0')
????????{
????????????xn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
??????
????flag = 0;
??????
????whil... | a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??
| ^
a.cc:57:1: error: expected unqualified-id before '?' token
57 | ??
| ^
|
s651769232 | p02235 | C++ | #include<stdio.h>
??
int hantei(char x[], char y[]) {
????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
????int c[1001][1001];
??????
????while (flag == 0)
????{
????????if (x[xn] != '\0')
????????{
????????????xn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
??????
????flag = 0;
??????
????w... | a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??
| ^
a.cc:57:1: error: expected unqualified-id before '?' token
57 | ??
| ^
|
s814865850 | p02235 | C++ | #include<stdio.h>
#include<string.h>
????????
int LCS(char *X, char *Y){
????int i,j,m,n,c[1001][1001];
????m = strlen(X);
????n = strlen(Y);
????????????
????for(i=0; i<m; i++){
????????c[i][0] = 0;
????}
????for(j=0; j<n; j++){
????????c[0][j] = 0;
????}
????????
????for(i=1;i<m+1;i++){
????????for(j=1;j<n+1;j++){
??... | a.cc:3:1: error: expected unqualified-id before '?' token
3 | ????????
| ^
a.cc:25:1: error: expected unqualified-id before '?' token
25 | ????????
| ^
|
s794805373 | p02235 | C++ | #include<stdio.h>
#include<string.h>
????????
int LCS(char *X, char *Y){
????int i,j,m,n,c[1001][1001];
????m = strlen(X);
????n = strlen(Y);
????????????
????for(i=0; i<m; i++){
????????c[i][0] = 0;
????}
????for(j=0; j<n; j++){
????????c[0][j] = 0;
????}
????????
????for(i=1;i<m+1;i++){
????????for(j=1;j<n+1;j++){
??... | a.cc:3:1: error: expected unqualified-id before '?' token
3 | ????????
| ^
a.cc:25:1: error: expected unqualified-id before '?' token
25 | ????????
| ^
a.cc:28:1: error: expected unqualified-id before '?' token
28 | ????return 0;
| ^
a.cc:29:1: error: expected declaration before '}' token
... |
s122398013 | p02235 | C++ | #include<stdio.h>
#include<string.h>
????????
int LCS(char *X, char *Y){
????int i,j,m,n,c[1001][1001];
????m = strlen(X);
????n = strlen(Y);
????????????
????for(i=0; i<m; i++){
????????c[i][0] = 0;
????}
????for(j=0; j<n; j++){
????????c[0][j] = 0;
????}
????????
????for(i=1;i<m+1;i++){
????????for(j=1;j<n+1;j++){
??... | a.cc:3:1: error: expected unqualified-id before '?' token
3 | ????????
| ^
a.cc:25:1: error: expected unqualified-id before '?' token
25 | ????????
| ^
|
s306008970 | p02235 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
??
using namespace std;
??
short checkTable[1001][1001];
??
int tmp_max=0;
??
??
void calc(int index,char pattern[],char to_search[],int to_search_length){
??
????????for(int i=to_search_length-1;i>=0;i--){
????????????????if(to_search[i]==pattern[index]){
???... | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
a.cc:6:1: error: expected unqualified-id before '?' token
6 | ??
| ^
a.cc:8:1: error: expected unqualified-id before '?' token
8 | ??
| ^
a.cc:10:1: error: expected unqualified-id before '?' token
10 | ??
| ^
a.c... |
s850874454 | p02235 | C++ | #include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if... | a.cc: In function 'int main()':
a.cc:60:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
60 | std::gets(a);
| ^~~~
| getc
a.cc:61:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
61 | std::gets(b);
| ^~~~
... |
s527850000 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArr... | a.cc: In member function 'void TLcsSolver::Print() const':
a.cc:45:22: error: 'cout' is not a member of 'std'
45 | std::cout << FTable[i][j] << '\t';
| ^~~~
a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream... |
s062868144 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArr... | a.cc: In function 'int main()':
a.cc:45:10: error: 'cin' is not a member of 'std'
45 | std::cin >> n;
| ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
4 | #include <string>
+++ |+#include <iostream>
5 |
a.cc:49:... |
s963004718 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArr... | a.cc: In function 'int main()':
a.cc:49:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
49 | std::gets(a);
| ^~~~
| getc
a.cc:50:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
50 | std::gets(b);
| ^~~~
... |
s288790806 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i =... | a.cc:3:18: warning: extra tokens at end of #include directive
3 | #include <vector>#include <cstdio>
| ^
In file included from /usr/include/c++/14/cstdio:42,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:51:34: error: 'stdin' is not a member of 'std'; did you mean 'string... |
s554832178 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
typedef std::vector<std::vector<int> > TTable;
TTable FTable;
std::string FArray1;
std::string FArray2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArr... | a.cc: In function 'int main()':
a.cc:50:35: error: expected ';' before ')' token
50 | std::fgets(b, 1000, stdin));
| ^
| ;
|
s032642334 | p02235 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
class TLcsSolver
{
int FTable[1000][1000];
const char* FArray1;
const char* FArray2;
const int Fn1;
const int Fn2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArray2[... | a.cc: In constructor 'TLcsSolver::TLcsSolver(const char*, const char*)':
a.cc:33:17: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
33 | , Fn1(std::strlen(a)), Fn2(std::strlen(b))
| ^~~~~~
| mbrlen
a.cc:33:38: error: 'strlen' is not a member of 'std'... |
s877524768 | p02235 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
class TLcsSolver
{
int FTable[1000][1000];
const char* FArray1;
const char* FArray2;
const int Fn1;
const int Fn2;
int Count(int i, int j)
{
if(i == 0 || j == 0) return 0;
if(FArray1[i-1] == FArray2[j-1]){
... | a.cc: In member function 'int TLcsSolver::Answer() const':
a.cc:38:31: error: request for member 'size' in '((const TLcsSolver*)this)->TLcsSolver::FArray1', which is of non-class type 'const char* const'
38 | return FTable[FArray1.size()][FArray2.size()];
| ^~~~
a.cc:38:47... |
s134559151 | p02235 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
int constexpr MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(strlen(ls));
int r_len = int(strlen(rs));
for (int i... | a.cc: In function 'void calc_lcs()':
a.cc:16:21: error: 'strlen' was not declared in this scope
16 | int l_len = int(strlen(ls));
| ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <vector>
+++ |... |
s040055569 | p02235 | C++ | #include <iostream>
#include <cmath>
#include <vector>
constexpr int MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(strlen(ls));
int r_len = int(strlen(rs));
for (int i = 0; i < l_len; i++) {
table[i... | a.cc: In function 'void calc_lcs()':
a.cc:14:21: error: 'strlen' was not declared in this scope
14 | int l_len = int(strlen(ls));
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |... |
s862245973 | p02235 | C++ | #include <iostream>
#include <cmath>
#include <vector>
constexpr int MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(std::strlen(ls));
int r_len = int(std::strlen(rs));
for (int i = 0; i < l_len; i++) {
... | a.cc: In function 'void calc_lcs()':
a.cc:14:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
14 | int l_len = int(std::strlen(ls));
| ^~~~~~
| mbrlen
a.cc:15:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
... |
s741408070 | p02235 | C++ | #include <iostream>
#include <cmath>
#include <vector>
constexpr int MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(std::strlen(ls));
int r_len = int(std::strlen(rs));
for (int i = 0; i < l_len; i++) {
... | a.cc: In function 'void calc_lcs()':
a.cc:14:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
14 | int l_len = int(std::strlen(ls));
| ^~~~~~
| mbrlen
a.cc:15:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
... |
s396290550 | p02235 | C++ | #include <iostream>
#include <cmath>
#include <vector>
constexpr int MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(std::strlen(ls));
int r_len = int(std::strlen(rs));
for (int i = 0; i < l_len; i++) {
... | a.cc: In function 'void calc_lcs()':
a.cc:14:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
14 | int l_len = int(std::strlen(ls));
| ^~~~~~
| mbrlen
a.cc:15:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
... |
s692939373 | p02235 | C++ | #include <iostream>
#include <cmath>
#include <vector>
constexpr int MAX = 1000;
char ls[MAX];
char rs[MAX];
int table[MAX + 1][MAX + 1];
void calc_lcs() {
scanf("%s", ls);
scanf("%s", rs);
int l_len = int(std::strlen(ls));
int r_len = int(std::strlen(rs));
for (int i = 0; i < l_len; i++) {
... | a.cc: In function 'void calc_lcs()':
a.cc:14:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
14 | int l_len = int(std::strlen(ls));
| ^~~~~~
| mbrlen
a.cc:15:26: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.