submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s191433953
p02234
C++
#include<iostream> #include<algorithm> using namespace std; static const int N = 100; int main() { int n, p[N + 1], m[N + 1][N + 1]; cin >> n; for (int n = 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 (i = 1;...
a.cc: In function 'int main()': a.cc:12:19: error: 'i' was not declared in this scope 12 | for (int n = 1; i <= n; i++) { | ^ a.cc:20:10: error: 'i' was not declared in this scope 20 | for (i = 1; i <= n; n - l + 1; i++) { | ^ a.cc:20:34: error: expected ')' before ';'...
s712007551
p02234
C++
#include<iostream> #include<algorithm> using namespace std; static const int 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 (i = 1...
a.cc: In function 'int main()': a.cc:21:10: error: 'i' was not declared in this scope 21 | for (i = 1; i <= n; n - l + 1; i++) { | ^ a.cc:21:34: error: expected ')' before ';' token 21 | for (i = 1; i <= n; n - l + 1; i++) { | ~ ^ | ...
s429318487
p02234
C++
#include<iostream> #include<algorithm> using namespace std; static const int 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 ...
a.cc: In function 'int main()': a.cc:24:22: error: no matching function for call to 'min(int [101], int)' 24 | m[i][j] = min(m[i, j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/1...
s578006482
p02234
C++
#include<iostream> #include<algorithm> using namespace std; static const int 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 ...
a.cc: In function 'int main()': a.cc:24:22: error: no matching function for call to 'min(int [101], int)' 24 | m[i][j] = min(m[i, j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/...
s435182684
p02234
C++
#include <iostream> #include <algorithm> using namespace std; static const int 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=0; i<=n; i++) m[i][i] = 0; for (int l=2; l<=n; l++) { int j = i+l-1; ...
a.cc: In function 'int main()': a.cc:16:17: error: 'i' was not declared in this scope 16 | int j = i+l-1; | ^
s069551734
p02234
C++
#include <iostream> using namespace std; int N ; int a[101][101]; int m[101][2]; int main() { cin >> N; for (int i = 1; i <= N; ++i) { cin >> m[i][0] >> m[i][1]; } for (int j = 1; j <= N; ++j) { a[j][j] = 0; } for (int k = 1; k < N; ++k) { for (int l = 1; l <= N- k ; ...
a.cc: In function 'int main()': a.cc:21:22: error: 'INT_MAX' was not declared in this scope 21 | int mn = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#...
s152079252
p02234
C++
#include <iostream> using namespace std; int N ; int a[101][101]; int m[101][2]; int main() { cin >> N; for (int i = 1; i <= N; ++i) { cin >> m[i][0] >> m[i][1]; } for (int j = 1; j <= N; ++j) { a[j][j] = 0; } for (int k = 1; k < N; ++k) { for (int l = 1; l <= N- k ; ...
a.cc: In function 'int main()': a.cc:21:22: error: 'INT_MAX' was not declared in this scope 21 | int mn = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#...
s543487901
p02234
C++
#include <iostream> #include <numeric_limits> using namespace std; int N ; int a[101][101]; int m[101][2]; int main() { cin >> N; for (int i = 1; i <= N; ++i) { cin >> m[i][0] >> m[i][1]; } for (int j = 1; j <= N; ++j) { a[j][j] = 0; } for (int k = 1; k < N; ++k) { fo...
a.cc:2:10: fatal error: numeric_limits: No such file or directory 2 | #include <numeric_limits> | ^~~~~~~~~~~~~~~~ compilation terminated.
s540619186
p02234
C++
#include "stdafx.h" #include<iostream> #include<vector> using namespace std; vector<vector<int> > cost,best; vector<int> A; void compute(int s,int e){ int minc = 0; int mink = -1; for(int k=s+1;k<=e;++k){ if (cost[s][k-1] < 0){ compute(s,k-1); } if (cost[k][e] < 0) { compute(k,e); } int c = cost[s]...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s281526139
p02234
C++
// http://algorithms.blog55.fc2.com/blog-entry-66.html #include <iostream> using namespace std; #include <stdio.h> #include <string.h> #define M 100 int N,R[M+1],C[M][M],B[M][M]; void compute(){ int i=0,j,k,cost; memset(C,99,sizeof(C)); for(;i<N;i++)C[i][i]=0; for(j=1;j<N;j++) for(i=0;i<N - j; i++ ){ for (...
a.cc:24:1: error: expected declaration before '}' token 24 | } | ^ a.cc:49:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 49 | main(){ | ^~~~
s449286954
p02234
C++
#include<iostream> #include<climits> #include<algorithm> using namespace std; struct mat{ int w,h; }; vector<mat> v; int memo[101][101]; int solve(int l,int r){ if(memo[l][r] > 0)return memo[l][r]; //cout << l << ' ' << r << endl; if(l == r)return 0; int ret = INT_MAX; for(int i = l; i < r; i++){ int a...
a.cc:8:1: error: 'vector' does not name a type 8 | vector<mat> v; | ^~~~~~ a.cc: In function 'int solve(int, int)': a.cc:17:43: error: 'v' was not declared in this scope 17 | int ans = solve(l,i) + solve(i+1,r) + v[l].h * v[i].w * v[r].w; | ^ a.cc: In fun...
s224731229
p02235
Java
import java.util.*; public class LongestCommonSubsequence{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int q=sc.nextInt(); int[] ans=new int[q]; for(int n=0;n<q;n++){ String X=sc.next(); String Y=sc.next(); int[][] A=new int[X.length()+1][Y.length()+1]; for(int...
Main.java:2: error: class LongestCommonSubsequence is public, should be declared in a file named LongestCommonSubsequence.java public class LongestCommonSubsequence{ ^ 1 error
s357776334
p02235
Java
import java.util.*; public class LongestCommon { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int datasetNum = sc.nextInt(); sc.nextLine(); for (int datasetidx = 0; datasetidx < datasetNum; datasetidx++) { String A = sc.nextLine(); ...
Main.java:3: error: class LongestCommon is public, should be declared in a file named LongestCommon.java public class LongestCommon { ^ 1 error
s797894515
p02235
Java
import java.util.Scanner; public class copylcs{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String X = ""; String Y = ""; char[] cX = new char[1001]; char[] cY = new char[1001]; int i = 0; int j = 0; for(int k = 0; k < cX.length; k++) m[i][...
Main.java:3: error: class copylcs is public, should be declared in a file named copylcs.java public class copylcs{ ^ 1 error
s636138674
p02235
Java
import java.util.Scanner; public class dpLcs{ static int[][] m = new int[1001][1001]; public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String X = ""; String Y = ""; char[] cX = new char[1001]; char[] cY = new char[1001]; int i = 0; int...
Main.java:3: error: class dpLcs is public, should be declared in a file named dpLcs.java public class dpLcs{ ^ 1 error
s612180823
p02235
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String X = ""; String Y = ""; for(int i = 0; i < n; i++){ X[i] = " "+scan.next(); Y[i] = " "+scan.next(); System.out.println(lcs(X,Y)); } ...
Main.java:13: error: array required, but String found X[i] = " "+scan.next(); ^ Main.java:14: error: array required, but String found Y[i] = " "+scan.next(); ^ 2 errors
s709132416
p02235
Java
def lcs(str1,str2): c=[[0 for _ in range(100000000000)] for _ in range(10000000000000)] m=len(str1) n=len(str2) maxl=0 str1=" "+str1 str2=" "+str2 i=1 j=1 while(i<=m): while(j<=n): if(str1[i]==str2[j]): c[i][j]=c[i-1][j-1]+1 # print...
Main.java:15: error: illegal character: '#' # print(c[i][j]) ^ Main.java:1: error: unnamed classes are a preview feature and are disabled by default. def lcs(str1,str2): ^ (use --enable-preview to enable unnamed classes) Main.java:1: error: <identifier> expected def lcs(str1,str2): ...
s473050517
p02235
Java
def lcs(str1,str2): c=[[0 for _ in range(1010)] for _ in range(1010)] m=len(str1) n=len(str2) maxl=0 str1=" "+str1 str2=" "+str2 i=1 j=1 while(i<=m): while(j<=n): if(str1[i]==str2[j]): c[i][j]=c[i-1][j-1]+1 # print(c[i][j]) ...
Main.java:15: error: illegal character: '#' # print(c[i][j]) ^ Main.java:1: error: unnamed classes are a preview feature and are disabled by default. def lcs(str1,str2): ^ (use --enable-preview to enable unnamed classes) Main.java:1: error: <identifier> expected def lcs(str1,str2): ...
s350582837
p02235
Java
def lcs(str1,str2): c=[[0 for _ in range(1001)] for _ in range(1001)] m=len(str1) n=len(str2) maxl=0 str1=" "+str1 str2=" "+str2 i=1 j=1 while(i<=m): while(j<=n): if(str1[i]==str2[j]): c[i][j]=c[i-1][j-1]+1 # print(c[i][j]) ...
Main.java:15: error: illegal character: '#' # print(c[i][j]) ^ Main.java:1: error: unnamed classes are a preview feature and are disabled by default. def lcs(str1,str2): ^ (use --enable-preview to enable unnamed classes) Main.java:1: error: <identifier> expected def lcs(str1,str2): ...
s387926215
p02235
C
#include <stdio.h> #include <string.h> char X[1001],Y[1001]; int q; int LCSLength(){ int m,n,i,j; int c[1000][1000]; m=strlen(X); n=strlen(Y); for(i=1;i<=m;i++){ c[i][0]=0; } for(j=0;j<=n;j++){ c[0][j]=0; } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(X[i-1]==Y[j-1]){ c[i][j]=c[i-1][j...
main.c: In function 'LCSLength': main.c:22:15: error: expected '(' before '{' token 22 | }else if{ | ^ | ( main.c:23:33: error: expected ';' before 'c' 23 | (c[i-1][j] >= c[i][j-1]) c[i][j]=c[i-1][j]; | ^~ | ...
s747763865
p02235
C
#include <stdio.h> #include <string.h> char X[1001],Y[1001]; int q; int LCSLength(){ int m,n,i,j; int c[1000][1000]; m=strlen(X); n=strlen(Y); for(i=1;i<=m;i++){ c[i][0]=0; } for(j=0;j<=n;j++){ c[0][j]=0; } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(X[i-1]==Y[j-1]){ c[i][j]=c[i-1][j...
main.c: In function 'LCSLength': main.c:22:15: error: expected '(' before '{' token 22 | }else if{ | ^ | ( main.c:23:33: error: expected ';' before 'c' 23 | (c[i-1][j] >= c[i][j-1]) c[i][j]=c[i-1][j]; | ^~ | ...
s528494434
p02235
C
#include <stdio.h> #include <string.h> char X[1001],Y[1001]; int q; int LCSLength(){ int m,n,i,j; int c[1000][1000]; m=strlen(X); n=strlen(Y); for(i=1;i<=m;i++){ c[i][0]=0; } for(j=0;j<=n;j++){ c[0][j]=0; } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(X[i-1]==Y[j-1]){ c[i][j]=c[i-1][j...
main.c: In function 'LCSLength': main.c:22:15: error: expected '(' before '{' token 22 | }else if{ | ^ | ( main.c:23:33: error: expected ';' before 'c' 23 | (c[i-1][j] >= c[i][j-1]) c[i][j]=c[i-1][j]; | ^~ | ...
s692663628
p02235
C
#include<iostream> #include<string> std::string x,y; int lcs[1000][1000] = {0}; int max(int k,int l){ if(k>l){ return k; }else{ return l; } } void LCS(int i,int j){ if(x[i] == y[j]){ lcs[i][j] = lcs[i-1][j-1]+1; }else{ lcs[i][j] = max(lcs[i-1][j],lcs[i][j-1]); } } void pre(){ for(int i...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s248952229
p02235
C
#include<iostream> #include<string> #include<algoritm> 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; fo...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s380006786
p02235
C
#include<stdio.h> #include<string.h> static const int N = 1000; int lcs(string x, string y){ int c[N + 1][N + 1]; int i, j, m = x.size(), n = y.size(), maxl = 0; x = ' ' + x; y = ' ' + y; for(i = 1 ; i <= m ; i++) c[i][0] = 0; for(j = 1 ; j <= n ; i++) c[0][j] = 0; for(i = 1 ; i <= m ; i++){ for(j...
main.c:6:9: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | stdin main.c:6:19: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | std...
s208382043
p02235
C
#include<stdio.h> #include<string.h> static const int N = 1000; int lcs(string x, string y){ int c[N + 1][N + 1]; int i, j, m = x.size(), n = y.size(), maxl = 0; x = ' ' + x; y = ' ' + y; for(i = 1 ; i <= m ; i++) c[i][0] = 0; for(j = 1 ; j <= n ; i++) c[0][j] = 0; for(i = 1 ; i <= m ; i++){ for(j...
main.c:6:9: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | stdin main.c:6:19: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | std...
s497653343
p02235
C
#include<stdio.h> #include<string.h> static const int N = 1000; int lcs(char x[10], char y[10]){ int c[N + 1][N + 1]; int i, j, m = x.size(), n = y.size(), maxl = 0; x = ' ' + x; y = ' ' + y; for(i = 1 ; i <= m ; i++) c[i][0] = 0; for(j = 1 ; j <= n ; i++) c[0][j] = 0; for(i = 1 ; i <= m ; i++){ f...
main.c: In function 'lcs': main.c:8:18: error: request for member 'size' in something not a structure or union 8 | int i, j, m = x.size(), n = y.size(), maxl = 0; | ^ main.c:8:32: error: request for member 'size' in something not a structure or union 8 | int i, j, m = x.size(), n = y....
s385160040
p02235
C
#include<stdio.h> #include<string.h> static const int N = 1000; int lcs(string x, string y){ int c[N + 1][N + 1]; int i, j, m = x.size(), n = y.size(), maxl = 0; x = ' ' + x; y = ' ' + y; for(i = 1 ; i <= m ; i++){ c[i][0] = 0; for(j = 1 ; j <= n ; i++){ c[0][j] = 0; if(x[i] == y[j]){ ...
main.c:6:9: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | stdin main.c:6:19: error: unknown type name 'string'; did you mean 'stdin'? 6 | int lcs(string x, string y){ | ^~~~~~ | std...
s203940165
p02235
C
#include<stdio.h> #include<string.h> static const int N = 1000; int lcs(char x[10], char y[10]){ int c[N + 1][N + 1]; int i, j, m = x.size(), n = y.size(), maxl = 0; x = ' ' + x; y = ' ' + y; for(i = 1 ; i <= m ; i++){ c[i][0] = 0; for(j = 1 ; j <= n ; i++){ c[0][j] = 0; if(x[i] == y[j...
main.c: In function 'lcs': main.c:8:18: error: request for member 'size' in something not a structure or union 8 | int i, j, m = x.size(), n = y.size(), maxl = 0; | ^ main.c:8:32: error: request for member 'size' in something not a structure or union 8 | int i, j, m = x.size(), n = y....
s259110667
p02235
C
#include <stdio.h> #include <string.h> #define L_MAX 1001 int max(int ,int); int lcs(char *,char *); int main(){ int c; char x[L_MAX]; char y[L_MAX]; scanf("%d",&q); while(c>0){ scanf("%s",x); scanf("%s",y); printf("%d\n",lcs(x,y)); c--; } return 0; } int max(int a,int b){ if(a<b)r...
main.c: In function 'main': main.c:12:15: error: 'q' undeclared (first use in this function) 12 | scanf("%d",&q); | ^ main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
s305295391
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], m=X.size(), n=Y.size(), LMAX=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++) ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s217290948
p02235
C
define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> void LCS(char *x, char *y){ int m = strlen(x+1); int n = strlen(y+1); int i, j, **c; c = malloc(sizeof(int)*(m+2)); for (i = 0; i <= m+2; i++) c[i] = malloc(sizeof(int)*(n+2)); for (i = 0; i <= m; i++){ for (j = 0; j <...
main.c:1:1: error: unknown type name 'define' 1 | define _CRT_SECURE_NO_WARNINGS | ^~~~~~ main.c:1:31: error: expected ';' before 'typedef' 1 | define _CRT_SECURE_NO_WARNINGS | ^ | ;
s636063760
p02235
C
define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> void LCS(char *x, char *y){ int m = strlen(x+1); int n = strlen(y+1); int i, j, **c; c = malloc(sizeof(int)*(1001)); for (i = 0; i <= m; i++) c[i] = malloc(sizeof(int)*(n+1)); for (i = 0; i <= m; i++){ for (j = 0; j <=...
main.c:1:1: error: unknown type name 'define' 1 | define _CRT_SECURE_NO_WARNINGS | ^~~~~~ main.c:1:31: error: expected ';' before 'typedef' 1 | define _CRT_SECURE_NO_WARNINGS | ^ | ;
s443005848
p02235
C
define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> void LCS(char *x, char *y){ int m = strlen(x+1); int n = strlen(y+1); int i, j, **c; c = malloc(sizeof(int)*(1000)); for (i = 0; i <= m; i++) c[i] = malloc(sizeof(int)*(n+1)); for (i = 0; i <= m; i++){ for (j = 0; j <= ...
main.c:1:1: error: unknown type name 'define' 1 | define _CRT_SECURE_NO_WARNINGS | ^~~~~~ main.c:1:31: error: expected ';' before 'typedef' 1 | define _CRT_SECURE_NO_WARNINGS | ^ | ;
s106270791
p02235
C
define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> void LCS(char *x, char *y){ int m = strlen(x+1); int n = strlen(y+1); int i, j, **c; c = malloc(sizeof(int)*(10009)); for (i = 0; i <= m; i++) c[i] = malloc(sizeof(int)*(n+1)); for (i = 0; i <= m; i++){ for (j = 0; j <=...
main.c:1:1: error: unknown type name 'define' 1 | define _CRT_SECURE_NO_WARNINGS | ^~~~~~ main.c:1:31: error: expected ';' before 'typedef' 1 | define _CRT_SECURE_NO_WARNINGS | ^ | ;
s340997742
p02235
C
#include<stdio.h> #include<string.h> char x[1001], y[1001]; void LCS(char x[], char y[]){ int i,j; int c[m][n]; int m = strlen(x+1), n = strlen(y+1); for(i = 1; i <= m; i++){ c[i][0] = 0; } for(j = 0; j <= n; j++){ c[0][j] = 0; } for(i = 1; i <= m; i++){ for(j =1; j <= n; j++){ ...
main.c: In function 'LCS': main.c:8:9: error: 'm' undeclared (first use in this function) 8 | int c[m][n]; | ^ main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in main.c:8:12: error: 'n' undeclared (first use in this function) 8 | int c[m][n]; ...
s402123420
p02235
C
include<stdio.h> #include<string.h> char x[1001], y[1001]; void LCS(char x[], char y[]){ int i,j; int c[100000][100000]; int m = strlen(x+1), n = strlen(y+1); for(i = 1; i <= m; i++){ c[i][0] = 0; } for(j = 0; j <= n; j++){ c[0][j] = 0; } for(i = 1; i <= m; i++){ for(j =1; j <= n; j++...
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ...
s902310978
p02235
C
#include <stdio.h> #include <string.h> void LCSL(char* X,char* Y){ int m,n,i,j,c[1050][1050]; m=strlen(X+1); n=strlen(Y+1); for(i=0;i<=m+1;i++){ c[i][0]=0; } for(i=0;i<=n+1;i++){ c[0][i]=0; } for(i=1;i<=m;i++){ for(j=1;j<=n;j++){ if( X[i]==Y[j]){ c[i][j]=c[i-1][j-1]+1; ...
main.c:33:10: error: expected declaration specifiers or '...' before string constant 33 | printf("%d\n",c[i-1][j-1]); | ^~~~~~ main.c:33:17: error: unknown type name 'c' 33 | printf("%d\n",c[i-1][j-1]); | ^ main.c:34:1: error: expected identifier or '(' before '}' token ...
s476059569
p02235
C
#include<stdio.h> int LongestCommonSubsequence(char x[],char y[]){ int i,j,n,m,c[100][100]; m = strlen(x); n = strlen(y); for(i = 1; i <=m ;i ++){ c[i][0] = 0; } for(j = 1; j <=n ;j ++){ c[0][i] = 0; } for(i = 1; i <=m ;i ++){ for(j = 1; j <=n ;j ++){ if(x[i] == y[j]){ c[i...
main.c: In function 'LongestCommonSubsequence': main.c:5:7: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 5 | m = strlen(x); | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen' 1 | #include<stdio.h> +++ |+#include <string.h> ...
s349965793
p02235
C
#include<stdio.h> #include<string.h> char x[1000],y[1000]; int c[1000][1000]; void LongestCommonSubsequence(){ int i,j,n,m; m = strlen(x); n = strlen(y); for(i = 1; i <=m ;i ++){ c[i][0] = 0; } for(j = 0; j <=n ;j ++){ c[0][j] = 0; } for(i = 1; i <= m ;i ++){ for(j = 1; j <= n ;j ++){...
main.c: In function 'main': main.c:34:26: error: 'j' undeclared (first use in this function) 34 | printf("%d\n",c[i-1][j-1]); | ^ main.c:34:26: note: each undeclared identifier is reported only once for each function it appears in
s328163093
p02235
C
#include<stdio.h> #include<string.h> #define MAX 1000 char x[MAX], y[MAX]; int c[MAX][MAX], res; void LCS(){ int xlen, ylen, i, j; xlen=strlen(x); ylen=strlen(y); for(i = 1; i <= xlen; i++){ c[i][0] = 0; } for(j = 0; j <= ylen; j++){ c[0][j] = 0; } for(i = 1; i <= xlen; i++){ for(j = 1;...
main.c: In function 'LCS': main.c:35:3: error: expected declaration or statement at end of input 35 | } | ^
s675107427
p02235
C
#include<stdio.h> #include<string.h> #define MAX 1000 char x[MAX], y[MAX]; int c[MAX][MAX], res; void LCS(){ int xlen, ylen, i, j; xlen=strlen(x); ylen=strlen(y); for(i = 1; i <= xlen; i++){ c[i][0] = 0; } for(j = 0; j <= ylen; j++){ c[0][j] = 0; } for(i = 1; i <= xlen; i++){ for(j = 1;...
main.c:40:1: error: return type defaults to 'int' [-Wimplicit-int] 40 | main(){ | ^~~~ main.c: In function 'main': main.c:52:23: error: expected ';' before '}' token 52 | printf("%d",res) | ^ | ; 53 | } | ~
s762407826
p02235
C
#include<stdio.h> #include<string.h> #define MAX 1000 char x[MAX], y[MAX]; int c[MAX][MAX], res; void LCS(){ int xlen, ylen, i, j; xlen=strlen(x); ylen=strlen(y); for(i = 1; i <= xlen; i++){ c[i][0] = 0; } for(j = 0; j <= ylen; j++){ c[0][j] = 0; } for(i = 1; i <= xlen; i++){ for(j = 1;...
main.c:40:1: error: return type defaults to 'int' [-Wimplicit-int] 40 | main(){ | ^~~~ main.c: In function 'main': main.c:49:15: error: invalid suffix "XSxsx" on integer constant 49 | if(i != n-1XSxsx){ | ^~~~~~
s695843129
p02235
C
#include <stdio.h> #include <string.h> #define MAX 1000 void LCS_Length(char *high,char *width){ int k,l; int i,j; int c[MAX][MAX]; k = strlen(high); l = strlen(width); /*なぜか答えが合わないので追加*/ k=k+1; l=l+1; for(i = 0;i < k;i++){ c[i][0] = 0; } for(j=0;j<l;j++){ c[0][j] ...
main.c: In function 'main': main.c:55:5: error: 'retrn' undeclared (first use in this function) 55 | retrn 0; | ^~~~~ main.c:55:5: note: each undeclared identifier is reported only once for each function it appears in main.c:55:10: error: expected ';' before numeric constant 55 | retrn 0; ...
s336825348
p02235
C
#include <stdio.h> #include <string.h> #define MAX 1000 void LCS_Length(char *high,char *width){ int k,=0,l=0,i,j; int c[MAX][MAX]; k = strlen(high); l = strlen(width); /*なぜか答えが合わないので追加*/ k=k+1; l=l+1; for(i = 0;i < k;i++){ c[i][0] = 0; } for(j = 0;j < l; j++){ c[...
main.c: In function 'LCS_Length': main.c:7:9: error: expected identifier or '(' before '=' token 7 | int k,=0,l=0,i,j; | ^ main.c:13:5: error: 'l' undeclared (first use in this function) 13 | l = strlen(width); | ^ main.c:13:5: note: each undeclared identifier is reported only once ...
s393648646
p02235
C
#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++){ c[i][0]=0; } for(j=0;j<=y;j++){ c[0][j]=0; } for(i=1;i<=x;i++){ for(j=1;j<=y;j++){ if(len1[i-1]==len2[j-1]){ c[i][j]=c[i-1][j-1]+1; ...
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int] 7 | LCS(int x, int y){ | ^~~ main.c: In function 'LCS': main.c:35:14: error: 'X' undeclared (first use in this function) 35 | return c[X][Y]; | ^ main.c:35:14: note: each undeclared identifier is reported only once for...
s352524254
p02235
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int getLCS(char*, char*); main(){ char x[1001], y[1001]; int q, i; scanf("%d", &q); for (i = 0; i < q; i++){ scanf("%s%s", x, y); printf("%d\n", getLCS(x, y)); } return 0; } int getLCS(char *x, char *y){ int lengthX, lengthY, i, j, **arr, *tmpAr...
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int] 7 | main(){ | ^~~~ main.c: In function 'getLCS': main.c:35:62: error: expected expression before '?' token 35 | if (i == 0 || j == 0) arr[i][j] = 0; ??? | ...
s884648879
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 = 1; i <= m; i++) c[i][0] = 0; for(j = 0; j <= n; j++) c[0][j] = 0; for(i = 1; i <= m; i++){ for(j = 1; j <= n; j++){ if(x[...
main.c:46:5: error: redefinition of 'LCS' 46 | int LCS(char *x, char *y){ | ^~~ main.c:5:5: note: previous definition of 'LCS' with type 'int(char *, char *)' 5 | int LCS(char *x, char *y){ | ^~~ main.c:68:5: error: redefinition of 'main' 68 | int main(){ | ^~~~ main.c:27:5: note...
s424682856
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++){ for(j = 0; j <= n; j++){ if(i = 0 || j = 0) c[i][j] = 0; if(x[i] == y[j]) c[i+1][j+1] = c[i][j] + 1; ...
main.c: In function 'LCS': main.c:14:27: error: lvalue required as left operand of assignment 14 | if(i = 0 || j = 0) c[i][j] = 0; | ^
s541408516
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++){ for(j = 0; j <= n; j++){ if(i == 0 || j == 0) c[i][j] = 0; if(x[i] == y[j]) c[i+1][j+1] = c[i][j] + 1; ...
main.c: In function 'main': main.c:35:20: error: 'berak' undeclared (first use in this function) 35 | if(q == 0) berak; | ^~~~~ main.c:35:20: note: each undeclared identifier is reported only once for each function it appears in
s781825126
p02235
C
#include <stdio.h> #include <string.h> #define MAX 1005 int main() { int t, m, n, i, j, c[MAX][MAX]; char a[MAX], b[MAX]; scanf("%d", &t); while(t--){ scanf("%s", a); scanf("%s", b); m = strlen(a); n = strlen(b); for(i=1; i<=m; i++){ c[i][0] = 0; } for(j=0; j<=n; j++){ ...
main.c: In function 'main': main.c:25:20: error: 'x' undeclared (first use in this function) 25 | if(x[i-1] == y[j-1]){ | ^ main.c:25:20: note: each undeclared identifier is reported only once for each function it appears in main.c:25:30: error: 'y' undeclared (first use in t...
s028340965
p02235
C
#include<stdio.h> #include<string.h> #define _A_ 1 int main(){ int n,AC=0,i,j,A,B; int dp[1010][1010]; char A[1001],B[1001]; scanf("%d",&n); while(_A_){ if(AC == n)break; scanf("%s",A); scanf("%s",B); for(i=0;i<1010;i++)for(j=0;j<1010;j++)dp[i][j]=0; A=strlen(A); B=strlen(B); ...
main.c: In function 'main': main.c:9:8: error: conflicting types for 'A'; have 'char[1001]' 9 | char A[1001],B[1001]; | ^ main.c:7:18: note: previous declaration of 'A' with type 'int' 7 | int n,AC=0,i,j,A,B; | ^ main.c:9:16: error: conflicting types for 'B'; have 'char[1...
s459736296
p02235
C
#include <stdio.h> #include <string.h> void CSLength(char *,char *); int c[1000][1000],a[1000]; int main() { int i,j=0,q; char s[1000],x[1000],y[1000]; scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s",s); strcpy(&x[1],s); scanf("%s",s); strcpy(&y[1],s); CSLength(x,y); a[i]=c[strlen(x...
main.c:61:1: error: expected identifier or '(' before '}' token 61 | } | ^
s672519342
p02235
C
#include <stdio.h> #include <string.h> void CSLength(char *,char *); int c[1000][1000],a[1000]; int main() { int i,j=0,q; char s[1000],x[1000],y[1000]; scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s",s); strcpy(&x[1],s); scanf("%s",s); strcpy(&y[1],s); CSLength(x,y); printf("%d\n",=...
main.c: In function 'main': main.c:23:19: error: expected expression before '=' token 23 | printf("%d\n",=c[strlen(x)-1][strlen(y)-1]); | ^
s586073566
p02235
C
#include <stdio.h> #include <string.h> #define MAX 1000 int lcs(char *,char *); int main(){ int n,i; char A[MAX+1],B[MAX+1]; scanf("%d",&n); for(i=0;i<n;i++){ A[0]=' '; B[0]=' '; scanf("%s",&A[1]); scanf("%s",&B[1]); printf("%d\n",lcs(A,B)); } return 0; } int lcs(char *A,char *B){...
main.c:53:1: error: expected identifier or '(' before ']' token 53 | ] | ^
s716113123
p02235
C
#include<stdio.h> #include<string.h> #define N 1001 int n; int lcs(char x[],char y[]){ int i,j,a[N][N]; int m=strlen(x); int n=strlen(y); for(i=1;i<=m;i++) a[i][0]=0; for(j=0;j<=n;j++) a[0][j]=0; for(i=1;i<=m;i++){ for(j=1;j<=n;j++){ if(x[i-1]==y[j-1]) a[i][j]=a[i-1][j-1]+1; else if(a[i-1...
main.c: In function 'lcs': main.c:21:10: error: 'c' undeclared (first use in this function) 21 | return c[m][n]; | ^ main.c:21:10: note: each undeclared identifier is reported only once for each function it appears in
s546290714
p02235
C
#include<stdio.h> #include<string.h> #define max(a,b) (((a)>(b))?(a):(b)) struct Point{x,y}; int main(void){ int i,j,k; int q,tmp; Point len; int dp[1001][1001]={0}; char x[1001],y[1001]; scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s",x); scanf("%s",y); xlen=strlen(x...
main.c:5:14: error: expected specifier-qualifier-list before 'x' 5 | struct Point{x,y}; | ^ main.c: In function 'main': main.c:10:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type 10 | Point len; | ^~~~~ | struct main.c:17:9: error: 'xlen' ...
s755315309
p02235
C
` #include<stdio.h> #include<string.h> #define max(a,b) (((a)>(b))?(a):(b)) struct Node { int xl; int yl; }; struct Node len; int main(void){ int i,j,k; int q,tmp; int dp[1001][1001]={0}; char x[1001],y[1001]; scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s",x); scanf("%s",y)...
main.c:1:1: error: stray '`' in program 1 | ` | ^
s202624108
p02235
C
#include <stdio.h> #include <string.h> int lcs(char x[], char y[]){ int i,j; int m = strlen(x); int 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 = 0;i < m; i++){ for(j = 0;j < n; j++){ if(x[i] == y[j]) c[i][j] = c[i-1][j-1] + 1; else if(c[i-1][j]...
main.c: In function 'lcs': main.c:10:3: error: 'c' undeclared (first use in this function) 10 | c[i][0] = 0; | ^ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
s623068276
p02235
C
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 55 56 57 58 #include <stdio.h> #include <math.h> #include <string.h> #define MAX 1001 int LCS(char *, char *); int main() { int i, j, q; char X[MAX], Y[MAX]; ...
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 4 | ^ In file included from /usr/include/stdio.h:47, from main.c:57: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | ...
s313173448
p02235
C
#include <stdio.h> #include <string.h> int lcs(char x[], char y[]){ int i,j; int m = strlen(x); int 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 = 0;i < m; i++){ for(j = 0;j < n; j++){ if(x[i] == y[j]) c[i][j] = c[i-1][j-1] + 1; else if(c[i-1][j]...
main.c: In function 'lcs': main.c:10:3: error: 'c' undeclared (first use in this function) 10 | c[i][0] = 0; | ^ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:29:14: error: 'n' undeclared (first use in this function) ...
s467988997
p02235
C
#include <stdio.h> #include <string.h> int lcs(char x[], char y[]){ int i,j; int m = strlen(x); int 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 = 0;i < m; i++){ for(j = 0;j < n; j++){ if(x[i] == y[j]) c[i][j] = c[i-1][j-1] + 1; else if(c[i-1][j]...
main.c: In function 'lcs': main.c:10:3: error: 'c' undeclared (first use in this function) 10 | c[i][0] = 0; | ^ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:35:2: error: 'len1' undeclared (first use in this function)...
s593056023
p02235
C
#include <stdio.h> #include <string.h> int lcs(char x[], char y[]){ int i,j; int m = strlen(x); int 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 = 0;i < m; i++){ for(j = 0;j < n; j++){ if(x[i] == y[j]) c[i][j] = c[i-1][j-1] + 1; else if(c[i-1][j]...
main.c: In function 'lcs': main.c:10:3: error: 'c' undeclared (first use in this function) 10 | c[i][0] = 0; | ^ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:38:20: error: passing argument 1 of 'lcs' makes pointer fro...
s376250514
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; i++) c...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s678091475
p02235
C
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 #include<stdio.h> #include<string.h> #define N 1001 int LCS_Length(char [] ,char []); char X[N],Y[N]; int c[N][N]; int x,y; int main(void){ int i; int n; scanf("%d",&n); for(i=1;i<=n;i++){ ...
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 15 | ^~ In file included from /usr/include/stdio.h:47, from main.c:39: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | ...
s955722735
p02235
C
#include<stdio.h> #include<string.h> int c[N][N]; int lcs(char x[], char y[]){ int m, i, n, j; m = strlen(x); n = strlen(y); for(i = 1; i < m; i++) c[i][0] = 0; for(j = 0; j < n; j++) c[0][j] = 0; for(i = 1; i < m; i++){ for(j = 1; j < n; j++){ if(x[i] == y[j]) c[i][j] = c[i][j] + 1; else ...
main.c:4:7: error: 'N' undeclared here (not in a function) 4 | int c[N][N]; | ^ main.c: In function 'lcs': main.c:25:1: error: expected declaration or statement at end of input 25 | return c[m][n]; | ^~~~~~
s940415320
p02235
C
#include <stdio.h> int main() { char X[100], Y[100]; int a[101][10 1] = {0}; int c[150] = {0}; int q, xlen, ylen, i, j, k; scanf("%d", &q); for (k = 0; k < q; k++) { scanf("%s", X); scanf("%s", Y); xlen = strlen(X); ylen = strlen(Y); //?????????????????´????????? for (i = 0; i < xlen; i++) { ...
main.c: In function 'main': main.c:6:22: error: expected ']' before numeric constant 6 | int a[101][10 | ^ | ] 7 | 1] = {0}; | ~ main.c:16:24: error: implicit declaration of function 'strlen' [-Wimplicit-function-de...
s621719147
p02235
C
#include <stdio.h> int main() { char X[100], Y[100]; int a[101][10]; 1] = {0}; int c[150] = {0}; int q, xlen, ylen, i, j, k; scanf("%d", &q); for (k = 0; k < q; k++) { scanf("%s", X); scanf("%s", Y); xlen = strlen(X); ylen = strlen(Y); //?????????????????´????????? for (i = 0; i < xlen; i++) ...
main.c: In function 'main': main.c:7:10: error: expected ';' before ']' token 7 | 1] = {0}; | ^ | ; main.c:7:10: error: expected statement before ']' token main.c:7:12: error: expected expression before '=' token 7 | 1] = {0}; | ^ main.c:16:24: erro...
s537616003
p02235
C
#include <stdio.h> int main() { char X[150][1000]; char Y[150][1000]; int figureXY[1001][1001] = { 0 }; int longX, longY; int dataSetN; int max; int i, j, k; longX = 0; longY = 0; max = 0; scanf_s("%d", &dataSetN); for (i = 0; i < dataSetN; i++) { scanf_s("%s", X[i], 2000); scanf_s("%s", Y[i], 2000); ...
main.c: In function 'main': main.c:14:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 14 | scanf_s("%d", &dataSetN); | ^~~~~~~ | scanf main.c:20:26: warning: comparison between pointer and integer 20 | for (i...
s045913390
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { m = strlen(x); n = strlen(y); int c; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) c[i][j...
main.c: In function 'LCS': main.c:5:2: error: 'm' undeclared (first use in this function) 5 | m = strlen(x); | ^ main.c:5:2: note: each undeclared identifier is reported only once for each function it appears in main.c:6:2: error: 'n' undeclared (first use in this function) 6 | n = strlen(y); | ...
s545034423
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { m = strlen(x); n = strlen(y); int c; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) c[i][j...
main.c: In function 'LCS': main.c:5:2: error: 'm' undeclared (first use in this function) 5 | m = strlen(x); | ^ main.c:5:2: note: each undeclared identifier is reported only once for each function it appears in main.c:6:2: error: 'n' undeclared (first use in this function) 6 | n = strlen(y); | ...
s669781852
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { m = strlen(x); n = strlen(y); int c; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) c[i][j...
main.c: In function 'LCS': main.c:5:2: error: 'm' undeclared (first use in this function) 5 | m = strlen(x); | ^ main.c:5:2: note: each undeclared identifier is reported only once for each function it appears in main.c:6:2: error: 'n' undeclared (first use in this function) 6 | n = strlen(y); | ...
s501006465
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { m = strlen(x); n = strlen(y); int c; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) c[i][j...
main.c: In function 'LCS': main.c:5:2: error: 'm' undeclared (first use in this function) 5 | m = strlen(x); | ^ main.c:5:2: note: each undeclared identifier is reported only once for each function it appears in main.c:6:2: error: 'n' undeclared (first use in this function) 6 | n = strlen(y); | ...
s750450872
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { m = strlen(x); n = strlen(y); int c; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) c[i][...
main.c: In function 'LCS': main.c:6:2: error: 'm' undeclared (first use in this function) 6 | m = strlen(x); | ^ main.c:6:2: note: each undeclared identifier is reported only once for each function it appears in main.c:7:2: error: 'n' undeclared (first use in this function) 7 | n = strlen(y); | ...
s744031913
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { int m = strlen(x); int n = strlen(y); int c[][]; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i][j-1]) ...
main.c: In function 'LCS': main.c:8:5: error: array type has incomplete element type 'int[]' 8 | int c[][]; | ^ main.c:8:5: note: declaration of 'c' as multidimensional array must have bounds for all dimensions except the first main.c:10:5: error: 'i' undeclared (first use in this function) 10 | for(i=...
s368149255
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { int m = strlen(x); int n = strlen(y); int c[1000][1000]; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j] >= c[i]...
main.c: In function 'LCS': main.c:10:5: error: 'i' undeclared (first use in this function) 10 | for(i=0;i<m;i++) | ^ main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in main.c:12:16: error: expected ')' before ';' token 12 | for(i=0;i<n;i++;) | ~ ...
s483036054
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { int m = strlen(x); int n = strlen(y); int c[1000][1000]; int i, j; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j...
main.c: In function 'LCS': main.c:12:16: error: expected ')' before ';' token 12 | for(i=0;i<n;i++;) | ~ ^ | ) main.c:21:26: error: expected ';' before '}' token 21 | c[i][j] = c[i][j-1] | ^ | ; 22 | }...
s416826035
p02235
C
#include<stdio.h> #include<string.h> int LCS(char x[], char y[]) { int m = strlen(x); int n = strlen(y); int c[1000][1000]; int i, j; for(i=0;i<m;i++) c[i][0] = 0; for(i=0;i<n;i++;) c[0][i] = 0; for(i=1;i<m;i++){ for(j=1;j<n;j++){ if( x[i-1] == y[j-1] ) c[i][j] = c[i-1][j-1] +1; else if( c[i-1][j...
main.c: In function 'LCS': main.c:12:16: error: expected ')' before ';' token 12 | for(i=0;i<n;i++;) | ~ ^ | ) main.c: In function 'main': main.c:34:21: error: passing argument 1 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types] 34 | printf("%d", LCS...
s217354635
p02235
C
#include <stdio.h> #include <string.h> int main(void) { int q, i, j, k, m, n, c[1001][1001], i2, j2; char x[150][1001], y[150][1001]; scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%s", x[i]); scanf("%s", y[i]); } for (k = 0; k < q; k++) { m = strlen(x[k]); n = strlen(y[k]); for (i ...
main.c: In function 'main': main.c:39:3: error: expected declaration or statement at end of input 39 | } | ^
s062621893
p02235
C
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 100; 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; // X[0]?????????????????\ Y = ' ' + Y; // Y[0]?????????????????\ for (int i = 1; i ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s924067497
p02235
C
#include<stdio.h> #include<ctype.h> int main(){ int q, i; char X[1001], Y[1001], Z[150]; int C[1001][1001], maxl, xi, yi, i, j, ii; scanf("%d", &q); for( ii = 0; ii < q; ii++){ scanf("%s", X); scanf("%s", Y); /*????????°*/ xi = 0; while(X[xi]){ xi++; } yi = 0; ...
main.c: In function 'main': main.c:8:36: error: redeclaration of 'i' with no linkage 8 | int C[1001][1001], maxl, xi, yi, i, j, ii; | ^ main.c:6:10: note: previous declaration of 'i' with type 'int' 6 | int q, i; | ^
s767797885
p02235
C
#include<stdio.h> #include<ctype.h> int main(){ int q, i; char X[1001], Y[1001], Z[150]; int C[1001][1001], maxl, xi, yi, i, j, ii; scanf("%d", &q); for( ii = 0; ii < q; ii++){ scanf("%s", X); scanf("%s", Y); /*????????°*/ xi = 0; while(X[xi]){ xi++; } yi = 0; ...
main.c: In function 'main': main.c:8:36: error: redeclaration of 'i' with no linkage 8 | int C[1001][1001], maxl, xi, yi, i, j, ii; | ^ main.c:6:10: note: previous declaration of 'i' with type 'int' 6 | int q, i; | ^
s940553952
p02235
C
#include<stdio.h> #include<ctype.h> int main(){ int q, i; char X[1001], Y[1001]; int C[1001][1001], Z[150], maxl, xi, yi, i, j, ii; scanf("%d", &q); for( ii = 0; ii < q; ii++){ scanf("%s", X); scanf("%s", Y); /*????????°*/ xi = 0; while(X[xi]){ xi++; } yi = 0; ...
main.c: In function 'main': main.c:8:44: error: redeclaration of 'i' with no linkage 8 | int C[1001][1001], Z[150], maxl, xi, yi, i, j, ii; | ^ main.c:6:10: note: previous declaration of 'i' with type 'int' 6 | int q, i; | ^
s222135748
p02235
C
#include<stdio.h> #include<ctype.h> int main(){ int q, i; char X[1001], Y[1001], Z[150]; int C[1001][1001], maxl, xi, yi, i, j, ii; scanf("%d", &q); for( ii = 0; ii < q; ii++){ scanf("%s", X); scanf("%s", Y); /*????????°*/ xi = 0; while(X[xi]){ xi++; } yi = 0; ...
main.c: In function 'main': main.c:8:36: error: redeclaration of 'i' with no linkage 8 | int C[1001][1001], maxl, xi, yi, i, j, ii; | ^ main.c:6:10: note: previous declaration of 'i' with type 'int' 6 | int q, i; | ^
s614611380
p02235
C
#include<stdio.h> #include<string.h> int lcs(char X, char Y) { int c[1000+1][1000+1]; int m, n, max = 0; m = strlen(X); n = strlen(Y); for (i = 1; i < m; i++) { c[i][0] = 0; } for (j = 1; j < n; j++) { c[0][j] = 0; } for (i = 1; i < m; i++) { for (j = 1; j < n; j++) { ...
main.c: In function 'lcs': main.c:8:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion] 8 | m = strlen(X); | ^ | | | char In file included from main.c:2: /usr/include/string.h:407:35: note: expected 'co...
s508478902
p02235
C
#include<stdio.h> #include<string.h> void lcs(char X, char Y) { int c[1000+1][1000+1]; int i, j, m, n, max = 0; m = strlen(X); n = strlen(Y); for (i = 1; i < m; i++) { c[i][0] = 0; } for (j = 1; j < n; j++) { c[0][j] = 0; } for (i = 1; i < m; i++) { for (j = 1; j < n; j++) {...
main.c: In function 'lcs': main.c:8:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion] 8 | m = strlen(X); | ^ | | | char In file included from main.c:2: /usr/include/string.h:407:35: note: expected 'co...
s935212892
p02235
C
#include<stdio.h> #include<string.h> #define L 1001 ???? int n; ???? int lcs(char X[],char Y[]){ ????int i,j,c[L][L]; ????int m=strlen(X); ????int n=strlen(Y); ????for(i=1;i<=m;i++) c[i][0]=0; ????for(j=0;j<=n;j++) c[0][j]=0; ????for(i=1;i<=m;i++){ ????????for(j=1;j<=n;j++){ ????????????if(X[i-1]==Y[j-1]){ ????????c[i]...
main.c:4:1: error: expected identifier or '(' before '?' token 4 | ???? | ^ main.c:6:1: error: expected identifier or '(' before '?' token 6 | ???? | ^ main.c:24:1: error: expected identifier or '(' before '?' token 24 | ???? | ^
s074002087
p02235
C
#include<stdio.h> #include<string.h> int lcs(char X, char Y); int main () { char s1, s2; int n, i; scanf("%d\n", &n); for (i = 0; i < n; i++) { scanf ("%s", s1); scanf ("%s", s2); printf("%d\n", lcs(s1, s2)); } return 0; } int lcs(char X, char Y) { int c[1000+1][1000+1]; int...
main.c: In function 'lcs': main.c:25:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion] 25 | m = strlen(X); | ^ | | | char In file included from main.c:2: /usr/include/string.h:407:35: note: expected 'c...
s997690308
p02235
C
#include <stdio.h> #include <string.h> char X[2000], Y[2000]; int main() { int i, j, m, n; int a = strlen(X); int b = strlen(Y); scanf("%d", &m); scanf("%d", &n); int c[a+1][b+1]; for(i = 0;i < m;i++){ scanf("%s", X); } for(j = 0; j < n; j++){ scanf("%s", Y); } ...
main.c: In function 'main': main.c:28:21: error: subscripted value is neither array nor pointer nor vector 28 | else if(X[i-1][j] >= Y[i][j-1]){ | ^ main.c:28:32: error: subscripted value is neither array nor pointer nor vector 28 | else if(X[i-1][j] >= Y[i][j-1]){ | ...
s448411709
p02235
C
#include<stdio.h> #include<string.h> int lcs(char s1[], char s2[]); int main () { char s1[1001], s2[1001]; int n, i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf ("%s", s1); scanf ("%s", s2); printf("%d\n", lcs(s1, s2)); } return 0; } int lcs(char s1[], char s2[]) { int c[10...
main.c: In function 'lcs': main.c:24:15: error: 'X' undeclared (first use in this function) 24 | m = strlen(X); | ^ main.c:24:15: note: each undeclared identifier is reported only once for each function it appears in main.c:25:15: error: 'Y' undeclared (first use in this function) 25 | n...
s012449154
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++){ ??...
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ???????? | ^ main.c:25:1: error: expected identifier or '(' before '?' token 25 | ???????? | ^
s978823752
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...
main.c:4:1: error: expected identifier or '(' before '?' token 4 | ?? | ^ main.c:6:1: error: expected identifier or '(' before '?' token 6 | ?? | ^ main.c:27:1: error: expected identifier or '(' before '?' token 27 | ?? | ^
s866293029
p02235
C
#include <stdio.h> #include <string.h> #define MAX 1000 void LCSLength(char *X, char *Y){ int i,j; int m = strlen(X); int n = strlen(Y); int c[m+1][n+1]; for( i = 0 ; i <= m ; i++ ){ for( j = 0 ; j <= n ;j++ ){ c[i][j] = 0; } } for( i = 1 ; i <= m ; i++ ){ ...
main.c:36:1: error: expected identifier or '(' before '}' token 36 | } | ^
s883341434
p02235
C
#include<stdio.h> #include<string.h> #include<math.h> static const int N = 1000; int lcs(char X[], char Y[], int m ,int n) { int c[N + 1][N +1]; int maxl = 0,i,j; strcmp(&X[0], ` `); strcmp(&Y[0], ` `); for(i=1;i<=m;i++) c[i][0]=0; for(j=1;j<=n;j++) c[0][j]=0; for(i = 1;i <=m; i++) { for(j = 1;j <...
main.c: In function 'lcs': main.c:11:17: error: stray '`' in program 11 | strcmp(&X[0], ` `); | ^ main.c:11:19: error: stray '`' in program 11 | strcmp(&X[0], ` `); | ^ main.c:11:20: error: expected expression before ')' token 11 | strcmp(&X[0], ` `); |...
s950343115
p02235
C
#include<stdio.h> #include<string.h> #include<math.h> static const int N = 1000; int lcs(char X[], char Y[], int m ,int n) { int c[N + 1][N +1]; int maxl = 0,i,j; strcmp(&X[0], ` `); strcmp(&Y[0], ` `); for(i=1;i<=m;i++) c[i][0]=0; for(j=1;j<=n;j++) c[0][j]=0; for(i = 1;i <=m; i++) { for(j = 1;j <...
main.c: In function 'lcs': main.c:11:17: error: stray '`' in program 11 | strcmp(&X[0], ` `); | ^ main.c:11:19: error: stray '`' in program 11 | strcmp(&X[0], ` `); | ^ main.c:11:20: error: expected expression before ')' token 11 | strcmp(&X[0], ` `); |...
s804115904
p02235
C
include<stdio.h> #include<string.h> #define N 1000 int longco(char X[],char Y[]) { int A[N+1][N+1]; int i,j; int m=strlen(X); int n=strlen(Y); int max=0; X[0]=' '; Y[0]=' '; for(i=1;i<=m;i++)A[i][0]=0; for(j=1;j<=n;j++)A[0][j]=0; for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { i...
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ...
s750274927
p02235
C
#include<stdio.h> #include<string.h> #define N 10000 char x[N],y[N]; void LCS() { int a,b,i,j,c[N][N]; a = strlen(x); b = strlen(y); for(i=1; i<=a; i++) c[i][0] = 0; for(j=1; j<=b; j++) c[0][j] = 0; for(i=1; i<=a; i++) { for(j=1; j<=b; j++) { if(x[i-1] == y[j-1]) c[i][j] = c[i-1][j-1] + 1; e...
main.c: In function 'LCS': main.c:19:19: error: 'm' undeclared (first use in this function) 19 | printf("%d\n",c[m][n]); | ^ main.c:19:19: note: each undeclared identifier is reported only once for each function it appears in main.c:19:22: error: 'n' undeclared (first use in this function) ...
s374448796
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=0;j<=n;j++)c[0][j]=0; for(int i=1;i<=m;i++){ f...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s081173340
p02235
C
#include <stdio.h> #include <string.h> ??#define MAX 1000 ??char X[MAX], Y[MAX]; ?? int LCS() { ????????int i, j; ????????int m = strlen(X); ????????int n = strlen(Y); ????????int c[m + 1][n + 1]; ?? ????????for (i = 1; i <= m; i++) c[i][0] = 0; ????????for (j = 0; j <= n; j++) c[0][j] = 0; ?? ????????for (i = 1; i <= ...
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ??#define MAX 1000 | ^ main.c:3:3: error: stray '#' in program 3 | ??#define MAX 1000 | ^ main.c:5:1: error: expected identifier or '(' before '?' token 5 | ?? | ^ main.c:29:1: error: expected identifier or '(' before '?'...
s216921946
p02235
C
#include <stdio.h> #include <string.h> ??#define MAX 1000 ??char X[MAX], Y[MAX]; ?? int LCS() { ????????int i, j; ????????int m = strlen(X); ????????int n = strlen(Y); ????????int c[m + 1][n + 1]; ?? ????????for (i = 1; i <= m; i++) c[i][0] = 0; ????????for (j = 0; j <= n; j++) c[0][j] = 0; ?? ????????for (i = 1; i <= ...
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ??#define MAX 1000 | ^ main.c:3:3: error: stray '#' in program 3 | ??#define MAX 1000 | ^ main.c:5:1: error: expected identifier or '(' before '?' token 5 | ?? | ^ main.c:29:1: error: expected identifier or '(' before '?'...