submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s990577679
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++ ) { ...
a.cc:8:1: error: expected ',' or ';' before 'int' 8 | int lcs(string x, string y) { | ^~~ a.cc: In function 'int main()': a.cc:36:13: error: 'lcs' was not declared in this scope 36 | cout << lcs(s1, s2) << endl; | ^~~
s269110743
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; int las(string x, string y) { int c[N + 1][N + 1]; int m = x.size(); int n = y.size(); int mail = 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] = ...
a.cc: In function 'int las(std::string, std::string)': a.cc:25:1: error: 'maxl' was not declared in this scope; did you mean 'mail'? 25 | maxl = max(maxl, c[i][j]); | ^~~~ | mail a.cc: In function 'int main()': a.cc:37:9: error: 'les' was not declared in this scope; did you mean 'las'? 37 | cout << le...
s935183152
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; int las(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] ...
a.cc: In function 'int las(std::string, std::string)': a.cc:29:8: error: 'mail' was not declared in this scope; did you mean 'maxl'? 29 | return mail; | ^~~~ | maxl a.cc: In function 'int main()': a.cc:37:9: error: 'les' was not declared in this scope; did you mean 'las'? 37 | cout << le...
s080719225
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; int las(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...
a.cc: In function 'int main()': a.cc:37:9: error: 'lcs' was not declared in this scope; did you mean 'las'? 37 | cout << lcs(s1, s2) << endl; | ^~~ | las
s278936105
p02235
C++
#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 = 0; j <= n; j++) c[0][j] = 0; for(int i = 1;...
a.cc: In function 'int main()': a.cc:33:9: error: 'cin' was not declared in this scope 33 | cin >> n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> 3 | usin...
s469294749
p02235
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cassert> #include <string> #include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <algorithm> using namespace std; // --------------------- // repetition #define FOR(i,a,b) for(int...
a.cc:39:21: error: macro "FOR" requires 3 arguments, but only 2 given 39 | FOR(i, strlen(S)) { | ^ a.cc:19:9: note: macro "FOR" defined here 19 | #define FOR(i,a,b) for(int i=(a);i<(b);++i) | ^~~ a.cc:40:23: error: macro "FOR" requires 3 arguments, but only 2 given 4...
s680789976
p02235
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int lcs(string str1, string str2) { int len[1001][1001] = { 0 }; int len1 = str1.size(); int len2 = str2.size(); str1 = ' ' + str1; str2 = ' ' + str2; for (int i = 0; i <= len1; i++) for (int j = 0; j <= len2; j++) len[i][l] = 0; ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:16:56: error: 'l' was not declared in this scope 16 | for (int j = 0; j <= len2; j++) len[i][l] = 0; | ^
s412596308
p02235
C++
#include<iostream> #include<string> #include<cstring> #include<cstdlib> #define MAX_N 1000 int solve(std::string s,std::string t){ int dp[MAX_N][MAX_N]={0}; int n,m; n=s.size(),m=t.size(); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(s[i]==t[j])...
a.cc: In function 'int solve(std::string, std::string)': a.cc:16:46: error: 'max' was not declared in this scope; did you mean 'std::max'? 16 | dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]); | ^~~ | ...
s740104150
p02235
C++
#include<iostream> #include<string> #include<cstring> #include<cstdlib> #define MAX_N 1000 int solve(std::string s,std::string t){ int dp[MAX_N][MAX_N]={0}; int n,m; n=s.size(); m=t.size(); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(s[i...
a.cc: In function 'int solve(std::string, std::string)': a.cc:17:46: error: 'max' was not declared in this scope; did you mean 'std::max'? 17 | dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]); | ^~~ | ...
s317915575
p02235
C++
#include<iostream> #include<string> #include<cstring> #include<cstdlib> #define MAX_N 1000 int solve(std::string s,std::string t){ int dp[MAX_N][MAX_N]={0}; int n,m; n=s.size(); m=t.size(); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(s[i...
a.cc: In function 'int solve(std::string, std::string)': a.cc:17:46: error: 'max' was not declared in this scope; did you mean 'std::max'? 17 | dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]); | ^~~ | ...
s231989413
p02235
C++
#include <iostream> #include <string> using namespace std; int lcs(string X, string Y) { int dp[1000 + 1][1000 + 1]; int max = 0; int m = X.size; int n = Y.size(); X = ' ' + X; Y = ' ' + Y; for (unsigned int i = 1; i <= m; i++) dp[i][0] = 0; for (unsigned int i = 1; i <= n; i++) dp[0][i] = 0; ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:8:13: 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'} t...
s492500097
p02235
C++
#include <iostream> #include <string> using namespace std; int lcs(string X, string Y) { int max = 0; int n = X.size(); int m = Y.size(); int dp[1000+1][1000+1]; X = ' '+X; Y = ' '+Y; for(int i = 1:i <= n; i++) dp[i][0] = 0; for(int i = 1; i <= m; i++) dp[0][i] = 0; for(int i = 1; i <= n; i++) { for(int j = 1; j <...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:14:11: error: initializer in range-based 'for' loop 14 | for(int i = 1:i <= n; i++) | ^ a.cc:14:21: error: expected ')' before ';' token 14 | for(int i = 1:i <= n; i++) | ~ ^ | ) a.cc:14:2...
s834323455
p02235
C++
#include <iostream> #include <string> #include <algorithm> #define N 1000 int lsc(string x,string y){ int c[N+1][N+1]; int m=x.size(); int n=y.size(); int maxl=0; 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:7:9: error: 'string' was not declared in this scope 7 | int lsc(string x,string y){ | ^~~~~~ a.cc:7:9: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, ...
s828181322
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; void lcs(string *x, string y){ int c[N + 1][N + 1], max = 0, i, j; int m = x.size; int n = y.size; x = ' ' + x; y = ' ' + y; for(i = 1; i <= m; i++) c[i][0] = 0; for(i = 1; i <= n; i++) c[0][i] =...
a.cc: In function 'void lcs(std::string*, std::string)': a.cc:9:13: error: request for member 'size' in 'x', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?) 9 | int m = x.size; | ^~~~ a.cc:10:13: error: cannot convert 'std::__cxx1...
s223275324
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], max = 0, i, j; int m = x.size(); int n = y.size(); x = ' ' + x; y = ' ' + y; for(i = 1; i <= m; i++) c[i][0] = 0; for(i = 1; i <= n; i++) c[0][i]...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:21:25: error: 'max' cannot be used as a function 21 | else c[i][j] = max(c[i - 1][j], c[i][j - 1]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:22:16: error: 'max' cannot be used as a function 22 | max = max(max, c[i][j]);...
s954348626
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], maxl = 0, i, j; int m = x.size(); int n = y.size(); x = ' ' + x; y = ' ' + y; for(i = 1; i <= m; i++) c[i][0] = 0; for(i = 1; i <= n; i++) c[0][i...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:22:17: error: no matching function for call to 'max(<unresolved overloaded function type>, int&)' 22 | maxl = max(max, c[i][j]); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/inc...
s598310726
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], maxl = 0, i, j; int m = x.size(); int n = y.size(); x = ' ' + x; y = ' ' + y; for(i = 1; i <= m; i++) c[i][0] = 0; for(i = 1; i <= n; i++) c[0][i...
a.cc:41:3: error: expected unqualified-id before 'for' 41 | for(i = 0; i < q; i++){ | ^~~ a.cc:41:14: error: 'i' does not name a type 41 | for(i = 0; i < q; i++){ | ^ a.cc:41:21: error: 'i' does not name a type 41 | for(i = 0; i < q; i++){ | ^ a.cc:45:...
s601900229
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], maxl = 0, i, j; int m = x.size(); int n = y.size(); x = ' ' + x; y = ' ' + y; for(i = 1; i <= m; i++) c[i][0] = 0; for(i = 1; i <= n; i++) c[0][i...
a.cc:18:27: error: stray '#' in program 18 | for(i = 1; i <= m; i++){#include <iostream> | ^ a.cc: In function 'int lcs(std::string, std::string)': a.cc:18:28: error: 'include' was not declared in this scope 18 | for(i = 1; i <= m; i++){#include <iostream> | ...
s504754711
p02235
C++
#include <bits/stdc++.h> #define REP0(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define REPB0(i,n) for(int i=n-1;i>=0;i--) #define REPB1(i,n) for(int i=n;i>0;i--) #define llong long long #define INF 2000000000 #define NIL -1 #define N 1000 using namespace std; int LCS(string X,string Y){ int C...
a.cc: In lambda function: a.cc:23:37: error: expected '{' before '[' token 23 | else C[i][j]=max(C[i-1][j],[i][j-1]); | ^ a.cc: In function 'int LCS(std::string, std::string)': a.cc:23:37: error: no match for 'operator[]' (operand types are 'LCS(std::string, std::strin...
s832177399
p02235
C++
#include<bits/stdc++.h> #define ll long long int #define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define REP(i,n) FOR(i,0,n) #define REP1(i,n) FOR(i,1,n) 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 ...
a.cc: In function 'int Lcs(std::string, std::string)': a.cc:18:22: error: 'j' was not declared in this scope 18 | REP(i, n + 1) c[0][j] = 0; | ^
s080887492
p02235
C++
#include "stdafx.h" #include<iostream> #include<algorithm> #include<string> 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...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s904984061
p02235
C++
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 #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; ...
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 11 | ^~ 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...
s922017456
p02235
C++
#include<iostream> using namespce std; int main() { int n,i; int a[25]; cin >> n; for(i=0;i<n;i++){ cin >> a[i]; } }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n; | ^~~ | std::cin In file included fro...
s875928285
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main () { int N, m, n, i, j, k, c[1001][1001]; string x, y; cin >> N; for (k = 0; k < n; k++) { cin >> x >> y; m = x.size (); n = y.size (); for (i = 1; i < m + 1; i++) { fo...
a.cc: In function 'int main()': a.cc:31:15: error: 'p' was not declared in this scope 31 | cout << c[p][q] << endl; | ^ a.cc:31:18: error: 'q' was not declared in this scope 31 | cout << c[p][q] << endl; | ^
s046430143
p02235
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int lcs(string X, string Y){ int c[1001][1001]; 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;i <= n;j++) c[0][j] = 0; for(int i = 1;i <=m;i...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:14:17: error: 'i' was not declared in this scope 14 | for(int j = 1;i <= n;j++) c[0][j] = 0; | ^
s708938953
p02235
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int lcs(string X, string Y){ int c[1001][1001]; 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;i <= n;j++) c[0][j] = 0; for(int i = 1;i <=m;i...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:14:17: error: 'i' was not declared in this scope 14 | for(int j = 1;i <= n;j++) c[0][j] = 0; | ^
s628400776
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int lcs (string x, string y) { int m, n, c[1001][1001], i, j, maxl = 0; m = x.size(); n = y.size(); x = ' ' + x; Y = ' ' + y; for (i = 0; i <= m; i++) { c[i][0] = 0; } for (j = 1; j <= n; j++) { ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:15:5: error: 'Y' was not declared in this scope 15 | Y = ' ' + y; | ^ a.cc:33:28: error: no matching function for call to 'max(<unresolved overloaded function type>, int&)' 33 | maxl = max (max, c[i][j]); | ...
s537703278
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int lcs (string x, string y) { int m, n, c[1001][1001], i, j, maxl = 0; m = x.size(); n = y.size(); x = ' ' + x; y= ' ' + y; for (i = 0; i <= m; i++) { c[i][0] = 0; } for (j = 1; j <= n; j++) { ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:33:28: error: no matching function for call to 'max(<unresolved overloaded function type>, int&)' 33 | maxl = max (max, c[i][j]); | ~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s319801959
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int lcs (string x, string y) { int m, n, c[1001][1001], i, j, maxl = 0; m = x.size(); n = y.size(); x = ' ' + x; y= ' ' + y; for (i = 0; i <= m; i++) { c[i][0] = 0; } for (j = 1; j <= n; j++) { ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:33:33: error: expected ')' before 'c' 33 | maxl = max (maxl c[i][j]); | ~ ^~ | ) a.cc:33:28: error: no matching function for call to 'max(int&)' 33 | ...
s691328099
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int lcs (string x, string y) { int m, n, c[1001][1001], i, j, maxl = 0; m = x.size(); n = y.size(); x = ' ' + x; y= ' ' + y; for (i = 0; i <= m; i++) { c[i][0] = 0; } for (j = 1; j <= n; j++) { ...
a.cc: In function 'int main()': a.cc:51:21: error: 'n' was not declared in this scope 51 | for (i = 0; i < n; i++) { | ^
s369637264
p02235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int lcs (string x, string y) { int m, n, c[1001][1001], i, j, maxl = 0; m = x.size(); n = y.size(); x = ' ' + x; y= ' ' + y; for (i = 0; i <= m; i++) { c[i][0] = 0; } for (j = 1; j <= n; j++) { ...
a.cc: In function 'int main()': a.cc:51:22: error: expected ';' before 'i' 51 | for (i = 0; i < N i++) { | ^~ | ;
s572773769
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; int longestCommonSubsequence(string X, stringY) { int c[N + 1][N + 1]; int m = X.size(); int n = Y.size(); intmax1 = 0; X = ' ' + X; Y = ' ' + Y; for (int i = 0; i <= m; i++) c[i][0] = 0; f...
a.cc:8:40: error: 'stringY' has not been declared 8 | int longestCommonSubsequence(string X, stringY) { | ^~~~~~~ a.cc: In function 'int longestCommonSubsequence(std::string, int)': a.cc:11:11: error: 'Y' was not declared in this scope 11 | int n = Y.size(); ...
s588913223
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int N = 1000; int longestCommonSubsequence(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 = 0; i <= m; i++) c[i][0] = 0; ...
a.cc: In function 'int longestCommonSubsequence(std::string, std::string)': a.cc:18:5: error: 's' was not declared in this scope 18 | s[0][j] = 0; | ^ a.cc: In function 'int main()': a.cc:42:3: error: return-statement with no value, in function returning 'int' [-fpermissive] 42 | return ; | ...
s619553615
p02235
C++
#include <stdio.h> #include <string.h> void Ics(char *X, char *Y) { int c[1000][1000]; int m, n, i, 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+...
a.cc: In function 'void Ics(char*, char*)': a.cc:12:28: error: expected ';' before ')' token 12 | for ( i = 1; i <= m, i++ ) { | ^~ | ;
s172023657
p02235
C++
#include <stdio.h> int judge(char A[], char B[]){ int a=0, b=0, sw=0, ans=0; int i, j; int C[1001][1001]; while(sw == 0){ if(A[a] != '\0') a++; else sw = 1; } sw = 0; while(sw = 0){ if(B[b] != '\0') b++; else sw = 1; } for(i=1; i<a+1; i++) C[i][...
a.cc: In function 'int judge(char*, char*)': a.cc:29:17: error: expected ';' before 'i' 29 | for(i=1; i<a+1 i++){ | ^~ | ; a.cc:33:21: error: two consecutive '[' shall only introduce an attribute before '[' token 33 | else if(C[i-1][[j] >= C[i][j-1]) | ...
s438427104
p02235
C++
#include <stdio.h> int judge(char A[], char B[]){ int a=0, b=0, sw=0, ans=0; int i, j; int C[1001][1001]; while(sw == 0){ if(A[a] != '\0') a++; else sw = 1; } sw = 0; while(sw = 0){ if(B[b] != '\0') b++; else sw = 1; } for(i=1; i<a+1; i++) C[i][...
a.cc: In function 'int judge(char*, char*)': a.cc:33:21: error: two consecutive '[' shall only introduce an attribute before '[' token 33 | else if(C[i-1][[j] >= C[i][j-1]) | ^ a.cc:33:21: error: expected ')' before '[' token 33 | else if(C[i-1][[j] >= C[i][j-1]) | ...
s289176858
p02235
C++
#include <iostream> #include <algorithm> using namespace std; int LCS(char *x,char *y); char x[1000], y[1000]; int lcs[1000][1000]; int main() { int q,i,j; cin >> q; for (i = 0; i < q; i++) { cin >> x; cin >> y; cout << LCS(x, y) << endl; } } int LCS(char *x, char *y) { int i, j; int len_x, len_y; len_x ...
a.cc: In function 'int LCS(char*, char*)': a.cc:23:17: error: 'strlen' was not declared in this scope 23 | len_x = strlen(x); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+...
s183519501
p02235
C++
#include<iostream> #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 = 0; i <= m; i++ ) c[i][0] = 0; for ( int j ...
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/...
s076334780
p02235
C++
#include <iostream> #include <algorithm> using namespace std; int LCS(char *x,char *y); char x[1000], y[1000]; int lcs[1000][1000]; int main() { int q,i,j; cin >> q; for (i = 0; i < q; i++) { cin >> x; cin >> y; cout << LCS(x, y) << endl; } } int LCS(char *x, char *y) { int i, j; int len_x, len_y; len_x ...
a.cc: In function 'int LCS(char*, char*)': a.cc:23:17: error: 'strlen' was not declared in this scope 23 | len_x = strlen(x); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+...
s262066542
p02235
C++
#include<iostream> #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 = 0; i <= m; i++ ) c[i][0] = 0; for ( int j ...
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/...
s553247212
p02235
C++
#include<iostream> #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 = 0; i <= m; i++ ) c[i][0] = 0; for ( int ...
a.cc:4:7: error: expected nested-name-specifier before 'namespase' 4 | using namespase std; | ^~~~~~~~~ a.cc:7:10: error: 'string' was not declared in this scope 7 | int lcs( string X, string Y ) { | ^~~~~~ a.cc:7:10: note: suggested alternatives: In file included from /usr/include/c+...
s293244968
p02235
C++
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 = 0; i <= m; i++ ) c[i][0] = 0; for ( int j = 1; j <= n; j++ ) c[0][j] = 0; for ( int i =...
a.cc:1:7: error: expected nested-name-specifier before 'namespase' 1 | using namespase std; | ^~~~~~~~~ a.cc:4:10: error: 'string' was not declared in this scope 4 | int lcs( string X, string Y ) { | ^~~~~~ a.cc:4:20: error: 'string' was not declared in this scope 4 | int lcs( str...
s707144872
p02235
C++
#include<iostream> #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 = 0; i <= m; i++ ) c[i][0] = 0; for ( int ...
a.cc:4:7: error: expected nested-name-specifier before 'namespase' 4 | using namespase std; | ^~~~~~~~~ a.cc:7:10: error: 'string' was not declared in this scope 7 | int lcs( string X, string Y ) { | ^~~~~~ a.cc:7:10: note: suggested alternatives: In file included from /usr/include/c+...
s968071338
p02235
C++
import scala.io.StdIn._ object Main extends App { val q = readInt() var i = 0 while (i < q) { val a = readLine().toString.split("").toSet val b = readLine().toString.split("").toSet var count = 0 for (j <- a) { if (b contains j) count += 1 } println(count) i += 1 } }
a.cc:1:1: error: 'import' does not name a type 1 | import scala.io.StdIn._ | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s071617471
p02235
C++
#include <bits/stdc++.h> using namespace std; #define For(I,A,B) for(int I=(A); I < (B); ++I) int main() { int t; cin>>t; while(t--){ int a[1000]={0},b[1000]={0},c[200][200]; int x,y,z,k=0,l,i,j; For(i,0,200) For(j,0,200) c[i][j]=0; cin>>x>>y; For(i,0,x+1) For(j,0,y+1) c[i][j]=0; For(i,1,x+1) cin>>a[i]; For...
a.cc:34:5: error: expected unqualified-id before 'return' 34 | return 0; | ^~~~~~ a.cc:35:1: error: expected declaration before '}' token 35 | } | ^
s410547472
p02235
C++
#include <bits/stdc++.h> using namespace std; #define For(I,A,B) for(int I=(A); I < (B); ++I) int main() { int t; cin>>t; while(t--){ int a[1000]={0},b[1000]={0},c[200][200]; int x,y,z,k=0,l,i,j; For(i,0,200) For(j,0,200) c[i][j]=0; cin>>x>>y; For(i,0,x+1) For(j,0,y+1) c[i][j]=0; For(i,1,x+1) cin>>a[i]; For...
a.cc:34:5: error: expected unqualified-id before 'return' 34 | return 0; | ^~~~~~ a.cc:35:1: error: expected declaration before '}' token 35 | } | ^
s884177827
p02235
C++
import java.io.*; import static java.lang.Math.max; import static java.lang.Integer.parseInt; class Main { final static PrintWriter out = new PrintWriter( System.out ); final static BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) ); final static StringBuilder sb = new Str...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import static java.lang.Math.max; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-...
s496184897
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(); for (int i = 0; i < m; i++) c[i][0] = 0; for (int i = 0; i < n; i++) c[0][j] = 0; for (int i = 0; i < m; i++) ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:15:36: error: 'j' was not declared in this scope 15 | for (int i = 0; i < n; i++) c[0][j] = 0; | ^
s811110269
p02235
C++
#include <cstdio> #include <algorithm> using namespace std; const int N_MAX = 1000; char x[N_MAX+10], y[N_MAX+10]; int dp[N_MAX][N_MAX]; void solve() { int i, j; scanf("%s", x); scanf("%s", y); int N = strlen(x); int M = strlen(y); //printf("N = %d M = %d", N, M); for (i = 0; i < N+1; i++) { dp[i][0...
a.cc: In function 'void solve()': a.cc:13:11: error: 'strlen' was not declared in this scope 13 | int N = 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> ...
s035979020
p02235
C++
#include <cstdio> #include <algorithm> #include <string> using namespace std; const int N_MAX = 1000; char x[N_MAX+10], y[N_MAX+10]; int dp[N_MAX][N_MAX]; void solve() { int i, j; scanf("%s", x); scanf("%s", y); int N = strlen(x); int M = strlen(y); //printf("N = %d M = %d", N, M); for (i = 0; i < N+1; ...
a.cc: In function 'void solve()': a.cc:14:11: error: 'strlen' was not declared in this scope 14 | int N = strlen(x); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <string> +++ |+#include <cstring> 4...
s340310304
p02235
C++
#include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <utility> #include <map> #include <inttypes.h> int LCS(std::string s,std::string t){ int n,m,c[n+1][m+1]; n=s.size(); m=t.size(); int maxlen=0; f...
a.cc: In function 'int LCS(std::string, std::string)': a.cc:18:19: error: 'N' was not declared in this scope 18 | for(int i=0;i<N;i++){ | ^ a.cc:21:19: error: 'M' was not declared in this scope 21 | for(int i=0;i<M;i++){ | ^ a.cc:34:12: error: 'max' was not ...
s752500940
p02235
C++
#include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <utility> #include <map> #include <inttypes.h> int LCS(std::string s,std::string t){ int n,m,c[n+1][m+1]; n=s.size(); m=t.size(); int maxlen=0; f...
a.cc: In function 'int LCS(std::string, std::string)': a.cc:34:12: error: 'max' was not declared in this scope; did you mean 'std::max'? 34 | return max | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from a.cc:6: /usr/include/c++/14/bit...
s729305622
p02235
C++
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int N = 1010; char x[N],y[N]; int c[N][N]; int lcs(char x[],char y[]){ int lenx = strlen(x+1); int leny = strlen(y+1); for (int i=0; i<=lenx; i++) { c[i][0] = 0; } for(int j=1;j<=leny;j...
a.cc: In function 'int main()': a.cc:36:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 36 | gets(x+1); | ^~~~ | getw
s799816483
p02235
C++
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int N = 1010; int c[N][N]; int lcs(char x[],char y[]){ int lenx = strlen(x+1); int leny = strlen(y+1); for (int i=0; i<=lenx; i++) { c[i][0] = 0; } for(int j=1;j<=leny;j++){ c[...
a.cc: In function 'int main()': a.cc:37:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 37 | gets(x+1); | ^~~~ | getw
s558924073
p02235
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; char A[N],B[N]; int dp[N][N]; void lcs(char A[],char B[]){ int lenA = strlen(A+1); int lenB = strlen(B+1); for(int i=0;i<=lenA;i++){ dp[i][0] = 0; } for(int i=0;i<lenB;i++){ dp[0][...
a.cc: In function 'int main()': a.cc:34:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | lcs(gets(A+1),gets(B+1)); | ^~~~ | getw
s557429212
p02235
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; char A[N],B[N]; int dp[N][N]; void lcs(char A[],char B[]){ int lenA = strlen(A+1); int lenB = strlen(B+1); for(int i=0;i<=lenA;i++){ dp[i][0] = 0; } for(int i=0;i<lenB;i++){ dp[0][...
a.cc: In function 'int main()': a.cc:34:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | gets(A+1); | ^~~~ | getw
s868422999
p02235
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; char A[N],B[N]; int dp[N][N]; int main(){ int n; scanf("%d",&n); for (int i=0; i<n; i++) { gets(A+1); //从下标为1开始读入 gets(B+1); int lenA = strlen(A+1); int lenB = strlen(B+1); for(int...
a.cc: In function 'int main()': a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | gets(A+1); //从下标为1开始读入 | ^~~~ | getw
s454355447
p02235
C++
def lcs(str_a,str_b): if len(str_a) == 0 or len(str_b) == 0: return 0 dp = [[0 for kb in range(len(str_b) + 1)] for ka in range(len(str_a) + 1)] for i in range(1, len(str_a) + 1): for j in range(1, len(str_b) + 1): if str_a[i-1] == str_b[j-1]: dp[i][j] = dp[i-...
a.cc:11:4: error: invalid preprocessing directive #print 11 | #print ("length of LCS is :",dp[len(str_a)][len(str_b)]) | ^~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def lcs(str_a,str_b): | ^~~
s187814818
p02235
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; static const int int N = 1000; int lcs(string x, string y) { int c[N + 1][N + 1]; int m = x.size(); int n = y.size(); int res = 0; x = ' ' + x; y = ' ' + y; for (int i = 0; i <= m; i++) c[i][0] = 0; fo...
a.cc:8:8: error: two or more data types in declaration of 'N' 8 | static const int int N = 1000; | ^~~~~ a.cc: In function 'int lcs(std::string, std::string)': a.cc:12:11: error: 'N' was not declared in this scope 12 | int c[N + 1][N + 1]; | ^ a.cc:20:34: error: 'c' was not decla...
s270112325
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; i ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:17:5: error: 'c' was not declared in this scope 17 | c[i][0] = 0; | ^ a.cc:19:19: error: 'i' was not declared in this scope 19 | for (int j = 1; i < n; i++) { | ^ a.cc:20:5: error: 'c' was not declared in this scop...
s400731245
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; i ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:19:19: error: 'i' was not declared in this scope 19 | for (int j = 1; i < n; i++) { | ^
s733251821
p02235
C++
#include <iostream> #include <string> #include <map> #include <set> #include <algorithm> using namespace std; #define MAX 100000 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 ans=0; X= ' '+X; Y= ' '+Y; for(int i;i<=m;i++)c[i][0]=0; for(int j;...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:18:22: error: 'c' was not declared in this scope 18 | for(int i;i<=m;i++)c[i][0]=0; | ^ a.cc:19:22: error: 'c' was not declared in this scope 19 | for(int j;j<=n;j++)c[0][j]=0; | ^ a.cc:24:9: erro...
s219160679
p02235
C++
#include <iostream> #include <string> #include <map> #include <set> #include <algorithm> using namespace std; #define MAX 100000 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 ans=0; X= ' '+X; Y= ' '+Y; for(int i;i<=m;i++)c[i][0]=0; for(int j;...
a.cc: In function 'int main()': a.cc:41:13: error: 'lsc' was not declared in this scope; did you mean 'lcs'? 41 | cout << lsc(s1,s2) << endl; | ^~~ | lcs
s662038948
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; C[0][0] = 0 for ( int i = 1; i <= m; i++ ) c[i][0] = 0; for ( int j = ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:15:3: error: 'C' was not declared in this scope 15 | C[0][0] = 0 | ^ a.cc:16:20: error: 'i' was not declared in this scope 16 | for ( int i = 1; i <= m; i++ ) c[i][0] = 0; | ^ a.cc:28:22: error: expected ';' before 'r...
s710132866
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; C[0][0] = 0; for ( int i = 1; i <= m; i++ ) c[i][0] = 0; for ( int j =...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:15:3: error: 'C' was not declared in this scope 15 | C[0][0] = 0; | ^ a.cc:28:22: error: expected ';' before 'return' 28 | }javascript:void(0) | ^ | ; 29 | 30 | return maxl; ...
s462037674
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; C[0][0] = 0; for ( int i = 1; i <= m; i++ ) c[i][0] = 0; for ( int j =...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:15:3: error: 'C' was not declared in this scope 15 | C[0][0] = 0; | ^ a.cc:28:22: error: expected ';' before 'return' 28 | }javascript:void(0) | ^ | ; 29 | 30 | return maxl; ...
s248276277
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; c[0][0] = 0; for ( int i = 1; i <= m; i++ ) c[i][0] = 0; for ( int j =...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:28:22: error: expected ';' before 'return' 28 | }javascript:void(0) | ^ | ; 29 | 30 | return maxl; | ~~~~~~ a.cc:31:1: warning: no return statement in function returning ...
s954839381
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; c[0][0] = 0; for ( int i = 1; i <= m; i++ ) c[i][0] = 0; for ( int j =...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:28:22: error: expected ';' before 'return' 28 | }javascript:void(0) | ^ | ; 29 | 30 | return maxl; | ~~~~~~ a.cc:31:1: warning: no return statement in function returning ...
s540846186
p02235
C++
#include<bits/stdc++.h> using namespace std; #define INF 100000000000 const int MOD = 1000000009 //マクロ #define FOR(i, a, b) for(int i = (a); i < (b), i++) #define REP(i, n) FOR(i, 0, n); #define ALL(a) (a).begin(),(a).end() // 最長共通部分列問題 // 入力 // S T // dp[i + 1][j + 1] := Sのi文字目までと、Tのj文字目までのLCSの長さ // 計算量 O(|S||T|) ...
a.cc:18:1: error: expected ',' or ';' before 'int' 18 | int main(){ | ^~~
s169198180
p02235
C++
#include <iostream> #include <string> #include <map> #include <vector> using std::cin; using std::cout; using std::cerr; using std::endl; // 最長共通部分列 ... len(s) == m, len(t) == n とすると, O(mn) int lcs(std::string s, std::string t) { std::vector<std::vector<int> > dp(s.size() + 1, std::vector<int>(t.size() + 1, 0)); ...
a.cc: In function 'int lcs(std::string, std::string)': a.cc:18:49: error: expected primary-expression before ';' token 18 | dp[i][j] = (i == 0 ? (j == 0 ? 1 : 0) : ; | ^ a.cc:18:48: error: expected ')' before ';' token 18 | dp[i][j] = (i == 0 ?...
s932205609
p02235
C++
#include <iostream> #include <string> #include <algorithm> #define MAX 1000 using namespace std; string s,t; int dp[MAX + 1][MAX + 1]; int LCS(void){ for( int i = 0 ; i < s.size() ; i++ ){ for( int j = 0 ; j < t.size() ; j++ ){ if( s[i] == t[j] ){ dp[i + 1][j + 1] = dp[i][j] + 1; }else{ dp[i + 1...
a.cc: In function 'int main()': a.cc:32:5: error: 'memset' was not declared in this scope 32 | memset(dp, 0 , sizeof(dp) ); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring>...
s116046636
p02236
C++
import java.io.PrintWriter import java.util.* data class PE(var p: Double, var e: Double) data class Node(var center: PE, var left: PE, var right: PE, var lNode: Node?, var rNode: Node?) : Comparable<Node> { override fun compareTo(other: Node): Int { val a = center.e + center.p val o = other.center...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.PrintWriter | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:15:1: error: 'fun' does not name a type 15 | fun main(args: Array<String>) = with(PrintWriter(System.out)) { | ^~~
s080615053
p02237
Java
#include<
Main.java:1: error: illegal character: '#' #include< ^ Main.java:1: error: class, interface, enum, or record expected #include< ^ 2 errors
s111001468
p02237
Java
package sample; import java.io.*; import java.util.*; public class ProblemIntro11_A { int output[][] = new int[100][100]; int dataset = 0;//????????° int touch = 0;//??£??\??° int number = 0; String input = null; BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); public static void main...
Main.java:5: error: class ProblemIntro11_A is public, should be declared in a file named ProblemIntro11_A.java public class ProblemIntro11_A { ^ 1 error
s114477354
p02237
Java
package aoj; import java.util.Scanner; public class ALDS1_11_A { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[][] m = new int[n][n]; int u, k, v; for (int i = 0; i < n; i++) { u = scanner.nextI...
Main.java:5: error: class ALDS1_11_A is public, should be declared in a file named ALDS1_11_A.java public class ALDS1_11_A { ^ 1 error
s232364434
p02237
Java
import java.util.Scanner; public class ALDS1_11_A { private static final int N = 100; public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[][] m = new int[N][N]; for (int i = 0; i < n; i++) { for (int j = ...
Main.java:3: error: class ALDS1_11_A is public, should be declared in a file named ALDS1_11_A.java public class ALDS1_11_A { ^ 1 error
s057626417
p02237
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[][] e = new int[n+1][n+1]; for(int i = 1; i <= n; i++){ int u = scan.nextInt(); int k = scan.nextInt(); for(int j = 0; j < k; j++) int v = scan.next...
Main.java:15: error: variable declaration not allowed here int v = scan.nextInt(); ^ 1 error
s726833940
p02237
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int size = scanner.nextInt(); Graph[] graphs = new Graph[size]; for (int i = 0; i < size; i++) { int id = scanner.nextInt(); int num = scanner.nextInt(); graphs[i] = new ...
Main.java:23: error: class Graph is public, should be declared in a file named Graph.java public class Graph { ^ 1 error
s202114191
p02237
Java
import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main{ //directed graph LinkedList<Integer> adg[]; Main(int n){ adg = new LinkedList[n+1]; for(int i = 0; i<=n; i++){ adg[i] = new LinkedList<>(); } } void addEdge(int index...
Main.java:21: error: cannot find symbol Maingraph = new Main(n); ^ symbol: variable Maingraph location: class Main Main.java:27: error: cannot find symbol graph.addEdge(index,temp); ^ symbol: variable graph location: class Main Main.java:33: error: cannot find...
s415519285
p02237
Java
import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main{ //directed graph LinkedList<Integer> adg[]; Main(int n){ adg = new LinkedList[n+1]; for(int i = 0; i<=n; i++){ adg[i] = new LinkedList<>(); } } void addEdge(int index...
Main.java:21: error: cannot find symbol Main = new Main(n); ^ symbol: variable Main location: class Main Main.java:27: error: cannot find symbol graph.addEdge(index,temp); ^ symbol: variable graph location: class Main Main.java:33: error: cannot find symbol ...
s419748268
p02237
Java
import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main{ //directed graph List<Integer> adg[]; GraphAizu(int n){ adg = new LinkedList[n+1]; for(int i = 0; i<=n; i++){ adg[i] = new LinkedList<>(); } } void addEdge(int index,...
Main.java:8: error: invalid method declaration; return type required GraphAizu(int n){ ^ 1 error
s725592184
p02237
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.util.PriorityQueue; public class Graph{ static InputReader ir; static PrintWriter out; static void solve(){ int n=ir....
Main.java:8: error: class Graph is public, should be declared in a file named Graph.java public class Graph{ ^ 1 error
s392162317
p02237
Java
import java.util.*; public class Graph{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int u,k; int[][] a=new int[n][n]; for(int i=0;i<n;i++){ u=sc.nextInt(); k=sc.nextInt(); int[] v=new int[k]; for(int j=0;j<k;j++){ v[j]=sc.nextInt(); a[i...
Main.java:2: error: class Graph is public, should be declared in a file named Graph.java public class Graph{ ^ 1 error
s832617212
p02237
C
#include <stdio.h> int Matrix[100][100]; int main(){ int N, u, k, temp; for (int ix = 0; ix < N; ix++) for (int jx = 0; jx < N; jx++) Matrix[ix][jx] = 0; scanf("%d\n",&N); for (int ix = 0 ; ix < N; ix++){ scanf("%d %d",&u,&k); if ( k != 0 ){ for (in...
main.c: In function 'main': main.c:17:26: error: expected ';' before '}' token 17 | Matrix[u] | ^ | ; 18 | } | ~
s769114727
p02237
C
#include <stdio.h> int Map[100][100]; void print(int N){ for (int ix = 0; ix < N; ix++) for (int jx = 0; jx < N; jx++){ if (jx != N-1) printf("%d ",Map[ix][jx]); else printf("%d\n",Map[ix][jx]); } } int main(){ int N, u, k, temp; scanf("%d\n",&N); for (int ix = ...
main.c: In function 'main': main.c:28:1: error: expected declaration or statement at end of input 28 | } | ^
s158591120
p02237
C
#include<iostream> using namespace std; static const int N = 100; int main() { int M[N][N]; int n, u, k, v; cin >> n; for ( int i = 0; i < n; i++ ) { for ( int j = 0; j < n; j++ ) M[i][j] = 0; } for ( int i = 0; i < n; i++ ) { cin >> u >> k; u--; for ( int j = 0; j < k; j++ ) { cin...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s227187208
p02237
C
#include <stdio.h> int main(){ int i,j,n,k,l,h,A[100][100]; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ A[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d %d",&k,&l); for(j=0j<l;j++){ scanf("%d",&h); A[k-1][h-1]=1; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ ...
main.c: In function 'main': main.c:16:13: error: invalid operands to binary < (have 'complex int' and 'int') 16 | for(j=0j<l;j++){ | ^ main.c:16:19: error: expected ';' before ')' token 16 | for(j=0j<l;j++){ | ^ | ;
s372408014
p02237
C
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s778377174
p02237
C
#include<stdio.h> void dfs(){
main.c: In function 'dfs': main.c:2:1: error: expected declaration or statement at end of input 2 | void dfs(){ | ^~~~
s347334562
p02237
C
#include<stdio.h> #define N 100 int main() { int i,j,n,p,q,r,A[N][N]; scanf("%d",&n); for(i=0; i<n; i++){ for(j=0; j<n; j++){ A[i][j] = 0; } } for(i=0; i<n; i++){ scanf("%d%d",&p,&q); for(j=0; j<q; j++){ scanf("%d",&r); A[p-1][t-1] = 1; } } for(i=0; i<n; i++){ ...
main.c: In function 'main': main.c:18:14: error: 't' undeclared (first use in this function) 18 | A[p-1][t-1] = 1; | ^ main.c:18:14: note: each undeclared identifier is reported only once for each function it appears in
s286581328
p02237
C
#include <stdio.h> #define rep(i, n) for(int i = 0; i < n; ++i) int main(void) { int n, i, j; scanf("%d", &n); char r[n][n]; rep(i, n) rep(j, n) r[i][j] = 0; rep(i, n) { int u, k; scanf("%d%d", &u, &k); u--; rep(j, k) { int v; scanf("%d", &v); v--; r[u][v] = 1; } ...
main.c: In function 'main': main.c:24:3: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s177618062
p02237
C
#include <stdio.h> #define rep(i, n) for(int i = 0; i < n; ++i) int main(void) { int n, i, j; scanf("%d", &n); char r[n][n]; rep(i, n) rep(j, n) r[i][j] = 0; rep(i, n) { int u, k; scanf("%d%d", &u, &k); u--; rep(j, k) { int v; scanf("%d", &v); v--; r[u][v] = 1; } ...
main.c: In function 'main': main.c:24:3: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s207809079
p02237
C
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s310218378
p02237
C
#include <stdio.h> #define rep(i, n) for(int i = 0; i < n; ++i) int main(void) { int n, i, j; scanf("%d", &n); char r[n][n]; rep(i, n) rep(j, n) r[i][j] = 0; rep(i, n) { int u, k; scanf("%d%d", &u, &k); u--; rep(j, k) { int v; scanf("%d", &v); v--; r[u][v] = 1; } ...
main.c: In function 'main': main.c:24:3: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s774463414
p02237
C
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s825567336
p02237
C
#include<stdio.h> #pragma warning(disable:4996) int main() { int n = 0; scanf("%d", &n); int **arr = new int*[n]; for (int i = 0; i < n; i++) { arr[i] = new int[n]; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { arr[i][j] = { 0 }; } } for (int i = 0; i < n; i++) { int k = 0,l=0,g=0;...
main.c: In function 'main': main.c:6:21: error: 'new' undeclared (first use in this function) 6 | int **arr = new int*[n]; | ^~~ main.c:6:21: note: each undeclared identifier is reported only once for each function it appears in main.c:6:25: error: expected ',' or ';' before 'int' ...
s969013639
p02237
C
#include <stdio.h> #include <stdlib.h> #pragma warning(disable:4996) int main() { int n; int u = 0, k = 0; bool adj[100][100] = { 0 }; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d %d", &u, &k); for (int i = 0; i < k; i++) { int v = 0; scanf("%d", &v); adj[u][v] = true; } } for ...
main.c: In function 'main': main.c:8:9: error: unknown type name 'bool' 8 | bool adj[100][100] = { 0 }; | ^~~~ main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include <stdlib.h> +++ |+#include <stdbool.h> 3 |...
s049687672
p02237
C
#include<stdio.h> #define u 101 int main(){ int i,n,ans,k,j,u_number,iranai; int Adj[u][u]; for(i=0;i<u;i++){ for(j=0;j<u;j++){ Adj[i][j]=0; } } scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&iranai); scanf("%d",&k); for(j=1;j<=k;j++){ scanf("%d",&u_number); Ad...
main.c: In function 'main': main.c:33:3: error: expected declaration or statement at end of input 33 | return 0; | ^~~~~~
s164193482
p02237
C
#include<stdio.h> #define u 101 int main(){ int i,n,ans,k,j,u_number,iranai; int Adj[u][u]; for(i=0;i<u;i++){ for(j=0;j<u;j++){ Adj[i][j]=0; } } scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&iranai); scanf("%d",&k); for(j=1;j<=k;j++){ scanf("%d",&u_number); Ad...
main.c: In function 'main': main.c:33:3: error: expected declaration or statement at end of input 33 | return 0; | ^~~~~~
s214812204
p02237
C
#include <stdio.h> #define N 100 int main(){ int n, u, k; int v[N], a[N][N]; int i, j; scanf("%d", &n); if(n < 100){ for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ a[i][j] = 0; } } for(i = 0; i < n; i++){ scanf("%d%d", &u, &k); for(j = 0; j < k; j++){ sca...
main.c: In function 'main': main.c:39:29: error: expected ';' before 'return' 39 | else printf("Too Large\n") | ^ | ; 40 | 41 | return 0; | ~~~~~~