submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s018919825
p03804
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; vector<string> a(n),b(m); for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<m;i++) cin>>b[i]; string tmp; for(int i=0;i+m<=n;i++){ }
a.cc: In function 'int main()': a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s293600738
p03804
C++
#include <iostream> #include <string> #include <vector> #include <stack> #include <algorithm> #include <numeric> #include <math.h> using namespace std; #define N_MAX (100000) #define LL_MAX_NUM (1LL<<60) typedef long long ll; typedef long long int lli; int main() { int N, M; cin >> N >> M; string Ai[N], Bi[M]; for (int i = 0; i < N; i++) { cin >> Ai[i]; } for (int i = 0; i < M; i++) { cin >> Bi[i]; } for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { if (M > 1 && N > 1 && Ai[j].find(Bi[i]) >= 0 && Ai[j].find(Bi[i]) <= N-1) { if (M > 1 && N > 1 && Ai[j+1].find(Bi[i+1],j) >= 0 && Ai[j+1].find(Ai[i+1],j) <= N-1) { cout << "Yes" << endl; return 0; } else { break; } else if (M == 1 && N == 1 && Ai[j].find(Bi[i]) >= 0 && Ai[j].find(Bi[i]) <= N-1) } } } cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:19: error: expected '}' before 'else' 36 | } else if (M == 1 && N == 1 && Ai[j].find(Bi[i]) >= 0 && Ai[j].find(Bi[i]) <= N-1) | ^~~~ a.cc:30:87: note: to match this '{' 30 | if (M > 1 && N > 1 && Ai[j].find(Bi[i]) >= 0 && Ai[j].find(Bi[i]) <= N-1) { | ^ a.cc:37:13: error: expected primary-expression before '}' token 37 | } | ^ a.cc: At global scope: a.cc:40:5: error: 'cout' does not name a type 40 | cout << "No" << endl; | ^~~~ a.cc:41:5: error: expected unqualified-id before 'return' 41 | return 0; | ^~~~~~ a.cc:42:1: error: expected declaration before '}' token 42 | } | ^
s460502056
p03804
C++
#include<iostream> using namespace std; const int maxn=100; int main(){ char a[maxn][maxn],b[maxn][maxn]; int m,n,; cin>>m>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i]; } } for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ cin>>b[i]; } } bool flag=false; for(int i=0;i<n-m+1;i++){ for(int j=0;j<n-m+1;j++){ if(a[i][j]==b[0][0]){ flag=true; for(int k=0;k<m;k++){ for(int z=0;z<m;z++){ if(a[i+x][j+y]!=b[x][y]){ flag=false; break; } } } } if(flag=true){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:6:17: error: expected unqualified-id before ';' token 6 | int m,n,; | ^ a.cc:26:56: error: 'x' was not declared in this scope 26 | if(a[i+x][j+y]!=b[x][y]){ | ^ a.cc:26:61: error: 'y' was not declared in this scope 26 | if(a[i+x][j+y]!=b[x][y]){ | ^
s846893815
p03804
C
#include<stdio.h> #include<string.h> int main(){ int N, M, i, j , k , l, flag; char A[50][51], B[50][51]; scanf("%d %d", &N, &M); for (i = 0; i < N; i++){ scanf("%s", A[i]); } for (i = 0; i < M; i++){ scanf("%s", B[i]); } for (i = 0; i <= M - N; i++){ for (j = 0; j <= M - N; j++){ for (k = i; k < i + M; k++){ for (l = j; j < j + M; j++){ flag = 1; if(A[k][l] != B[k - i][l - j]){ flag = 0: break; } } if(flag = 0){ break; } } if(k == i + M && l == j + M){ break; } } if(k == i + M && l == j + M){ break; } } if(k == i + M && l == j + M){ printf("No\n"); } else { printf("Yes\n"); } return 0; }
main.c: In function 'main': main.c:22:21: error: expected ';' before ':' token 22 | flag = 0: | ^ | ;
s267661313
p03804
C
#include<stdio.h> #include<string.h> int main(){ int N, M, i, j , k , l; char A[50][51], B[50][51]; scanf("%d %d", &N, &M); for (i = 0; i < N; i++){ scanf("%s", A[i]); } for (i = 0; i < M; i++){ scanf("%s", B[i]); } for (i = 0; i <= M - N; i++){ for (j = 0; j <= M - N; j++){ for (k = i; k < i + M; k++){ for (l = j; j < j + M; j++){ flag = 1; if(A[k][l] != B[k - i][l - j]){ flag = 0: break; } } if(flag = 0){ break; } } if(k == i + M && l == j + M){ break; } } if(k == i + M && l == j + M){ break; } } if(k == i + M && l == j + M){ printf("No\n"); } else { printf("Yes\n"); } return 0; }
main.c: In function 'main': main.c:20:11: error: 'flag' undeclared (first use in this function) 20 | flag = 1; | ^~~~ main.c:20:11: note: each undeclared identifier is reported only once for each function it appears in main.c:22:21: error: expected ';' before ':' token 22 | flag = 0: | ^ | ;
s714972517
p03804
Java
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(Systee.in); int N = sc.nextInt(); int M = sc.nextInt(); A = new char[N][N]; for (int i = 0; i < N; i++) A[i] = sc.next().toCharArray(); B = new char[M][M]; for (int i = 0; i < M; i++) B[i] = sc.next().toCharArray(); for (int ii = 0; ii <= N - M; ii++) { for (int jj = 0; jj <= N - M; jj++) { if (match(ii, jj)) { System.out.println("Yes"); return; } } } System.out.println("No"); } public static boolean match(int ii, int jj) { for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { if (A[i + ii][j + jj] != B[i][j]) return false; } } return true; } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(Systee.in); ^ symbol: variable Systee location: class Main Main.java:9: error: cannot find symbol A = new char[N][N]; ^ symbol: variable A location: class Main Main.java:11: error: cannot find symbol A[i] = sc.next().toCharArray(); ^ symbol: variable A location: class Main Main.java:12: error: cannot find symbol B = new char[M][M]; ^ symbol: variable B location: class Main Main.java:14: error: cannot find symbol B[i] = sc.next().toCharArray(); ^ symbol: variable B location: class Main Main.java:28: error: cannot find symbol for (int i = 0; i < M; i++) { ^ symbol: variable M location: class Main Main.java:29: error: cannot find symbol for (int j = 0; j < M; j++) { ^ symbol: variable M location: class Main Main.java:30: error: cannot find symbol if (A[i + ii][j + jj] != B[i][j]) ^ symbol: variable A location: class Main Main.java:30: error: cannot find symbol if (A[i + ii][j + jj] != B[i][j]) ^ symbol: variable B location: class Main 9 errors
s345005587
p03804
C++
#include <iostream> #include <vector> #include <string> #include <cstring> using namespace std; int main(){ int N,M,a=0; cin >> N >> M; vector<string> str1(N+M); for(int i=0;i<N+M;i++){ cin >> str1.at(i); } for(int i=0;i<N;i++){ if(a==1)break; for(int j=N;j<N+M;j++){ if(a==1)break; if(strstr(str1.at(i),str1.at(j)) != NULL){ while(j!=M){ j++; if(strstr(str1.at(i),str1.at(j)) == NULL){ cout << "No"; a=1; break; } } } } } if(a==0)cout << "Yes"; return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: no matching function for call to 'strstr(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&, __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 18 | if(strstr(str1.at(i),str1.at(j)) != NULL){ | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstring:43, from a.cc:4: /usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)' 330 | extern char *strstr (char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:330:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'char*' 330 | extern char *strstr (char *__haystack, const char *__needle) | ~~~~~~^~~~~~~~~~ /usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:332:40: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~~~ a.cc:21:29: error: no matching function for call to 'strstr(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&, __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 21 | if(strstr(str1.at(i),str1.at(j)) == NULL){ | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)' 330 | extern char *strstr (char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:330:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'char*' 330 | extern char *strstr (char *__haystack, const char *__needle) | ~~~~~~^~~~~~~~~~ /usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:332:40: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~~~
s270230005
p03804
C
#include<stdio.h> int N, M, L, i, j, x, y; short flag; char A[51][51], B[51][51]; int main(){ scanf("%d %d\n", &N, &M); for(i=0; i<N; i++){ scanf("%s\n", A[i]); } for(i=0; i<M; i++){ scanf("%s\n", B[i]); } L=N-M; for(i=0; i<L; i++){ for(i=0; i<L; i++){ flag=1; for(x=0; x<M; x++){ for(y=0; y<M; y++){ if(M[x][y] != N[i+x][j+y]){ flag = 0; break; } } if(!flag){break;} } if(flag){ printf("Yes\n"); return 0; } } } printf("No\n"); }
main.c: In function 'main': main.c:19:17: error: subscripted value is neither array nor pointer nor vector 19 | if(M[x][y] != N[i+x][j+y]){ | ^ main.c:19:28: error: subscripted value is neither array nor pointer nor vector 19 | if(M[x][y] != N[i+x][j+y]){ | ^
s511949244
p03804
C++
#include <iostream> using namespace std int main(void){ int N,M; cin>>N>>M; const int nmmax=50; char A[nmmax][nmmax],B[nmmax][nmmax]; for(int y=0;y<N;++y){ for(int x=0;x<N;++x){ cin >> A[y][x]; } } for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ cin >> B[y][x]; } } bool exist=false; for(int ly=0;ly<N;++ly){ for(int lx=0;lx<N;++lx){ if(ly+M-1>=N or lx+M-1>=N) continue; bool match=true; for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ if(A[ly+y][lx+x]!=B[y][x]) match=false; } } if(match) exist=true; } } if(exist) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | int main(void){ | ~~~
s725815136
p03804
C++
int main(void){ int N,M; cin>>N>>M; const int nmmax=50; char A[nmmax][nmmax],B[nmmax][nmmax]; for(int y=0;y<N;++y){ for(int x=0;x<N;++x){ cin >> A[y][x]; } } for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ cin >> B[y][x]; } } bool exist=false; for(int ly=0;ly<N;++ly){ for(int lx=0;lx<N;++lx){ if(ly+M-1>=N or lx+M-1>=N) continue; bool match=true; for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ if(A[ly+y][lx+x]!=B[y][x]) match=false; } } if(match) exist=true; } } if(exist) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:2:18: error: 'cin' was not declared in this scope 2 | int N,M; cin>>N>>M; | ^~~ a.cc:28:9: error: 'cout' was not declared in this scope 28 | cout << "Yes" << endl; | ^~~~ a.cc:28:26: error: 'endl' was not declared in this scope 28 | cout << "Yes" << endl; | ^~~~ a.cc:30:9: error: 'cout' was not declared in this scope 30 | cout << "No" << endl; | ^~~~ a.cc:30:25: error: 'endl' was not declared in this scope 30 | cout << "No" << endl; | ^~~~
s494144998
p03804
C++
int main(void){ int N,M; cin >> N >> M; vector<string> A(N), B(M); for (int i=0; i<N; i++) cin >> A.at(i); for (int i=0; i<M; i++) cin >> B.at(i); bool is_exist = false; for (int i=0; i<N-M+1; i++) { for (int j=0; j<N-M+1; j++) { if (A.at(i).at(j) != B.at(0).at(0)) continue; else { bool is_match = true; for (int k=0; k<M; k++) { for (int l=0; l<M; l++) { if (A.at(i+k).at(j+l) != B.at(k).at(l)) { is_match = false; break; } } if (is_match) break; } if (is_match) { is_exist = true; break; } } } if (is_exist) break; } if (is_exist) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:4:3: error: 'vector' was not declared in this scope 4 | vector<string> A(N), B(M); | ^~~~~~ a.cc:4:10: error: 'string' was not declared in this scope 4 | vector<string> A(N), B(M); | ^~~~~~ a.cc:4:18: error: 'A' was not declared in this scope 4 | vector<string> A(N), B(M); | ^ a.cc:4:24: error: 'B' was not declared in this scope 4 | vector<string> A(N), B(M); | ^ a.cc:31:17: error: 'cout' was not declared in this scope 31 | if (is_exist) cout << "Yes" << endl; | ^~~~ a.cc:31:34: error: 'endl' was not declared in this scope 31 | if (is_exist) cout << "Yes" << endl; | ^~~~ a.cc:32:8: error: 'cout' was not declared in this scope 32 | else cout << "No" << endl; | ^~~~ a.cc:32:24: error: 'endl' was not declared in this scope 32 | else cout << "No" << endl; | ^~~~
s088658055
p03804
C++
n, m = map(int, input().split()) a = [input() for _ in range(n)] b = [input() for _ in range(m)] mon = ([row[j:j+m] for row in a[i:i+m]] for i in range(n-m+1) for j in range(n-m+1)) print('Yes' if any(c == b for c in mon) else 'No')
a.cc:6:7: warning: multi-character character constant [-Wmultichar] 6 | print('Yes' if any(c == b for c in mon) else 'No') | ^~~~~ a.cc:6:46: warning: multi-character character constant [-Wmultichar] 6 | print('Yes' if any(c == b for c in mon) else 'No') | ^~~~ a.cc:1:1: error: 'n' does not name a type 1 | n, m = map(int, input().split()) | ^
s305250283
p03804
C++
#include<bits/stdc++.h> using namespace std; char a[51][51],b[51][51]; int main(){ int n,m,i; cin>>n>>m; getchar(); for(i=1;i<=n;i++){ gets(a[i]); } for(i=1;i<=m;i++){ gets(b[i]); } for(i=0;i+m-1<n;i++){ for(int j=0;j+m-1<n;j++){ bool flag=true; for(int k=0;k<n;k++){ for(int l=0;l<n;l++){ if(a[i+k][j+l]!=b[k][l]){ flag=false; } } } if(flag){ cout<<"Yes"; return 0; } flag=true; } } cout<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a[i]); | ^~~~ | getw a.cc:12:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | gets(b[i]); | ^~~~ | getw
s513621016
p03804
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int a[101][101],b[101][101]; bool tmp[101][101]; int main() { int i,j,k,p,x,y; bool tmp; cin>>x>>y; for(i=1;i<=x;i++) { for(j=1;j<=x;j++) { cin>>a[i][j]; } } for(i=1;i<=y;i++) { for(j=1;j<=y;j++) { cin>>b[i][j]; } } for(i=1;i<=x;i++) { for(j=1;j<=x;j++) { if(a[i][j]==b[1][1]) { for(k=i;k<=y;k++) { for(p=j;p<=y;p++) { if(a[k][p]!=b[i][j]) { tmp[k][p]=false; break; } } } } } } for(i=1;i<=x;i++) { for(j=1;j<=x;j++) { if(tmp[i][j]==true) { cout<<"Yes"; return 0; } } } cout<<"No"; }
a.cc: In function 'int main()': a.cc:38:60: error: invalid types 'bool[int]' for array subscript 38 | tmp[k][p]=false; | ^ a.cc:50:31: error: invalid types 'bool[int]' for array subscript 50 | if(tmp[i][j]==true) | ^
s676164520
p03804
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; char c[a][a]; char d[b][b]; for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ cin>>c[i][j]; } } for(int i=0;i<b;i++){ for(int j=0;j<b;j++){ cin>>d[i][j]; } } bool f=false; int e; for(int i=0;i<a-b+1){ for(int j=0;j<a-b+1){ if(d[0][0]==c[i][j]){ e=0; for(int k=0;k<b;k++){ for(int l=0;l<b;l++){ if(d[k][l]==c[i+k][j+l]) e++; if(e==b*b){ cout<<"Yes"; return 0; } } } } } } cout<<"No"; }
a.cc: In function 'int main()': a.cc:20:22: error: expected ';' before ')' token 20 | for(int i=0;i<a-b+1){ | ^ | ; a.cc:21:24: error: expected ';' before ')' token 21 | for(int j=0;j<a-b+1){ | ^ | ;
s495278533
p03804
C++
#include <bits/stdc++.h> #include <sys/time.h> using namespace std; // hamko utils #define rep(i,n) for(long long i = 0; i < (long long)(n); i++) #define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mt make_tuple #define mp make_pair template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); } template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); } using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using P = pair<ll, ll>; using ld = long double; using vld = vector<ld>; using vi = vector<int>; using vvi = vector<vi>; vll conv(vi& v) { vll r(v.size()); rep(i, v.size()) r[i] = v[i]; return r; } inline void input(int &v){ v=0;char c=0;int p=1; while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();} while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();} v*=p; } // これを使うならば、tieとかを消して!! template <typename T, typename U> ostream &operator<<(ostream &o, const pair<T, U> &v) { o << "(" << v.first << ", " << v.second << ")"; return o; } template<size_t...> struct seq{}; template<size_t N, size_t... Is> struct gen_seq : gen_seq<N-1, N-1, Is...>{}; template<size_t... Is> struct gen_seq<0, Is...> : seq<Is...>{}; template<class Ch, class Tr, class Tuple, size_t... Is> void print_tuple(basic_ostream<Ch,Tr>& os, Tuple const& t, seq<Is...>){ using s = int[]; (void)s{0, (void(os << (Is == 0? "" : ", ") << get<Is>(t)), 0)...}; } template<class Ch, class Tr, class... Args> auto operator<<(basic_ostream<Ch, Tr>& os, tuple<Args...> const& t) -> basic_ostream<Ch, Tr>& { os << "("; print_tuple(os, t, gen_seq<sizeof...(Args)>()); return os << ")"; } ostream &operator<<(ostream &o, const vvll &v) { rep(i, v.size()) { rep(j, v[i].size()) o << v[i][j] << " "; o << endl; } return o; } template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '['; rep(i, v.size()) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]"; return o; } template <typename T> ostream &operator<<(ostream &o, const deque<T> &v) { o << '['; rep(i, v.size()) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]"; return o; } template <typename T> ostream &operator<<(ostream &o, const set<T> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; } template <typename T> ostream &operator<<(ostream &o, const unordered_set<T> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; } template <typename T, typename U> ostream &operator<<(ostream &o, const map<T, U> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; } template <typename T, typename U, typename V> ostream &operator<<(ostream &o, const unordered_map<T, U, V> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it; o << "]"; return o; } vector<int> range(const int x, const int y) { vector<int> v(y - x + 1); iota(v.begin(), v.end(), x); return v; } template <typename T> istream& operator>>(istream& i, vector<T>& o) { rep(j, o.size()) i >> o[j]; return i;} template <typename T, typename S, typename U> ostream &operator<<(ostream &o, const priority_queue<T, S, U> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.top(); tmp.pop(); o << x << " ";} return o; } template <typename T> ostream &operator<<(ostream &o, const queue<T> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.front(); tmp.pop(); o << x << " ";} return o; } template <typename T> ostream &operator<<(ostream &o, const stack<T> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.top(); tmp.pop(); o << x << " ";} return o; } template <typename T> unordered_map<T, ll> counter(vector<T> vec){unordered_map<T, ll> ret; for (auto&& x : vec) ret[x]++; return ret;}; string substr(string s, P x) {return s.substr(x.fi, x.se - x.fi); } void vizGraph(vvll& g, int mode = 0, string filename = "out.png") { ofstream ofs("./out.dot"); ofs << "digraph graph_name {" << endl; set<P> memo; rep(i, g.size()) rep(j, g[i].size()) { if (mode && (memo.count(P(i, g[i][j])) || memo.count(P(g[i][j], i)))) continue; memo.insert(P(i, g[i][j])); ofs << " " << i << " -> " << g[i][j] << (mode ? " [arrowhead = none]" : "")<< endl; } ofs << "}" << endl; ofs.close(); system(((string)"dot -T png out.dot >" + filename).c_str()); } size_t random_seed; namespace std { using argument_type = P; template<> struct hash<argument_type> { size_t operator()(argument_type const& x) const { size_t seed = random_seed; seed ^= hash<ll>{}(x.fi); seed ^= (hash<ll>{}(x.se) << 1); return seed; } }; }; // hash for various class #define ldout fixed << setprecision(40) #define EPS (double)1e-14 #define INF (ll)1e18 #define mo (ll)(1e9+7) // end of hamko utils int main() { int N, M; cin >> N >> M; char a[N][N], b[M][M]; for(int i = 0; i < N; ++i){ for(int j = 0; j < N; ++j) cin >> a[i][j]; } for(int i = 0; i < M; ++i){ for(int j = 0; j < M; ++j) cin >> b[i][j]; } bool ans = false; for(int i = 0; i < N; ++i){ for(int j = 0; j < N; ++j){ bool ok = true; for(int l = 0; l < M; ++l){ for(int k = 0; k < M; ++k){ if(b[l][k]!=a[i+l][j+k]) ok = false; } } if(ok) ans = true; } } } if(ans) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc:74:3: error: expected unqualified-id before 'if' 74 | if(ans) cout << "Yes" << endl; | ^~ a.cc:75:3: error: expected unqualified-id before 'else' 75 | else cout << "No" << endl; | ^~~~ a.cc:76:3: error: expected unqualified-id before 'return' 76 | return 0; | ^~~~~~ a.cc:77:1: error: expected declaration before '}' token 77 | } | ^
s880691546
p03804
C++
#include<bits/stdc++.h> using namespace std; int main(){ char a[50][50]; char b[50][50]; int n,m; cin >> n >> m; for(int i=0;i<n;i++){ for(int j=0;j<n,j++){ cin >> a[i][j]; } } for(int i=0;i<m;i++){ for(int j=0;j<m,j++){ cin >> b[i][j]; } } bool exist=false; for(int ly=0;ly<n;ly++){ for(int lx=0;lx<n;lx++){ if(ly+M-1>=N || lx+M--1>=N)continue; bool match=true; } } if(exist) puts("Yes"); else puts("No"); }
a.cc: In function 'int main()': a.cc:10:28: error: expected ';' before ')' token 10 | for(int j=0;j<n,j++){ | ^ | ; a.cc:15:28: error: expected ';' before ')' token 15 | for(int j=0;j<m,j++){ | ^ | ; a.cc:23:19: error: 'M' was not declared in this scope 23 | if(ly+M-1>=N || lx+M--1>=N)continue; | ^ a.cc:23:24: error: 'N' was not declared in this scope 23 | if(ly+M-1>=N || lx+M--1>=N)continue; | ^ a.cc:23:35: error: expected ')' before numeric constant 23 | if(ly+M-1>=N || lx+M--1>=N)continue; | ~ ^ | )
s654000127
p03804
C++
#include <iostream> #include <string> int main() { int N, M; std::cin >> N >> M; std::string A[N], B[M]; for (int i = 0; i < N; ++i) { std::cin >> A[i]; } for (int i = 0; i < M; ++i) { std::cin >> B[i]; } bool exist = false; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { if ( j + M - 1 >= || i + M - 1 ) continue; bool match = true; for (int ii = 0; ii < M; ++ii) { for (int jj = 0; j < M; ++jj) { if ( A[i + ii][j + jj] != B[i][j] ) match = false } } if ( match ) exist = true; } } if ( exist ) std::cout << "Yes" << std::endl; else std::cout << "No" << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:18:25: error: expected primary-expression before '||' token 18 | if ( j + M - 1 >= || i + M - 1 ) continue; | ^~ a.cc:22:60: error: expected ';' before '}' token 22 | if ( A[i + ii][j + jj] != B[i][j] ) match = false | ^ | ; 23 | } | ~
s362726738
p03804
C++
#include<iostream> #include<algorithm> #include<string> #include<functional> #include<utility> #include<stack> #include<queue> #include<cmath> #include<list> #include<cstdint> #include<vector> #include<map> #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define rep(i,rept) for(ll i = 0; i<rept;i++) typedef long long ll; using namespace std; ll nCr(ll n, ll r) { if (r > n) { return 0; } if (r * 2 > n) r = n - r; ll dividend = 1; ll divisor = 1; for (ll i = 1; i <= r; ++i) { dividend *= (n - i + 1); divisor *= i; } return dividend / divisor; } ll sumdigit(ll n) { ll dig = 0, sum = 0; while (n) { dig = n % 10; sum = sum + dig; n = n / 10; } return sum; } int main() { int N, M, i, j, k, l, count = 0, flag = 0; cin >> N >> M; vector<vector<char>> NN(N, vector<char>(N)); vector<vector<char>> MM(M, vector<char>(M)); for (i = 0; i < N; i++) { for (j = 0; j < N; j++) cin >> NN[i][j]; } for (i = 0; i < M; i++) { for (j = 0; j < M; j++) cin >> MM[i][j]; } for (i = 0; i < N + 1 - M; i++) { for (j = 0; j < N + 1 - M; j++) { count = 0; if (NN[i][j] == MM[0][0]) { for (k = 0; k < M; k++) { for (l = 0; l < M; l++) { if (NN[k + i][l + j] == MM[k][l]) { count++; } } } } if (count == M * M) { cout << "Yes" << endl; flag = 1; break; } } }
a.cc: In function 'int main()': a.cc:76:2: error: expected '}' at end of input 76 | } | ^ a.cc:43:12: note: to match this '{' 43 | int main() { | ^
s065026835
p03804
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; bool c=true; char x[a][a],y[b][b]; for(int i=0;i<a;i++){ for(int j=0;j<a;j++)cin>>x[i][j]; } for(int i=0;i<b;i++){ for(int j=0;j<b;j++)cin>>y[i][j]; } for(int i=0;i<=a-b;i++){ for(int j=0;j<=a-b;j++){ c=true; for(int k=0;k<b;k++){ for(int l=0;l<b;l++){ if(a[i+k][j+l]!=b[k][l])c=false; } } if(c){ cout<<"Yes"<<endl; return 0; } } } cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:19:25: error: invalid types 'int[int]' for array subscript 19 | if(a[i+k][j+l]!=b[k][l])c=false; | ^ a.cc:19:38: error: invalid types 'int[int]' for array subscript 19 | if(a[i+k][j+l]!=b[k][l])c=false; | ^
s645654538
p03804
C++
using System; namespace ABC054B { class Program { static void Main(string[] args) { string[] bufs = Console.ReadLine().Split(' '); int N = Int32.Parse(bufs[0]); int M = Int32.Parse(bufs[1]); string[] A = new string[N]; string[] B = new string[M]; bool res = false; for (int i = 0; i < N; i++) { A[i] = Console.ReadLine(); } for (int i = 0; i < M; i++) { B[i] = Console.ReadLine(); } int cur = -1; int seek = 0; while (seek < (N - M + 1)) { cur = A[seek].IndexOf(B[0], cur + 1); seek++; if (cur != -1) { int j = 1; while (j < M) { if (A[seek].IndexOf(B[j], cur, M) != cur) { break; } seek++; j++; } if (j >= M) { res = true; } } } Console.WriteLine(res ? "Yes" : "No"); return; } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:7:26: error: 'string' has not been declared 7 | static void Main(string[] args) | ^~~~~~ a.cc:7:35: error: expected ',' or '...' before 'args' 7 | static void Main(string[] args) | ^~~~ a.cc:53:6: error: expected ';' after class definition 53 | } | ^ | ; a.cc: In static member function 'static void ABC054B::Program::Main(int*)': a.cc:9:13: error: 'string' was not declared in this scope 9 | string[] bufs = Console.ReadLine().Split(' '); | ^~~~~~ a.cc:9:20: error: expected primary-expression before ']' token 9 | string[] bufs = Console.ReadLine().Split(' '); | ^ a.cc:10:21: error: 'Int32' was not declared in this scope 10 | int N = Int32.Parse(bufs[0]); | ^~~~~ a.cc:10:33: error: 'bufs' was not declared in this scope 10 | int N = Int32.Parse(bufs[0]); | ^~~~ a.cc:12:20: error: expected primary-expression before ']' token 12 | string[] A = new string[N]; | ^ a.cc:13:20: error: expected primary-expression before ']' token 13 | string[] B = new string[M]; | ^ a.cc:19:17: error: 'A' was not declared in this scope 19 | A[i] = Console.ReadLine(); | ^ a.cc:19:24: error: 'Console' was not declared in this scope 19 | A[i] = Console.ReadLine(); | ^~~~~~~ a.cc:23:17: error: 'B' was not declared in this scope 23 | B[i] = Console.ReadLine(); | ^ a.cc:23:24: error: 'Console' was not declared in this scope 23 | B[i] = Console.ReadLine(); | ^~~~~~~ a.cc:31:23: error: 'A' was not declared in this scope 31 | cur = A[seek].IndexOf(B[0], cur + 1); | ^ a.cc:31:39: error: 'B' was not declared in this scope 31 | cur = A[seek].IndexOf(B[0], cur + 1); | ^ a.cc:49:13: error: 'Console' was not declared in this scope 49 | Console.WriteLine(res ? "Yes" : "No"); | ^~~~~~~
s129626550
p03804
C++
#include <stdio.h> #include <math.h> int main(void){ char a[2500],b[2500]; int i,n,m; scanf("%d%d",&n,&m); for(i=0;i<n;i++) scanf("%c",&a[i]); for(i=0;i<m;i++) scanf("%c",&b[i]); sqrt }
a.cc: In function 'int main()': a.cc:11:5: error: expected ';' before '}' token 11 | sqrt | ^ | ; ...... 20 | } | ~ a.cc:20:1: error: statement cannot resolve address of overloaded function 20 | } | ^
s765315723
p03804
C++
#include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; string a[50], b[50]; for (int i = 0; i < n; i++)cin >> a[i]; for (int i = 0; i < m; i++)cin >> b[i]; string ans = "No"; for (int i = 0; i + m <= n; i++) { ans = "No"; for (int j = 0;j <= n - m;j++) { for (int k = 0; k < m; k++) { if (a[i + k].substr(j, m) != b[k]) break; if (k == m)ans = "Yes"; } } } if (ans == "Yes") { break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:22:25: error: break statement not within loop or switch 22 | break; | ^~~~~ a.cc: At global scope: a.cc:25:9: error: 'cout' does not name a type 25 | cout << ans << endl; | ^~~~ a.cc:26:1: error: expected declaration before '}' token 26 | } | ^
s601471618
p03804
C++
#include <bits/stdc++.h> using namespace std; #define INF 1e9 signed main(){ ios::sync_with_stdio(false); cin.tie(0); int n,m; cin>>n>>m; char c1[60][60],c2[60][60]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>c1[i][j]; } } for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ cin>>c2[i][j]; } } bool ans=false; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ bool f=true; for(int k=0;k<m;k++){ for(int l=0;l<m;l++){ if((i+k)>=n || (j+l)>=n){ f=false continue; } if(c1[i+k][j+l]!=c2[k][l])f=false; } } if(f)ans=true; } } if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:35:32: error: expected ';' before 'continue' 35 | f=false | ^ | ; 36 | continue; | ~~~~~~~~
s661992132
p03804
C++
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <ctime> #include <queue> using namespace std; //typedef //------------------------------------------ typedef long long LL; typedef vector<int> VI; typedef vector<bool> VB; typedef vector<char> VC; typedef vector<VI> VVI; typedef vector<VB> VVB; typedef vector<string> VS; typedef vector<LL> VLL; typedef vector<VLL> VVLL; typedef pair<int, int> PII; typedef pair<LL, LL> PLL; typedef pair<int, string> PIS; typedef pair<string, int> PSI; typedef pair<string, string> PSS; //数値・文字列 //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } inline LL toLongLong(string s) { LL v; istringstream sin(s); sin >> v; return v; } template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } inline VC toVC(string s) { VC data(s.begin(), s.end()); return data; } template<typename List> void SPRIT(const std::string &s, const std::string &delim, List &result) { result.clear(); string::size_type pos = 0; while (pos != string::npos) { string::size_type p = s.find(delim, pos); if (p == string::npos) { result.push_back(s.substr(pos)); break; } else { result.push_back(s.substr(pos, p - pos)); } pos = p + delim.size(); } } string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { string result; string::size_type left = str.find_first_not_of(trimCharacterList); if (left != string::npos) { string::size_type right = str.find_last_not_of(trimCharacterList); result = str.substr(left, right - left + 1); } return result; } #define UPPER(s) transform((s).begin(), (s).end(), (s).begin(), ::toupper) #define LOWER(s) transform((s).begin(), (s).end(), (s).begin(), ::tolower) //四捨五入 nLen=小数点第N位にする //------------------------------------------ //四捨五入 double ceil_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut + 0.9); return dOut * pow(10.0, -nLen); } //切り捨て double floor_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut); return dOut * pow(10.0, -nLen); } //切り上げ double round_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut + 0.5); return dOut * pow(10.0, -nLen); } //n桁目の数の取得 int take_a_n(int num, int n) { string str = toString(num); return str[str.length() - n] - '0'; } //進数 //------------------------------------------ //"1111011" → 123 int strbase_2to10(const std::string &s) { int out = 0; for (int i = 0, size = s.size(); i < size; ++i) { out *= 2; out += ((int) s[i] == 49) ? 1 : 0; } return out; } //"123" → 1111011 int strbase_10to2(const std::string &s) { int binary = toInt(s); int out = 0; for (int i = 0; binary > 0; i++) { out = out + (binary % 2) * pow(static_cast<int>(10), i); binary = binary / 2; } return out; } //"ABC" 2748 int strbase_16to10(const std::string &s) { int out = stoi(s, 0, 16); return out; } //1111011 → 123 int intbase_2to10(int in) { string str = toString(in); return strbase_2to10(str); } //123 → 1111011 int intbase_10to2(int in) { string str = toString(in); return strbase_10to2(str); } int intbase_16to10(int in) { string str = toString(in); return strbase_16to10(str); } //123→ "7B" string intbase_10to16(unsigned int val, bool lower = true) { if (!val) return std::string("0"); std::string str; const char hc = lower ? 'a' : 'A'; // 小文字 or 大文字表記 while (val != 0) { int d = val & 15; // 16進数一桁を取得 if (d < 10) str.insert(str.begin(), d + '0'); // 10未満の場合 else // 10以上の場合 str.insert(str.begin(), d - 10 + hc); val >>= 4; } return str; } //整数を2進数表記したときの1の個数を返す LL bitcount64(LL bits) { bits = (bits & 0x5555555555555555) + (bits >> 1 & 0x5555555555555555); bits = (bits & 0x3333333333333333) + (bits >> 2 & 0x3333333333333333); bits = (bits & 0x0f0f0f0f0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f0f0f0f0f); bits = (bits & 0x00ff00ff00ff00ff) + (bits >> 8 & 0x00ff00ff00ff00ff); bits = (bits & 0x0000ffff0000ffff) + (bits >> 16 & 0x0000ffff0000ffff); return (bits & 0x00000000ffffffff) + (bits >> 32 & 0x00000000ffffffff); } //comparison //------------------------------------------ #define C_MAX(a, b) ((a)>(b)?(a):(b)) #define C_MIN(a, b) ((a)<(b)?(a):(b)) #define C_ABS(a, b) ((a)<(b)?(b)-(a):(a)-(b)) //container util //------------------------------------------ #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define SZ(a) int((a).size()) #define EACH(i, c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s, e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define RSORT(c) sort((c).rbegin(),(c).rend()) #define REVERSE(c) sort((c).begin(), (c).end()) #define SUMI(obj) accumulate((obj).begin(), (obj).end(), 0) #define SUMD(obj) accumulate((obj).begin(), (obj).end(), 0.) #define SUML(obj) accumulate((obj).begin(), (obj).end(), 0LL) #define UB(obj, n) upper_bound((obj).begin(), (obj).end(), n) #define LB(obj, n) lower_bound((obj).begin(), (obj).end(), n) #define BS(v, n) binary_search(ALL(v), (n)) #define PB push_back #define MP make_pair //input output //------------------------------------------ #define GL(s) getline(cin, (s)) #define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); #define OUT(d) std::cout<<(d); #define FOUT(n, d) std::cout<<std::fixed<<std::setprecision(n)<<(d); #define EL() std::cout << "\n"; #define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";} //repetition //------------------------------------------ #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)å #define REP(i, n) FOR(i,0,n) #define RREP(i, n) for(int i = n;i >= 0;i--) #define FORLL(i, a, b) for(LL i=LL(a);i<LL(b);++i) #define RFORLL(i, a, b) for(LL i=LL(b)-1;i>=LL(a);--i) #define REPLL(i, n) for(LL i=0;i<LL(n);++i) #define RREPLL(i, n) for(LL i=LL(n)-1;i>=0;--i) #define FOREACH(x, v) for(auto &(x) : (v)) #define FORITER(x, v) for(auto (x) = (v).begin(); (x) != (v).end(); ++(x)) //constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); //math //-------------------------------------------- //min <= aim <= max template<typename T> inline bool BETWEEN(const T aim, const T min, const T max) { if (min <= aim && aim <= max) { return true; } else { return false; } } template<class T> inline T SQR(const T x) { return x * x; } template<class T1, class T2> inline T1 POW(const T1 x, const T2 y) { if (!y)return 1; else if ((y & 1) == 0) { return SQR(POW(x, y >> 1)); } else return POW(x, y ^ 1) * x; } template<typename T> constexpr T ABS(T x) { static_assert(is_signed<T>::value, "ABS(): argument must be signed"); return x < 0 ? -x : x; } //partial_permutation nPr 順列 //first・・最初の数 //middle・・r(取り出す数) //last・・n(全体数) template<class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { reverse(middle, last); return next_permutation(first, last); } //combination nCr 組み合わせ //first1・・最初の数 //last1==first2・・r(取り出す数) //last2・・n(全体数) template<class BidirectionalIterator> bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, BidirectionalIterator last2) { if ((first1 == last1) || (first2 == last2)) { return false; } BidirectionalIterator m1 = last1; BidirectionalIterator m2 = last2; --m2; while (--m1 != first1 && !(*m1 < *m2)) { } bool result = (m1 == first1) && !(*first1 < *m2); if (!result) { while (first2 != m2 && !(*m1 < *first2)) { ++first2; } first1 = m1; std::iter_swap(first1, first2); ++first1; ++first2; } if ((first1 != last1) && (first2 != last2)) { m1 = last1; m2 = first2; while ((m1 != first1) && (m2 != last2)) { std::iter_swap(--m1, m2); ++m2; } std::reverse(first1, m1); std::reverse(first1, last1); std::reverse(m2, last2); std::reverse(first2, last2); } return !result; } //numeric_law //-------------------------------------------- template<typename T> constexpr bool ODD(T x) { return x % 2 != 0; } template<typename T> constexpr bool EVEN(T x) { return x % 2 == 0; } //最大公約数 template<class T> inline T GCD(const T x, const T y) { if (x < 0)return GCD(-x, y); if (y < 0)return GCD(x, -y); return (!y) ? x : GCD(y, x % y); } //最小公倍数 template<class T> inline T LCM(const T x, const T y) { if (x < 0)return LCM(-x, y); if (y < 0)return LCM(x, -y); return x * (y / GCD(x, y)); } //ax + by = 1 //x,yが変数に格納される template<class T> inline T EXTGCD(const T a, const T b, T &x, T &y) { if (a < 0) { T d = EXTGCD(-a, b, x, y); x = -x; return d; } if (b < 0) { T d = EXTGCD(a, -b, x, y); y = -y; return d; } if (!b) { x = 1; y = 0; return a; } else { T d = EXTGCD(b, a % b, x, y); T t = x; x = y; y = t - (a / b) * y; return d; } } //素数 template<class T> inline bool ISPRIME(const T x) { if (x <= 1)return false; for (T i = 2; SQR(i) <= x; i++)if (x % i == 0)return false; return true; } //素数をtrueとして返す template<class T> VB ERATOSTHENES(const T n) { VB arr(n, true); for (int i = 2; i < SQR(n); i++) { if (arr[i]) { for (int j = 0; i * (j + 2) < n; j++) { arr[i * (j + 2)] = false; } } } return arr; } // a <= x < b の素数を返す template<typename T> VB ERATOSTHENES(const T a, const T b) { VB small = ERATOSTHENES(b); VB prime(b - a, true); for (int i = 2; (T) (SQR(i)) < b; i++) { if (small[i]) { for (T j = max(2, (a + i - 1) / i) * i; j < b; j += i) { prime[j - a] = false; } } } return prime; } //約数 template<class T> vector<T> DIVISOR(T n) { vector<T> v; for (int i = 1; i * i <= n; ++i) { if (n % i == 0) { v.push_back(i); if (i != n / i) { v.push_back(n / i); } } } sort(v.begin(), v.end()); return v; } //組み合わせ個数 template<typename T> T NCR(T n, T r) { T ans = 1; for (T i = n; i > n - r; --i) { ans = ans * i; } for (T i = 1; i < r + 1; ++i) { ans = ans / i; } return ans; } //行列 int MATRIZ_CHAIN(VI &p, VVI &s) { const static int INF = 1 << 20; const int n = p.size() - 1; VVI X(n, VI(n, INF)); s.resize(n, VI(n)); for (int i = 0; i < n; ++i) X[i][i] = 0; for (int w = 1; w < n; ++w) for (int i = 0, j; j = i + w, j < n; ++i) for (int k = i; k < j; ++k) { int f = p[i] * p[k + 1] * p[j + 1]; if (X[i][k] + X[k + 1][j] + f < X[i][j]) { X[i][j] = X[i][k] + X[k + 1][j] + f; s[i][j] = k; } } return X[0][n - 1]; } //最長増加部分列 VI LIS(const VI &a) { const static int INF = 99999999; const int n = a.size(); VI A(n, INF); VI id(n); for (int i = 0; i < n; ++i) { id[i] = distance(A.begin(), lower_bound(A.begin(), A.end(), a[i])); A[id[i]] = a[i]; } int m = *max_element(id.begin(), id.end()); VI b(m + 1); for (int i = n - 1; i >= 0; --i) if (id[i] == m) b[m--] = a[i]; return b; } //最長共通部分列 string->toVC template<typename T> vector<T> LCS(const vector<T> &a, const vector<T> &b) { const int n = a.size(), m = b.size(); vector<VI> X(n + 1, VI(m + 1)); vector<VI> Y(n + 1, VI(m + 1)); REP(i, n) { REP(j, m) { if (a[i] == b[j]) { X[i + 1][j + 1] = X[i][j] + 1; Y[i + 1][j + 1] = 0; } else if (X[i + 1][j] < X[i][j + 1]) { X[i + 1][j + 1] = X[i][j + 1]; Y[i + 1][j + 1] = +1; } else { X[i + 1][j + 1] = X[i + 1][j]; Y[i + 1][j + 1] = -1; } } } vector<T> c; for (int i = n, j = m; i > 0 && j > 0;) { if (Y[i][j] > 0) --i; else if (Y[i][j] < 0) --j; else { c.PB(a[i - 1]); --i; --j; } } REVERSE(c); return c; } //コイン C総額 cs使用できるコインの種類 VI money_change(int C, VI &cs) { const int INF = 99999999; int n = cs.size(); VI xs(C + 1, INF); VI ys(C + 1); xs[0] = 0; for (int i = 0; i < n; ++i) { for (int c = 0; c + cs[i] <= C; ++c) { if (xs[c + cs[i]] > xs[c] + 1) { xs[c + cs[i]] = xs[c] + 1; ys[c + cs[i]] = c; } } } VI zs; for (int c = C; c > 0; c = ys[c]) { zs.push_back(c - ys[c]); } return zs; } //confirmation //-------------------------------------------- //clear memory #define CLR(a, b) memset((a), (b),sizeof(a)) //debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; int main() { int N, M; cin >> N >> M; VS A(N); REP(i, N){ cin >> A[i]; } VS B(M); REP(i, M){ cin >> B[i]; } bool good = false; for(int i=0;i<SZ(A)-SZ(B);i++){ for(int j=0;j<SZ(A)-SZ(B);j++){ bool ok = true; for(int k=0;k<SZ(B);k++){ for(int t=0;t<SZ(B);t++){ if(A[i+k][j+t] != B[k][t]){ ok = false; } } } if(ok){ good = true; } } } if(good){ cout << "Yes"; }else{ OUT("No"); } return 0; } /* * 4 25 10 10 14 20 21 10 5 2 4 * * */ #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <ctime> #include <queue> using namespace std; //typedef //------------------------------------------ typedef long long LL; typedef vector<int> VI; typedef vector<bool> VB; typedef vector<char> VC; typedef vector<VI> VVI; typedef vector<VB> VVB; typedef vector<string> VS; typedef vector<LL> VLL; typedef vector<VLL> VVLL; typedef pair<int, int> PII; typedef pair<LL, LL> PLL; typedef pair<int, string> PIS; typedef pair<string, int> PSI; typedef pair<string, string> PSS; //数値・文字列 //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } inline LL toLongLong(string s) { LL v; istringstream sin(s); sin >> v; return v; } template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } inline VC toVC(string s) { VC data(s.begin(), s.end()); return data; } template<typename List> void SPRIT(const std::string &s, const std::string &delim, List &result) { result.clear(); string::size_type pos = 0; while (pos != string::npos) { string::size_type p = s.find(delim, pos); if (p == string::npos) { result.push_back(s.substr(pos)); break; } else { result.push_back(s.substr(pos, p - pos)); } pos = p + delim.size(); } } string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { string result; string::size_type left = str.find_first_not_of(trimCharacterList); if (left != string::npos) { string::size_type right = str.find_last_not_of(trimCharacterList); result = str.substr(left, right - left + 1); } return result; } #define UPPER(s) transform((s).begin(), (s).end(), (s).begin(), ::toupper) #define LOWER(s) transform((s).begin(), (s).end(), (s).begin(), ::tolower) //四捨五入 nLen=小数点第N位にする //------------------------------------------ //四捨五入 double ceil_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut + 0.9); return dOut * pow(10.0, -nLen); } //切り捨て double floor_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut); return dOut * pow(10.0, -nLen); } //切り上げ double round_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double) (int) (dOut + 0.5); return dOut * pow(10.0, -nLen); } //n桁目の数の取得 int take_a_n(int num, int n) { string str = toString(num); return str[str.length() - n] - '0'; } //進数 //------------------------------------------ //"1111011" → 123 int strbase_2to10(const std::string &s) { int out = 0; for (int i = 0, size = s.size(); i < size; ++i) { out *= 2; out += ((int) s[i] == 49) ? 1 : 0; } return out; } //"123" → 1111011 int strbase_10to2(const std::string &s) { int binary = toInt(s); int out = 0; for (int i = 0; binary > 0; i++) { out = out + (binary % 2) * pow(static_cast<int>(10), i); binary = binary / 2; } return out; } //"ABC" 2748 int strbase_16to10(const std::string &s) { int out = stoi(s, 0, 16); return out; } //1111011 → 123 int intbase_2to10(int in) { string str = toString(in); return strbase_2to10(str); } //123 → 1111011 int intbase_10to2(int in) { string str = toString(in); return strbase_10to2(str); } int intbase_16to10(int in) { string str = toString(in); return strbase_16to10(str); } //123→ "7B" string intbase_10to16(unsigned int val, bool lower = true) { if (!val) return std::string("0"); std::string str; const char hc = lower ? 'a' : 'A'; // 小文字 or 大文字表記 while (val != 0) { int d = val & 15; // 16進数一桁を取得 if (d < 10) str.insert(str.begin(), d + '0'); // 10未満の場合 else // 10以上の場合 str.insert(str.begin(), d - 10 + hc); val >>= 4; } return str; } //整数を2進数表記したときの1の個数を返す LL bitcount64(LL bits) { bits = (bits & 0x5555555555555555) + (bits >> 1 & 0x5555555555555555); bits = (bits & 0x3333333333333333) + (bits >> 2 & 0x3333333333333333); bits = (bits & 0x0f0f0f0f0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f0f0f0f0f); bits = (bits & 0x00ff00ff00ff00ff) + (bits >> 8 & 0x00ff00ff00ff00ff); bits = (bits & 0x0000ffff0000ffff) + (bits >> 16 & 0x0000ffff0000ffff); return (bits & 0x00000000ffffffff) + (bits >> 32 & 0x00000000ffffffff); } //comparison //------------------------------------------ #define C_MAX(a, b) ((a)>(b)?(a):(b)) #define C_MIN(a, b) ((a)<(b)?(a):(b)) #define C_ABS(a, b) ((a)<(b)?(b)-(a):(a)-(b)) //container util //------------------------------------------ #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define SZ(a) int((a).size()) #define EACH(i, c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s, e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define RSORT(c) sort((c).rbegin(),(c).rend()) #define REVERSE(c) sort((c).begin(), (c).end()) #define SUMI(obj) accumulate((obj).begin(), (obj).end(), 0) #define SUMD(obj) accumulate((obj).begin(), (obj).end(), 0.) #define SUML(obj) accumulate((obj).begin(), (obj).end(), 0LL) #define UB(obj, n) upper_bound((obj).begin(), (obj).end(), n) #define LB(obj, n) lower_bound((obj).begin(), (obj).end(), n) #define BS(v, n) binary_search(ALL(v), (n)) #define PB push_back #define MP make_pair //input output //------------------------------------------ #define GL(s) getline(cin, (s)) #define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); #define OUT(d) std::cout<<(d); #define FOUT(n, d) std::cout<<std::fixed<<std::setprecision(n)<<(d); #define EL() std::cout << "\n"; #define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";} //repetition //------------------------------------------ #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)å #define REP(i, n) FOR(i,0,n) #define RREP(i, n) for(int i = n;i >= 0;i--) #define FORLL(i, a, b) for(LL i=LL(a);i<LL(b);++i) #define RFORLL(i, a, b) for(LL i=LL(b)-1;i>=LL(a);--i) #define REPLL(i, n) for(LL i=0;i<LL(n);++i) #define RREPLL(i, n) for(LL i=LL(n)-1;i>=0;--i) #define FOREACH(x, v) for(auto &(x) : (v)) #define FORITER(x, v) for(auto (x) = (v).begin(); (x) != (v).end(); ++(x)) //constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); //math //-------------------------------------------- //min <= aim <= max template<typename T> inline bool BETWEEN(const T aim, const T min, const T max) { if (min <= aim && aim <= max) { return true; } else { return false; } } template<class T> inline T SQR(const T x) { return x * x; } template<class T1, class T2> inline T1 POW(const T1 x, const T2 y) { if (!y)return 1; else if ((y & 1) == 0) { return SQR(POW(x, y >> 1)); } else return POW(x, y ^ 1) * x; } template<typename T> constexpr T ABS(T x) { static_assert(is_signed<T>::value, "ABS(): argument must be signed"); return x < 0 ? -x : x; } //partial_permutation nPr 順列 //first・・最初の数 //middle・・r(取り出す数) //last・・n(全体数) template<class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { reverse(middle, last); return next_permutation(first, last); } //combination nCr 組み合わせ //first1・・最初の数 //last1==first2・・r(取り出す数) //last2・・n(全体数) template<class BidirectionalIterator> bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, BidirectionalIterator last2) { if ((first1 == last1) || (first2 == last2)) { return false; } BidirectionalIterator m1 = last1; BidirectionalIterator m2 = last2; --m2; while (--m1 != first1 && !(*m1 < *m2)) { } bool result = (m1 == first1) && !(*first1 < *m2); if (!result) { while (first2 != m2 && !(*m1 < *first2)) { ++first2; } first1 = m1; std::iter_swap(first1, first2); ++first1; ++first2; } if ((first1 != last1) && (first2 != last2)) { m1 = last1; m2 = first2; while ((m1 != first1) && (m2 != last2)) { std::iter_swap(--m1, m2); ++m2; } std::reverse(first1, m1); std::reverse(first1, last1); std::reverse(m2, last2); std::reverse(first2, last2); } return !result; } //numeric_law //-------------------------------------------- template<typename T> constexpr bool ODD(T x) { return x % 2 != 0; } template<typename T> constexpr bool EVEN(T x) { return x % 2 == 0; } //最大公約数 template<class T> inline T GCD(const T x, const T y) { if (x < 0)return GCD(-x, y); if (y < 0)return GCD(x, -y); return (!y) ? x : GCD(y, x % y); } //最小公倍数 template<class T> inline T LCM(const T x, const T y) { if (x < 0)return LCM(-x, y); if (y < 0)return LCM(x, -y); return x * (y / GCD(x, y)); } //ax + by = 1 //x,yが変数に格納される template<class T> inline T EXTGCD(const T a, const T b, T &x, T &y) { if (a < 0) { T d = EXTGCD(-a, b, x, y); x = -x; return d; } if (b < 0) { T d = EXTGCD(a, -b, x, y); y = -y; return d; } if (!b) { x = 1; y = 0; return a; } else { T d = EXTGCD(b, a % b, x, y); T t = x; x = y; y = t - (a / b) * y; return d; } } //素数 template<class T> inline bool ISPRIME(const T x) { if (x <= 1)return false; for (T i = 2; SQR(i) <= x; i++)if (x % i == 0)return false; return true; } //素数をtrueとして返す template<class T> VB ERATOSTHENES(const T n) { VB arr(n, true); for (int i = 2; i < SQR(n); i++) { if (arr[i]) { for (int j = 0; i * (j + 2) < n; j++) { arr[i * (j + 2)] = false; } } } return arr; } // a <= x < b の素数を返す template<typename T> VB ERATOSTHENES(const T a, const T b) { VB small = ERATOSTHENES(b); VB prime(b - a, true); for (int i = 2; (T) (SQR(i)) < b; i++) { if (small[i]) { for (T j = max(2, (a + i - 1) / i) * i; j < b; j += i) { prime[j - a] = false; } } } return prime; } //約数 template<class T> vector<T> DIVISOR(T n) { vector<T> v; for (int i = 1; i * i <= n; ++i) { if (n % i == 0) { v.push_back(i); if (i != n / i) { v.push_back(n / i); } } } sort(v.begin(), v.end()); return v; } //組み合わせ個数 template<typename T> T NCR(T n, T r) { T ans = 1; for (T i = n; i > n - r; --i) { ans = ans * i; } for (T i = 1; i < r + 1; ++i) { ans = ans / i; } return ans; } //行列 int MATRIZ_CHAIN(VI &p, VVI &s) { const static int INF = 1 << 20; const int n = p.size() - 1; VVI X(n, VI(n, INF)); s.resize(n, VI(n)); for (int i = 0; i < n; ++i) X[i][i] = 0; for (int w = 1; w < n; ++w) for (int i = 0, j; j = i + w, j < n; ++i) for (int k = i; k < j; ++k) { int f = p[i] * p[k + 1] * p[j + 1]; if (X[i][k] + X[k + 1][j] + f < X[i][j]) { X[i][j] = X[i][k] + X[k + 1][j] + f; s[i][j] = k; } } return X[0][n - 1]; } //最長増加部分列 VI LIS(const VI &a) { const static int INF = 99999999; const int n = a.size(); VI A(n, INF); VI id(n); for (int i = 0; i < n; ++i) { id[i] = distance(A.begin(), lower_bound(A.begin(), A.end(), a[i])); A[id[i]] = a[i]; } int m = *max_element(id.begin(), id.end()); VI b(m + 1); for (int i = n - 1; i >= 0; --i) if (id[i] == m) b[m--] = a[i]; return b; } //最長共通部分列 string->toVC template<typename T> vector<T> LCS(const vector<T> &a, const vector<T> &b) { const int n = a.size(), m = b.size(); vector<VI> X(n + 1, VI(m + 1)); vector<VI> Y(n + 1, VI(m + 1)); REP(i, n) { REP(j, m) { if (a[i] == b[j]) { X[i + 1][j + 1] = X[i][j] + 1; Y[i + 1][j + 1] = 0; } else if (X[i + 1][j] < X[i][j + 1]) { X[i + 1][j + 1] = X[i][j + 1]; Y[i + 1][j + 1] = +1; } else { X[i + 1][j + 1] = X[i + 1][j]; Y[i + 1][j + 1] = -1; } } } vector<T> c; for (int i = n, j = m; i > 0 && j > 0;) { if (Y[i][j] > 0) --i; else if (Y[i][j] < 0) --j; else { c.PB(a[i - 1]); --i; --j; } } REVERSE(c); return c; } //コイン C総額 cs使用できるコインの種類 VI money_change(int C, VI &cs) { const int INF = 99999999; int n = cs.size(); VI xs(C + 1, INF); VI ys(C + 1); xs[0] = 0; for (int i = 0; i < n; ++i) { for (int c = 0; c + cs[i] <= C; ++c) { if (xs[c + cs[i]] > xs[c] + 1) { xs[c + cs[i]] = xs[c] + 1; ys[c + cs[i]] = c; } } } VI zs; for (int c = C; c > 0; c = ys[c]) { zs.push_back(c - ys[c]); } return zs; } //confirmation //-------------------------------------------- //clear memory #define CLR(a, b) memset((a), (b),sizeof(a)) //debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; int main() { int N, M; cin >> N >> M; VS A(N); REP(i, N){ cin >> A[i]; } VS B(M); REP(i, M){ cin >> B[i]; } bool good = false; for(int i=0;i<SZ(A)-SZ(B);i++){ for(int j=0;j<SZ(A)-SZ(B);j++){ bool ok = true; for(int k=0;k<SZ(B);k++){ for(int t=0;t<SZ(B);t++){ if(A[i+k][j+t] != B[k][t]){ ok=false; break; } } } if(ok){ good = true; } } } if(good){ cout << "Yes"; }else{ OUT("No"); } return 0; } /* * 4 25 10 10 14 20 21 10 5 2 4 * * */
a.cc:6:23: error: missing terminating > character 6 | #include <set//include | ^ a.cc:713:12: error: redefinition of 'int toInt(std::string)' 713 | inline int toInt(string s) { | ^~~~~ a.cc:54:12: note: 'int toInt(std::string)' previously defined here 54 | inline int toInt(string s) { | ^~~~~ a.cc:720:11: error: redefinition of 'LL toLongLong(std::string)' 720 | inline LL toLongLong(string s) { | ^~~~~~~~~~ a.cc:61:11: note: 'LL toLongLong(std::string)' previously defined here 61 | inline LL toLongLong(string s) { | ^~~~~~~~~~ a.cc:728:15: error: redefinition of 'template<class T> std::string toString(T)' 728 | inline string toString(T x) { | ^~~~~~~~ a.cc:69:15: note: 'template<class T> std::string toString(T)' previously declared here 69 | inline string toString(T x) { | ^~~~~~~~ a.cc:734:11: error: redefinition of 'VC toVC(std::string)' 734 | inline VC toVC(string s) { | ^~~~ a.cc:75:11: note: 'VC toVC(std::string)' previously defined here 75 | inline VC toVC(string s) { | ^~~~ a.cc:740:6: error: redefinition of 'template<class List> void SPRIT(const std::string&, const std::string&, List&)' 740 | void SPRIT(const std::string &s, const std::string &delim, List &result) { | ^~~~~ a.cc:81:6: note: 'template<class List> void SPRIT(const std::string&, const std::string&, List&)' previously declared here 81 | void SPRIT(const std::string &s, const std::string &delim, List &result) { | ^~~~~ a.cc:755:8: error: redefinition of 'std::string TRIM(const std::string&, const char*)' 755 | string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { | ^~~~ a.cc:96:8: note: 'std::string TRIM(const std::string&, const char*)' previously defined here 96 | string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { | ^~~~ a.cc:774:8: error: redefinition of 'double ceil_n(double, int)' 774 | double ceil_n(double dIn, int nLen) { | ^~~~~~ a.cc:115:8: note: 'double ceil_n(double, int)' previously defined here 115 | double ceil_n(double dIn, int nLen) { | ^~~~~~ a.cc:782:8: error: redefinition of 'double floor_n(double, int)' 782 | double floor_n(double dIn, int nLen) { | ^~~~~~~ a.cc:123:8: note: 'double floor_n(double, int)' previously defined here 123 | double floor_n(double dIn, int nLen) { | ^~~~~~~ a.cc:790:8: error: redefinition of 'double round_n(double, int)' 790 | double round_n(double dIn, int nLen) { | ^~~~~~~ a.cc:131:8: note: 'double round_n(double, int)' previously defined here 131 | double round_n(double dIn, int nLen) { | ^~~~~~~ a.cc:798:5: error: redefinition of 'int take_a_n(int, int)' 798 | int take_a_n(int num, int n) { | ^~~~~~~~ a.cc:139:5: note: 'int take_a_n(int, int)' previously defined here 139 | int take_a_n(int num, int n) { | ^~~~~~~~ a.cc:808:5: error: redefinition of 'int strbase_2to10(const std::string&)' 808 | int strbase_2to10(const std::string &s) { | ^~~~~~~~~~~~~ a.cc:149:5: note: 'int strbase_2to10(const std::string&)' previously defined here 149 | int strbase_2to10(const std::string &s) { | ^~~~~~~~~~~~~ a.cc:818:5: error: redefinition of 'int strbase_10to2(const std::string&)' 818 | int strbase_10to2(const std::string &s) { | ^~~~~~~~~~~~~ a.cc:159:5: note: 'int strbase_10to2(const std::string&)' previously defined here 159 | int strbase_10to2(const std::string &s) { | ^~~~~~~~~~~~~ a.cc:829:5: error: redefinition of 'int strbase_16to10(const std::string&)' 829 | int strbase_16to10(const std::string &s) { | ^~~~~~~~~~~~~~ a.cc:170:5: note: 'int strbase_16to10(const std::string&)' previously defined here 170 | int strbase_16to10(const std::string &s) { | ^~~~~~~~~~~~~~ a.cc:835:5: error: redefinition of 'int intbase_2to10(int)' 835 | int intbase_2to10(int in) { | ^~~~~~~~~~~~~ a.cc:176:5: note: 'int intbase_2to10(int)' previously defined here 176 | int intbase_2to10(int in) { | ^~~~~~~~~~~~~ a.cc:841:5: error: redefinition of 'int intbase_10to2(int)' 841 | int intbase_10to2(int in) { | ^~~~~~~~~~~~~ a.cc:182:5: note: 'int intbase_10to2(int)' previously defined here 182 | int intbase_10to2(int in) { | ^~~~~~~~~~~~~ a.cc:846:5: error: redefinition of 'int intbase_16to10(int)' 846 | int intbase_16to10(int in) { | ^~~~~~~~~~~~~~ a.cc:187:5: note: 'int intbase_16to10(int)' previously defined here 187 | int intbase_16to10(int in) { | ^~~~~~~~~~~~~~ a.cc:852:8: error: redefinition of 'std::string intbase_10to16(unsigned int, bool)' 852 | string intbase_10to16(unsigned int val, bool lower = true) { | ^~~~~~~~~~~~~~ a.cc:193:8: note: 'std::string intbase_10to16(unsigned int, bool)' previously defined here 193 | string intbase_10to16(unsigned int val, bool lower = true) { | ^~~~~~~~~~~~~~ a.cc:869:4: error: redefinition of 'LL bitcount64(LL)' 869 | LL bitcount64(LL bits) { | ^~~~~~~~~~ a.cc:210:4: note: 'LL bitcount64(LL)' previously defined here 210 | LL bitcount64(LL bits) { | ^~~~~~~~~~ a.cc:941:14: error: redefinition of 'const double EPS' 941 | const double EPS = 1e-10; | ^~~ a.cc:282:14: note: 'const double EPS' previously defined here 282 | const double EPS = 1e-10; | ^~~ a.cc:942:14: error: redefinition of 'const double PI' 942 | const double PI = acos(-1.0); | ^~ a.cc:283:14: note: 'const double PI' previously defined here 283 | const double PI = acos(-1.0); | ^~ a.cc:952:13: error: redefinition of 'template<class T> bool BETWEEN(T, T, T)' 952 | inline bool BETWEEN(const T aim, const T min, const T max) { | ^~~~~~~ a.cc:293:13: note: 'template<class T> bool BETWEEN(T, T, T)' previously declared here 293 | inline bool BETWEEN(const T aim, const T min, const T max) { | ^~~~~~~ a.cc:962:10: error: redefinition of 'template<class T> T SQR(T)' 962 | inline T SQR(const T x) { return x * x; } | ^~~ a.cc:303:10: note: 'template<class T> T SQR(T)' previously declared here 303 | inline T SQR(const T x) { return x * x; } | ^~~ a.cc:965:11: error: redefinition of 'template<class T1, class T2> T1 POW(T1, T2)' 965 | inline T1 POW(const T1 x, const T2 y) { | ^~~ a.cc:306:11: note: 'template<class T1, class T2> T1 POW(T1, T2)' previously declared here 306 | inline T1 POW(const T1 x, const T2 y) { | ^~~ a.cc:974:13: error: redefinition of 'template<class T> constexpr T ABS(T)' 974 | constexpr T ABS(T x) { | ^~~ a.cc:315:13: note: 'template<class T> constexpr T ABS(T)' previously declared here 315 | constexpr T ABS(T x) { | ^~~ a.cc:984:6: error: redefinition of 'template<class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator, BidirectionalIterator, BidirectionalIterator)' 984 | bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { | ^~~~~~~~~~~~~~~~~~~~~~~~ a.cc:325:6: note: 'template<class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator, BidirectionalIterator, BidirectionalIterator)' previously declared here 325 | bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { | ^~~~~~~~~~~~~~~~~~~~~~~~ a.cc:994:6: error: redefinition of 'template<class BidirectionalIterator> bool next_combination(BidirectionalIterator, BidirectionalIterator, BidirectionalIterator, BidirectionalIterator)' 994 | bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, | ^~~~~~~~~~~~~~~~ a.cc:335:6: note: 'template<class BidirectionalIterator> bool next_combination(BidirectionalIterator, BidirectionalIterator, BidirectionalIterator, BidirectionalIterator)' previously declared here 335 | bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, | ^~~~~~~~~~~~~~~~ a.cc:1037:16: error: redefinition of 'template<class T> constexpr bool ODD(T)' 1037 | constexpr bool ODD(T x) { | ^~~ a.cc:378:16: note: 'template<class T> constexpr bool ODD(T)' previously declared here 378 | constexpr bool ODD(T x) { | ^~~ a.cc:1042:16: error: redefinition of 'template<class T> constexpr bool EVEN(T)' 1042 | constexpr bool EVEN(T x) { | ^~~~ a.cc:383:16: note: 'template<class T> constexpr bool EVEN(T)' previously declared here 383 | constexpr bool EVEN(T x) { | ^~~~ a.cc:1048:10: error: redefinition of 'template<class T> T GCD(T, T)' 1048 | inline T GCD(const T x, const T y) { | ^~~ a.cc:389:10: note: 'template<class T> T GCD(T, T)' previously declared here 389 | inline T GCD(const T x, const T y) { | ^~~ a.cc:1056:10: error: redefinition of 'template<class T> T LCM(T, T)' 1056 | inline T LCM(const T x, const T y) { | ^~~ a.cc:397:10: note: 'template<class T> T LCM(T, T)' previously declared here 397 | inline T LCM(const T x, const T y) { | ^~~ a.cc:1065:10: error: redefinition of 'template<class T> T EXTGCD(T, T, T&, T&)' 1065 | inline T EXTGCD(const T a, const T b, T &x, T &y) { | ^~~~~~ a.cc:406:10: note: 'template<class T> T EXTGCD(T, T, T&, T&)' previously declared here 406 | inline T EXTGCD(const T a, const T b, T &x, T &y) { | ^~~~~~ a.cc:1091:13: error: redefinition of 'template<class T> bool ISPRIME(T)' 1091 | inline bool ISPRIME(const T x) { | ^~~~~~~ a.cc:432:13: note: 'template<class T> bool ISPRIME(T)' previously declared here 432 | inline bool ISPRIME(const T x) { | ^~~~~~~ a.cc:1099:4: error: redefinition o
s301920456
p03804
C++
#include <bits/stdc++.h> using namespace std; int n,m; char a[55][55],b[55][55]; int main(){ cin >> n >> m; for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[j][i]; for(int i=0;i<m;i++)for(int j=0;j<n;j++)cin>>b[j][i]; bool exist=false; for(int dy=0;dy<n;dy++){ for(int dx=0;dx<n;dx++){ if(dx+m-1>=n||dy+m-1>=n)continue; bool match=true; for(int y=0;y<m;y++){ for(int x=0;x<m;x++){ if(a[dy+y][dx+x]!=b[y][x])match=false; } } } if(match) exist=true; } if(exist)cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:25:20: error: 'match' was not declared in this scope; did you mean 'rpmatch'? 25 | if(match) exist=true; | ^~~~~ | rpmatch
s728214013
p03804
C++
#include <bits/stdc++.h> using namespace std; int n,m,dy; char a[55][55],b[55][55]; int main(){ cin >> n >> m; for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[j][i]; for(int i=0;i<m;i++)for(int j=0;j<n;j++)cin>>b[j][i]; bool exist=false; for(int dy=0;dy<n;dy++){ for(dx=0;dx<n;dx++){ if(dx+m-1>=n||dy+m-1>=n)continue; } bool match=true; for(int y=0;y<m;y++){ for(int x=0;x<m;x++){ if(a[dy+y][dx+x]!=b[y][x])match=false; } } if(match) exist=true; } if(exist)cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:16:21: error: 'dx' was not declared in this scope; did you mean 'dy'? 16 | for(dx=0;dx<n;dx++){ | ^~ | dy a.cc:22:44: error: 'dx' was not declared in this scope; did you mean 'x'? 22 | if(a[dy+y][dx+x]!=b[y][x])match=false; | ^~ | x
s835885986
p03804
C++
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; char A[N][N], B[M][M]; for(int i=0; i<N; i++){ for(int j=0; j<N; j++){ cin >> A[i][j]; } } for(int i=0; i<M; i++){ for(int j=0; j<M; j++){ cin >> B[i][j]; } } for(int y=0; y<N-M+1; y++){ int flag=1; for(int x=0; x<N-M+1; x++){ if(A[y][x]==B[0][0]){ flag = 0; for(int i=1; i<M; i++){ for(int j=1; j<M; j++){ if(A[y+i][x+j]!=B[i][j]){ flag=1; break; } } if(flag==1){ break; } } } } if(flag==0){ cout << "Yes" << endl; return 0; } cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:42:2: error: expected '}' at end of input 42 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s776394708
p03804
C++
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; char A[N][N], B[M][M]; for(int i=0; i<N; i++){ for(int j=0; j<N; j++){ cin >> A[i][j]; } } for(int i=0; i<M; i++){ for(int j=0; j<M; j++){ cin >> B[i][j]; } } for(int y=0; y<N-M+1; y++){ int flag=0; for(int x=0; x<N-M+1; x++){ if(A[y][x]==B[0][0]){ for(int i=1; i<M; i++){ for(int j=1; j<M; j++){ if(A[y+i][x+j]!=B[i][j]){ flag=1; break; } } if(flag==1) break; } else if { flag = 1; } } if(flag==0){ cout << "Yes" << endl; return 0; } cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:31:27: error: expected '}' before 'else' 31 | } else if { | ^~~~ a.cc:22:45: note: to match this '{' 22 | if(A[y][x]==B[0][0]){ | ^ a.cc:31:35: error: expected '(' before '{' token 31 | } else if { | ^ | ( a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s018138778
p03804
C++
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; char A[N][N], B[M][M]; for(int i=0; i<N; i++){ for(int j=0; j<N; j++){ cin >> A[i][j]; } } for(int i=0; i<M; i++){ for(int j=0; j<M; j++){ cin >> B[i][j]; } } for(int y=0; y<N-M+1; y++){ int flag=0; for(int x=0; x<N-M+1; x++){ if(A[y][x]==B[0][0]){ for(int i=1; i<M; i++){ for(int j=1; j<M; j++){ if(A[y+i][x+j]!=B[i][j]){ flag=1; break; } } if(flag==1) break; } } else if { flag = 1; } } if(flag==0){ cout << "Yes" << endl; return 0; } cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:32:35: error: expected '(' before '{' token 32 | } else if { | ^ | ( a.cc:41:2: error: expected '}' at end of input 41 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s572403675
p03804
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s085323860
p03804
C++
#include <iostream> using namespace std; int main(){ int N, M, c; cin >> N >> M; int A[N][N], B[M][M]; for(int i=0; i<N; i++){ for(int j=0; j<N; j++){ cin >> A[i][j]; } } for(int i=0; i<M; i++){ for(int j=0; j<M; j++){ cin >> B[i][j]; } } for(int i=0; i<N-M+1; i++){ c=0; for(int j=0; j<N-M+1; j++){ if(A[i][j]==B[0][0]){ for(int k=0; k<M; k++){ for(int l=0; l<M; l++){ if(A[i+k][j+l]!=B[k][l]){ c=1; break; } } if(c==1) break; } } else if(A[i][j]!=B[0][0]){ c=1; } if(c==0){ cout << "Yes" << endl; break; } } if(c==1) cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s713663276
p03804
C++
import sys def main(): n, m = map(int, input().split()) A = [list(input()) for _ in range(n)] B = [list(input()) for _ in range(m)] for i in range(n - m + 1): for j in range(n - m + 1): f = 1 for k in range(m): for l in range(m): if A[i + k][j + l] != B[k][l]: f = 0 break if f == 0: break if f: print("Yes") sys.exit() print("No") if __name__ == "__main__": main()
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s717110730
p03804
C++
#include <bits/stdc++.h> #define INF 114514810 using namespace std; int main(void){ int n, m; char a[50], b[50]; cin >> n >> m; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n - m; i++) { bool flag = true; for (int j = 0; i < m; j++) { if (a[i + j] != b[j]) { flag = false; break; } } } cout << (flag ? "Yes" : "No") << endl; }
a.cc: In function 'int main()': a.cc:20:14: error: 'flag' was not declared in this scope 20 | cout << (flag ? "Yes" : "No") << endl; | ^~~~
s149485258
p03804
C++
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <set> #include <list> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const ll INF = 1LL<<29; const ll mod = 1e9+7; #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i)) #define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d)) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset((m),(v),sizeof(m)) #define chmin(x,y) (x=min(x,y)) #define chmax(x,y) (x=max(x,y)) #define fst first #define snd second #define UNIQUE(x) (x).erase(unique(all(x)),(x).end()) template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;} #define N 60 string s[N], t[N]; int main(){ int n, m; cin>>n>>m; rep(i, n) cin>>s[i]; rep(j, m) cin>>t[i]; rep(i, n-m+1) rep(j, n-m+1){ bool ok = true; rep(i2, m) rep(j2, m) if(t[i2][j2]!=s[i2+i][j2+j]) ok = false; if(ok){ cout<<"Yes"<<endl; return 0; } } cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:47:20: error: 'i' was not declared in this scope 47 | rep(j, m) cin>>t[i]; | ^
s468469015
p03804
C++
#include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostream> using namespace std; int main(){ int N,M; char A[51],B[51]; scanf("%d %d",&N,&M); for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++) scanf("%c",&A[i][j]); } for(int i=1;i<=M;i++){ for(int j=1;j<=M;j++) scanf("%c",&B[i][j]); } for(int i=1;i<=N-M+1;i++){ for(int j=1;j<=N-M+1;j++){ if(A[i][j]==B[1][1]){ bool f=true; for(int k=i;k<=i+M-1;k++){ for(int l=j;l<=j+M-1;l++){ if(A[k][l]!=B[k-i+1][l-j+1]){ f=false;break; } if(!f) break; } } if(f){ printf("Yes\n"); return 0; } } } } printf("No\n"); return 0; }
a.cc: In function 'int main()': a.cc:12:43: error: invalid types 'char[int]' for array subscript 12 | for(int j=1;j<=N;j++) scanf("%c",&A[i][j]); | ^ a.cc:15:43: error: invalid types 'char[int]' for array subscript 15 | for(int j=1;j<=M;j++) scanf("%c",&B[i][j]); | ^ a.cc:19:14: error: invalid types 'char[int]' for array subscript 19 | if(A[i][j]==B[1][1]){ | ^ a.cc:19:23: error: invalid types 'char[int]' for array subscript 19 | if(A[i][j]==B[1][1]){ | ^ a.cc:23:20: error: invalid types 'char[int]' for array subscript 23 | if(A[k][l]!=B[k-i+1][l-j+1]){ | ^ a.cc:23:33: error: invalid types 'char[int]' for array subscript 23 | if(A[k][l]!=B[k-i+1][l-j+1]){ | ^
s290544309
p03804
C++
#include<bits/stdc++.h> using namespace std; char a[1200][1200],b[120][120]; int n,m; int mark=1; int main() { cin>>n>>m; for(int i=0;i<n;i++) { scanf("%s",a[i]); } for(int i=0;i<m;i++) { scanf("%s",b[i]); } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(a[i][j]==b[0][0]) { flag=0; for(int x=0;x<m;x++) { for(int y=0;y<m;y++) { if(a[i+x][j+y]!=b[x][y]) { flag=1; break; } } } } if(flag==0) { printf("Yes"); return 0; } } } printf("No"); return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'flag' was not declared in this scope 17 | flag=0; | ^~~~ a.cc:27:17: error: 'flag' was not declared in this scope 27 | if(flag==0) { | ^~~~
s671198665
p03804
C++
#include <iostream> #include <string> using namespace std; int m,n; string a[100], b[100]; int main(){ cin >> m >> n; for(int i = 0; i < m; ++i){ cin >> a[i]; } for(int i = 0; i < n; ++i){ cin >> b[i]; } bool allok = false; for(int i = 0; i <= m - n; ++i){ for(int j = 0; j <= m - n; ++j){ bool ok = true; for(int k = 0; k < n; ++k){ for(int l = 0; l < n; ++l){ if(a[i + k][j + l] != b[k][l]) {ok = false; break} } } if(ok){allok =true; break;} } } cout << (allok ? "Yes" : "No") << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:50: error: expected ';' before '}' token 20 | if(a[i + k][j + l] != b[k][l]) {ok = false; break} | ^ | ;
s743198071
p03804
C++
#include<string> #include<vector> using namespace std; int main(){ int n,m; cin >> n >> m; vector<string> a(n,""), b(m,""); for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < m; i++){ cin >> b[i]; } bool match = false; for(int i = 0; i < n - m + 1; i++){ for(int j = 0; j < n - m + 1; j++){ for(int ii = 0; ii < m; ii++){ for(int jj = 0; jj < m; jj++){ if(a[i + ii][j + jj] == b[ii][jj]){ match = true; }else{ match = false; } } } if (match){ cout << "Yes" << endl; return 0; } } } cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> n >> m; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<vector> +++ |+#include <iostream> 3 | using namespace std; a.cc:28:17: error: 'cout' was not declared in this scope 28 | cout << "Yes" << endl; | ^~~~ a.cc:28:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:34: error: 'endl' was not declared in this scope 28 | cout << "Yes" << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include<vector> +++ |+#include <ostream> 3 | using namespace std; a.cc:33:5: error: 'cout' was not declared in this scope 33 | cout << "No" << endl; | ^~~~ a.cc:33:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:33:21: error: 'endl' was not declared in this scope 33 | cout << "No" << endl; | ^~~~ a.cc:33:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s855346342
p03804
C++
3 2 #.# .#. #.# #. .#
a.cc:2:2: error: invalid preprocessing directive #. 2 | #.# | ^ a.cc:3:2: error: stray '#' in program 3 | .#. | ^ a.cc:4:2: error: invalid preprocessing directive #. 4 | #.# | ^ a.cc:5:2: error: invalid preprocessing directive #. 5 | #. | ^ a.cc:6:2: error: stray '#' in program 6 | .# | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 2 | ^
s307002084
p03804
C++
#include <iostream> #include <string.h> using namespace std; int main() { int n, m; cin >> n >> m; char** a = new int[n][n]; char** b = new int[m][m]; for(int i = 0; i < n; i++ ) { for(int j = 0; j < n; j++) { cin >> a[i][j]; } } for(int i = 0; i < m; i++) { for(int j = 0; j < m; j++) { cin >> b[i][j]; } } for(int i = 0; i < n-m+1; i++) { for(int j = 0; j < n-m+1; j++) { for(int k = 0; k < m; k++) { if(strncmp(a[i+k]+j, b[0], m) != 0) break; if(k == m-1) { cout << "yes" << endl; return 0; } } } } cout << "no" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:32: error: array size in new-expression must be constant 8 | char** a = new int[n][n]; | ^ a.cc:8:32: error: the value of 'n' is not usable in a constant expression a.cc:6:13: note: 'int n' is not const 6 | int n, m; | ^ a.cc:9:32: error: array size in new-expression must be constant 9 | char** b = new int[m][m]; | ^ a.cc:9:32: error: the value of 'm' is not usable in a constant expression a.cc:6:16: note: 'int m' is not const 6 | int n, m; | ^
s423754199
p03804
C++
#define rep(i,n) for (int i=0;i<(n);i++) #include<iostream> using namespace std; int main(){ int m,n; string a[51],b[51]; cin >> n >> m; rep(i,n) cin >>a[i]; rep(i,m) cin >>b[i]; bool exist = false; for(int i=0;i<=n-m;i++){ for(int j=0;j<=n-m;j++{ bool match = true; for(int y=0;y<m;y++){ for(int x=0;x<m;x++){ if(a[i+y][j+x]!=b[y][x]) match=false; continue; } } if(match) exist=true; } } cout << ((exist) ? "Yes\n":"No\n"); return 0; }
a.cc: In function 'int main()': a.cc:14:39: error: expected ')' before '{' token 14 | for(int j=0;j<=n-m;j++{ | ~ ^ | )
s495958794
p03804
C
/* B - Template Matching <http://abc054.contest.atcoder.jp/tasks/abc054_b> */ #include <stdio.h> int main(int argc, char const *argv[]) { int N,M; int i,j,k,l; char A[50][51],B[50][51]; int judge; scanf("%d %d", &N, &M); for( i=0; i<N; i++ ){ scanf("%s", A[i]); } for( i=0; i<M; i++ ){ scanf("%s", B[i]); } for( i=0; i<N; i++ ){ for( j=0; j<N; j++ ){ judge = 0; for( k=0; k<M; k++ ){ for( l=0; l<M; l++ ){ if( (i+k < N) && (j+l < N) ){ if( A[i+k][j+l] == B[k][l] ){ judge = 1; } } } } if( judge == 1 ){ break; } } if( judge == 1 ){ break; } } if( judge == 1 ){ printf("Yes\n"); }else{ printf("No\n"); } return 0; } /* B - Template Matching <http://abc054.contest.atcoder.jp/tasks/abc054_b> */ #include <stdio.h> int main(int argc, char const *argv[]) { int N,M; int i,j,k,l; char A[50][51],B[50][51]; int judge; scanf("%d %d", &N, &M); for( i=0; i<N; i++ ){ scanf("%s", A[i]); } for( i=0; i<M; i++ ){ scanf("%s", B[i]); } for( i=0; i<N; i++ ){ for( j=0; j<N; j++ ){ judge = 0; for( k=0; k<M; k++ ){ for( l=0; l<M; l++ ){ if( (i+k < N) && (j+l < N) ){ if( A[i+k][j+l] == B[k][l] ){ judge = 1; } } } } if( judge == 1 ){ break; } } if( judge == 1 ){ break; } } if( judge == 1 ){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
main.c:59:5: error: redefinition of 'main' 59 | int main(int argc, char const *argv[]) { | ^~~~ main.c:8:5: note: previous definition of 'main' with type 'int(int, const char **)' 8 | int main(int argc, char const *argv[]) { | ^~~~
s581233923
p03804
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define vvi vector< vector<int> > #define vi vector<int> #define All(X) X.begin(),X.end() #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define REP(i,n) for(int i=0;i<(int)(n);i++) #define pb push_back #define pii pair<int,int> #define mp make_pair #define pi 3.14159265359 #define shosu(X) fixed << setprecision(X) ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} int main(){ int n,m; cin >> n >> m; vector<string> ns,ms; REP(i,n){ string tmp; cin >> tmp; ns.pb(tmp); } REP(i,m){ string tmp; cin >> tmp; ms.pb(tmp); } bool flg = false; REP(i,ms[0].size()-ns[0].size()+1){ REP(j,m - n + 1){ bool ok = true; FOR(k, i, i + ns[0].size()){ FOR(l, j, j + n){ if(ms[l][k] != ns[l-j][i-k]) ok = false; } } if(ok) flg = true; } } cout << flg ? "Yes" : "No" << endl; }
a.cc: In function 'int main()': a.cc:44:28: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 44 | cout << flg ? "Yes" : "No" << endl; | ~~~~~^~~~~~~
s154037696
p03804
C++
int main(void){ int N,M; cin >> N >> M; const int nmmax=50; char A[nmmax][nmmax],B[nmmax][nmmax]; for(int y=0;y<N;++y){ for(int x=0;x<N;++x){ cin >> A[y][x]; } } for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ cin >> B[y][x]; } } bool exist=false; for(int ly=0;ly<N;++ly){ for(int lx=0;lx<N;++lx){ if(ly+M-1>=N or lx+M-1>=N) continue; bool match=true; for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ if(A[ly+y][lx+x]!=B[y][x]) match=false; } } if(match) exist=true; } } if(exist) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:38:3: error: 'cout' was not declared in this scope 38 | cout << "Yes" << endl; | ^~~~ a.cc:38:20: error: 'endl' was not declared in this scope 38 | cout << "Yes" << endl; | ^~~~ a.cc:40:3: error: 'cout' was not declared in this scope 40 | cout << "No" << endl; | ^~~~ a.cc:40:19: error: 'endl' was not declared in this scope 40 | cout << "No" << endl; | ^~~~
s709112513
p03804
C++
int main(void){ int N,M; cin >> N >> M; const int nmmax=50; char A[nmmax][nmmax],B[nmmax][nmmax]; for(int y=0;y<N;++y){ for(int x=0;x<N;++x){ cin >> A[y][x]; } } for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ cin >> B[y][x]; } } bool exist=false; for(int ly=0;ly<N;++ly){ for(int lx=0;lx<N;++lx){ if(ly+M-1>=N or lx+M-1>=N) continue; bool match=true; for(int y=0;y<M;++y){ for(int x=0;x<M;++x){ if(A[ly+y][lx+x]!=B[y][x]) match=false; } } if(match) exist=true; } } if(exist) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:38:2: error: 'cout' was not declared in this scope 38 | cout << "Yes" << endl; | ^~~~ a.cc:38:19: error: 'endl' was not declared in this scope 38 | cout << "Yes" << endl; | ^~~~ a.cc:40:2: error: 'cout' was not declared in this scope 40 | cout << "No" << endl; | ^~~~ a.cc:40:18: error: 'endl' was not declared in this scope 40 | cout << "No" << endl; | ^~~~
s523430023
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int N=sc.nextInt(),M=sc.nextInt(),i,j,k,l; String[] a=new String[N],b=new String[M]; boolean f=true; for(i=0;i<N;i++){ a[i]=sc.next(); } for(i=0;i<M;i++){ b[i]=sc.next(); } for(i=0;i<N-M+1;i++){ for(j=0;j<N-M+1;j++){ for(k=0;k<M;k++){ for(l=0;l<M;l++){ if(a[i+k].charAt(j+l)!=b[k].charAt(l)){ f=false; break; } } } if(f==true){ System.out.println("Yes"); System.exit(0);; } f=true; } } System.out.println("No"); }
Main.java:32: error: reached end of file while parsing } ^ 1 error
s468347229
p03804
Java
a
Main.java:1: error: reached end of file while parsing a ^ 1 error
s016859017
p03804
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; class FMT { public: // P < 2^31 static constexpr uint32_t N = 1 << 27, W = 137, P = 15 * N + 1; FMT() : nx_(n_), ny_(1) { data_.resize(n_); } FMT(int nx, int ny) : nx_(nx), ny_(ny) { if ((nx & -nx) != nx || nx < 1 || nx > n_) throw; if ((ny & -ny) != ny || ny < 1 || ny > n_) throw; data_.resize(nx * ny); } static void init(int n) { if ((n & -n) != n || n < 1 || n > N) throw; n_ = n; if (n_ < 4) return; // Wのべき乗のテーブル w_ = (uint32_t *)malloc(n_ * 2 * sizeof *w_); w_[0] = 1; w_[1] = W; for (int n = n_; n < N; n *= 2) { w_[1] = mul(w_[1], w_[1]); } for (int i = 2; i < n_ / 2; i++) { w_[i] = mul(w_[i - 1], w_[1]); } // 各階層ごとに用意 uint32_t *w = w_, *w1 = w_ + n_ / 2; for (int j = n_ / 4; j != 0; j /= 2) { for (int i = 0; i < j; i++) { *w1 = *w; w += 2; w1 += 1; } } // 反対側 const uint32_t r2 = mul(w_[n_ / 4], w_[n_ / 4]); w = w_; for (int j = n_ / 2; j != 0; j /= 2) { w[n_] = 1; for (int i = 1; i < j; i++) { w[j - i + n_] = mul(w[i], r2); } w += j; } } static void uninit() { free(w_); } static uint32_t add(uint32_t a1, uint32_t a2) { const uint32_t t = a1 + a2; return t < P ? t : t - P; } static uint32_t sub(uint32_t a1, uint32_t a2) { const uint32_t t = a1 - a2; return t < P ? t : t + P; } static uint32_t mul(uint32_t a1, uint32_t a2) { return (uint64_t)a1 * (uint64_t)a2 % (uint64_t)P; } static uint32_t inv(uint32_t n) { // nは2冪 return n == 1 ? 1 : P - P / n; } uint32_t *data() { return &data_[0]; } uint32_t *operator[](size_t y) { return &data_[nx_ * y]; } void fmt(int sign) { auto f = [&](int n, int s, int m, int k) { for (int i = 0; i < k; i++) { if (n > 2) { if (sign > 0) { fmt_f(n, s, &data_[m * i], w_ + (n_ - n)); } else { fmt_t(n, s, &data_[m * i], w_ + n_ + (n_ - n)); } } else if (n == 2) { fmt_2(s, &data_[n * i]); } } }; f(nx_, 1, nx_, ny_); f(ny_, nx_, 1, nx_); } private: static int n_; static uint32_t *w_; std::vector<uint32_t> data_; int nx_, ny_; static void fmt_f(int n, int s, uint32_t *p, uint32_t *w) { const int m = n / 2; for (int i = 0; i < m; i++) { const int j = i + m; const uint32_t t0 = add(p[i * s], p[j * s]); const uint32_t t1 = mul(p[i * s] - p[j * s] + P, w[i]); p[i * s] = t0; p[j * s] = t1; } if (m == 2) { fmt_2(s, p); fmt_2(s, p + 2 * s); } else { fmt_f(m, s, p, w + m); fmt_f(m, s, p + m * s, w + m); } } static void fmt_t(int n, int s, uint32_t *p, uint32_t *w) { const int m = n / 2; if (m == 2) { fmt_2(s, p); fmt_2(s, p + 2 * s); } else { fmt_t(m, s, p, w + m); fmt_t(m, s, p + m * s, w + m); } for (int i = 0; i < m; i++) { int j = i + m; const uint32_t t0 = mul(w[i], p[j * s]); p[j * s] = sub(p[i * s], t0); p[i * s] = add(p[i * s], t0); } } static void fmt_2(int s, uint32_t *p) { const uint32_t t0 = add(p[0], p[s]); const uint32_t t1 = sub(p[0], p[s]); p[0] = t0; p[s] = t1; } }; int FMT::n_; uint32_t *FMT::w_; int main() { int n, m, l; cin >> n >> m; for (l = 1; l < n; l *= 2); FMT::init(l); FMT a(l, l), b(l, l); string s; memset(a.data(), 0, l * l * 4); memset(b.data(), 0, l * l * 4); for (int y = 0; y < n; y++) { cin >> s; for (int x = 0; x < n; x++) { a[y][x] = s[x] == '#' ? FMT::P - 1 : 1; } } for (int y = 0; y < m; y++) { cin >> s; for (int x = 0; x < m; x++) { b[y == 0 ? 0 : l - y][x == 0 ? 0 : l - x] = s[x] == '#' ? FMT::P - 1 : 1; } } a.fmt(+1); b.fmt(+1); for (int i = 0; i < l * l; i++) { a[0][i] = FMT::mul(a[0][i], b[0][i]); } a.fmt(-1); int k = n - m + 1; for (int y = 0; y < k; y++) { for (int x = 0; x < k; x++) { //uint32_t t = FMT::mul(a[y][x], FMT::inv(l * l)); //cout << x << " " << y << " " << (int32_t)(t < FMT::P / 2 ? t : t - FMT::P) << endl; if (a[y][x] == m * m * l * l) { cout << "Yes" << endl; quick_exit(0); } } } cout << "No" << endl; return 0; }
a.cc:10:22: error: 'uint32_t' does not name a type 10 | static constexpr uint32_t N = 1 << 27, W = 137, P = 15 * N + 1; | ^~~~~~~~ a.cc:5:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 4 | #include <algorithm> +++ |+#include <cstdint> 5 | using namespace std; a.cc:61:12: error: 'uint32_t' does not name a type 61 | static uint32_t add(uint32_t a1, uint32_t a2) { | ^~~~~~~~ a.cc:61:12: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:65:12: error: 'uint32_t' does not name a type 65 | static uint32_t sub(uint32_t a1, uint32_t a2) { | ^~~~~~~~ a.cc:65:12: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:69:12: error: 'uint32_t' does not name a type 69 | static uint32_t mul(uint32_t a1, uint32_t a2) { | ^~~~~~~~ a.cc:69:12: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:72:12: error: 'uint32_t' does not name a type 72 | static uint32_t inv(uint32_t n) { // nは2冪 | ^~~~~~~~ a.cc:72:12: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:76:5: error: 'uint32_t' does not name a type 76 | uint32_t *data() { | ^~~~~~~~ a.cc:76:5: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:79:5: error: 'uint32_t' does not name a type 79 | uint32_t *operator[](size_t y) { | ^~~~~~~~ a.cc:79:5: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:102:12: error: 'uint32_t' does not name a type 102 | static uint32_t *w_; | ^~~~~~~~ a.cc:102:12: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:103:17: error: 'uint32_t' was not declared in this scope 103 | std::vector<uint32_t> data_; | ^~~~~~~~ a.cc:103:17: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:103:25: error: template argument 1 is invalid 103 | std::vector<uint32_t> data_; | ^ a.cc:103:25: error: template argument 2 is invalid a.cc:106:37: error: 'uint32_t' has not been declared 106 | static void fmt_f(int n, int s, uint32_t *p, uint32_t *w) { | ^~~~~~~~ a.cc:106:50: error: 'uint32_t' has not been declared 106 | static void fmt_f(int n, int s, uint32_t *p, uint32_t *w) { | ^~~~~~~~ a.cc:125:37: error: 'uint32_t' has not been declared 125 | static void fmt_t(int n, int s, uint32_t *p, uint32_t *w) { | ^~~~~~~~ a.cc:125:50: error: 'uint32_t' has not been declared 125 | static void fmt_t(int n, int s, uint32_t *p, uint32_t *w) { | ^~~~~~~~ a.cc:143:30: error: 'uint32_t' has not been declared 143 | static void fmt_2(int s, uint32_t *p) { | ^~~~~~~~ a.cc: In constructor 'FMT::FMT()': a.cc:13:15: error: request for member 'resize' in '((FMT*)this)->FMT::data_', which is of non-class type 'int' 13 | data_.resize(n_); | ^~~~~~ a.cc: In constructor 'FMT::FMT(int, int)': a.cc:18:15: error: request for member 'resize' in '((FMT*)this)->FMT::data_', which is of non-class type 'int' 18 | data_.resize(nx * ny); | ^~~~~~ a.cc: In static member function 'static void FMT::init(int)': a.cc:22:43: error: 'N' was not declared in this scope 22 | if ((n & -n) != n || n < 1 || n > N) throw; | ^ a.cc:28:9: error: 'w_' was not declared in this scope; did you mean 'n_'? 28 | w_ = (uint32_t *)malloc(n_ * 2 * sizeof *w_); | ^~ | n_ a.cc:28:15: error: 'uint32_t' was not declared in this scope 28 | w_ = (uint32_t *)malloc(n_ * 2 * sizeof *w_); | ^~~~~~~~ a.cc:28:15: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:28:25: error: expected primary-expression before ')' token 28 | w_ = (uint32_t *)malloc(n_ * 2 * sizeof *w_); | ^ a.cc:30:17: error: 'W' was not declared in this scope 30 | w_[1] = W; | ^ a.cc:31:30: error: 'N' was not declared in this scope 31 | for (int n = n_; n < N; n *= 2) { | ^ a.cc:32:21: error: 'mul' was not declared in this scope 32 | w_[1] = mul(w_[1], w_[1]); | ^~~ a.cc:35:21: error: 'mul' was not declared in this scope 35 | w_[i] = mul(w_[i - 1], w_[1]); | ^~~ a.cc:38:19: error: 'w' was not declared in this scope 38 | uint32_t *w = w_, *w1 = w_ + n_ / 2; | ^ a.cc:38:28: error: 'w1' was not declared in this scope 38 | uint32_t *w = w_, *w1 = w_ + n_ / 2; | ^~ a.cc:47:15: error: 'uint32_t' does not name a type 47 | const uint32_t r2 = mul(w_[n_ / 4], w_[n_ / 4]); | ^~~~~~~~ a.cc:47:15: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:52:43: error: 'r2' was not declared in this scope 52 | w[j - i + n_] = mul(w[i], r2); | ^~ a.cc:52:33: error: 'mul' was not declared in this scope 52 | w[j - i + n_] = mul(w[i], r2); | ^~~ a.cc: In static member function 'static void FMT::uninit()': a.cc:58:14: error: 'w_' was not declared in this scope; did you mean 'n_'? 58 | free(w_); | ^~ | n_ a.cc: In lambda function: a.cc:87:43: error: invalid types 'int[int]' for array subscript 87 | fmt_f(n, s, &data_[m * i], w_ + (n_ - n)); | ^ a.cc:87:52: error: 'w_' was not declared in this scope; did you mean 'n_'? 87 | fmt_f(n, s, &data_[m * i], w_ + (n_ - n)); | ^~ | n_ a.cc:89:43: error: invalid types 'int[int]' for array subscript 89 | fmt_t(n, s, &data_[m * i], w_ + n_ + (n_ - n)); | ^ a.cc:89:52: error: 'w_' was not declared in this scope; did you mean 'n_'? 89 | fmt_t(n, s, &data_[m * i], w_ + n_ + (n_ - n)); | ^~ | n_ a.cc:92:36: error: invalid types 'int[int]' for array subscript 92 | fmt_2(s, &data_[n * i]); | ^ a.cc: In static member function 'static void FMT::fmt_f(int, int, int*, int*)': a.cc:111:19: error: 'uint32_t' does not name a type 111 | const uint32_t t0 = add(p[i * s], p[j * s]); | ^~~~~~~~ a.cc:111:19: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:112:19: error: 'uint32_t' does not name a type 112 | const uint32_t t1 = mul(p[i * s] - p[j * s] + P, w[i]); | ^~~~~~~~ a.cc:112:19: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:113:24: error: 't0' was not declared in this scope; did you mean 'tm'? 113 | p[i * s] = t0; | ^~ | tm a.cc:114:24: error: 't1' was not declared in this scope; did you mean 'tm'? 114 | p[j * s] = t1; | ^~ | tm a.cc: In static member function 'static void FMT::fmt_t(int, int, int*, int*)': a.cc:138:19: error: 'uint32_t' does not name a type 138 | const uint32_t t0 = mul(w[i], p[j * s]); | ^~~~~~~~ a.cc:138:19: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:139:38: error: 't0' was not declared in this scope; did you mean 'tm'? 139 | p[j * s] = sub(p[i * s], t0); | ^~ | tm a.cc:139:24: error: 'sub' was not declared in this scope 139 | p[j * s] = sub(p[i * s], t0); | ^~~ a.cc:140:24: error: 'add' was not declared in this scope 140 | p[i * s] = add(p[i * s], t0); | ^~~ a.cc: In static member function 'static void FMT::fmt_2(int, int*)': a.cc:144:15: error: 'uint32_t' does not name a type 144 | const uint32_t t0 = add(p[0], p[s]); | ^~~~~~~~ a.cc:144:15: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:145:15: error: 'uint32_t' does not name a type 145 | const uint32_t t1 = sub(p[0], p[s]); | ^~~~~~~~ a.cc:145:15: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:146:16: error: 't0' was not declared in this scope; did you mean 'tm'? 146 | p[0] = t0; | ^~ | tm a.cc:147:16: error: 't1' was not declared in this scope; did you mean 'tm'? 147 | p[s] = t1; | ^~ | tm a.cc: At global scope: a.cc:152:1: error: 'uint32_t' does not name a type 152 | uint32_t *FMT::w_;
s790249855
p03804
C++
#include <iostream> #include <vector> int main() { int n, m; std::cin >> n >> m; std::vector<std::string> a(n); std::vector<std::string> b(m); for (int i = 0; i <n;) { std::cin >> a[i]; } for (int i = 0; i <m;) { std::cin >> b[i]; } bool flag; for (int i = 0; i < n-m+1; i++) { //a's row; n-m+1 = 2 int row = i; int col = 0; flag = false; for (int j = 0; j< m; j++) { // b's row if (a[row].substr(col, m) == b[j]) { row++; flag = true; } else if (col < n-m +1) { col++; row = i; // reset j = 0; // reset flag = false; } else { flag = false; break; } } } if (flag) { std::cout << "Yes" << std::endl; } else { std::coud << "No" << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:38:8: error: 'coud' is not a member of 'std'; did you mean 'cout'? 38 | std::coud << "No" << std::endl; | ^~~~ | cout
s179174623
p03804
C++
#include <iostream> #include <vector> int main() { int n, m; std::cin >> n >> m; std::vector<std::string> a[n]; std::vector<std::string> b[m]; for (int i = 0; i <n;) { std::cin >> a[i]; } for (int i = 0; i <m;) { std::cin >> b[i]; } bool flag; for (int i = 0; i < n-m+1; i++) { //a's row; n-m+1 = 2 int row = i; int col = 0; flag = false; for (int j = 0; j< m; j++) { // b's row if (a[row].substr(col, m) == b[j]) { row++; flag = true; } else if (col < n-m +1) { col++; row = i; // reset j = 0; // reset flag = false; } else { flag = false; break; } } } if (flag) { std::cout << "Yes" << std::endl; } else { std::coud << "No" << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 9 | std::cin >> a[i]; | ~~~~~~~~ ^~ ~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~
s812460970
p03804
C++
#include <iostream> #include <vector> #include <cstdlib> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; int M; cin >> N >> M; vector<string> ar; vector<string> br; string s; for(int i = 0; i < N; i++){ cin >> s; ar.push_back(s); } for(int i = 0; i < M; i++){ cin >> s; br.push_back(s); } bool found = true; for(int i_a = 0; i_a < N; i_a++){ found = true; for(int i_b = 0; i_b < M; i_b++){ int tmp_i_a = i_a; size_t bt; size_t last_bt = 100; bt = ar[tmp_i_a].find(br[i_b]); if(bt == string::npos){ found = false; break; }else{ if(last_bt != 100){ if(bt != last_bt){ found = false; break; } } ++tmp_i_a; continue; } } } found ? cout << "Yes" << endl : cout << "No" << endl; re
a.cc: In function 'int main()': a.cc:54:5: error: 're' was not declared in this scope 54 | re | ^~ a.cc:54:7: error: expected '}' at end of input 54 | re | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s121960470
p03804
C++
#include<iostream> using namespace std; int main(){ int m,n,f=0; char a[51][51],b[51][51]; cin>>n>>m; for(int i=0;i<n;i++) for(int j=0;j<n;j++)cin>>a[i][j]; for(int i=0;i<m;i++) for(int j=0;j<m;j++)cin>>b[i][j]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(a[i][j]==b[0][0]){ int f1=0; for(int l=0;l<m;l++) if(i+l>=n)break; for(int k=0;k<m;k++) if(j+k>=n)break; if(a[i+l][j+k]==b[l][k])f=1; else if(a[i+l][j+k]!=b[l][k]){f=0;break;} } } if(f==1)cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: 'l' was not declared in this scope 21 | if(a[i+l][j+k]==b[l][k])f=1; | ^ a.cc:21:19: error: 'k' was not declared in this scope 21 | if(a[i+l][j+k]==b[l][k])f=1; | ^ a.cc: At global scope: a.cc:25:2: error: expected unqualified-id before 'if' 25 | if(f==1)cout<<"Yes"<<endl; | ^~ a.cc:26:2: error: expected unqualified-id before 'else' 26 | else cout<<"No"<<endl; | ^~~~ a.cc:27:2: error: expected unqualified-id before 'return' 27 | return 0; | ^~~~~~ a.cc:28:1: error: expected declaration before '}' token 28 | } | ^
s474734609
p03804
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<cmath> #include<cstring> #include<queue> #include<stack> #include<cstdio> #include<sstream> #include<iomanip> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define all(in) in.begin(),in.end() #define shosu(x) fixed<<setprecision(x) using namespace std; //kaewasuretyuui typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vp; typedef vector<vp> vvp; typedef vector<string> vs; typedef vector<double> vd; typedef vector<vd> vvd; typedef pair<int,pii> pip; typedef vector<pip>vip; const double PI=acos(-1); const double EPS=1e-9; const int inf=1e8; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; int main(){ int n,m; cin>>n>>m; vi a(n),b(m); rep(i,n)cin>>a[i]; rep(i,m)cin>>b[i]; rep(i,n-m+1)rep(j,n-m+1){ bool h=true; rep(x,m)rep(y,m)if(a[i+x][j+y]!=b[x][y])h=false; if(h){ cout<<"Yes"<<endl; return 0; } } cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:47:42: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 47 | rep(x,m)rep(y,m)if(a[i+x][j+y]!=b[x][y])h=false; | ^ a.cc:47:53: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 47 | rep(x,m)rep(y,m)if(a[i+x][j+y]!=b[x][y])h=false; | ^
s396497291
p03804
C++
#include<iostream> #include<string> using namespace std; int main(){ int N,M; vector<string> A,B; string s; cin >> N >> M; for(int i=0;i<N;++i){ cin >> s; A.push_back(s); } for(int i=0;i<M;++i){ cin >> s; B.push_back(s); } for(int i=0;i<N-M;++i){ int pos = A[i].find(B[0]); bool match = true; for(int j=1;j<M;++j){ if(A[i+j].substr(pos,M) != B[j]) { match = false; break; } } if(match == true) {cout << "Yes" << endl;return 0;} } cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:7:9: error: 'vector' was not declared in this scope 7 | vector<string> A,B; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | #include<string> a.cc:7:22: error: expected primary-expression before '>' token 7 | vector<string> A,B; | ^ a.cc:7:24: error: 'A' was not declared in this scope 7 | vector<string> A,B; | ^ a.cc:7:26: error: 'B' was not declared in this scope 7 | vector<string> A,B; | ^
s717771828
p03804
C++
#include<iostream> using namespace std; char a[50][50]; char b[50][50]; bool check(int m, int x, int y){ for(int i = 0; i < m; ++i){ for(int i2 = 0; i2 < m; ++i){ if(a[y + i][x + i2] != b[i][i2]){ return false; } } } return true; } int main(){ int n, m; cin >> n >> m; for(int i = 0; i < n; ++i){ cin >> a[i]; } for(int i = 0; i < m; ++i){ cin >> b[i]; } bool flg = false; for(int i = 0; i + m < n;++i){ for(int i2 = 0; i2 + m < n; ++i){ if(a[i][i2] == b[0][0]){ if(check()){ flg = true; break; } } } if(flg){ break; } } if(flg){ cout << "Yes" << endl; } else{ cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:26: error: too few arguments to function 'bool check(int, int, int)' 29 | if(check()){ flg = true; break; } | ~~~~~^~ a.cc:7:6: note: declared here 7 | bool check(int m, int x, int y){ | ^~~~~
s938400186
p03804
C++
#include <iostream> #include <string> using namespace std; int main(){ int N,M; cin >> N >> M; char A[N][N]; char B[M][M]; for(int i=0;i<N;i++){ string s; cin >> s; strcpy(A[i], s.c_str()); } for(int i=0;i<M;i++){ string s; cin >> s; strcpy(B[i], s.c_str()); } int a = N%M==0 ? N/M : N/M+1; bool b = true; for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ for(int k=0;k<M;k++){ for(int l=0;l<M;l++){ if(A[i*M+k][j*M+l]!=B[k][l]){ b=false; goto OUT; } } } OUT: if(b) { cout << "Yes" << endl; goto END; } } } END: if(!b) cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'strcpy' was not declared in this scope 14 | strcpy(A[i], s.c_str()); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | #include <string> a.cc:19:9: error: 'strcpy' was not declared in this scope 19 | strcpy(B[i], s.c_str()); | ^~~~~~ a.cc:19:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s891300041
p03804
C++
#include <bits/stdc++.h> #include<fstream> #define ll long long #define F first #define S second #define mp make_pair #define mod 1000000007 #define All(v) v.begin(),v.end() using namespace std; int main() { bool w = 0, b = 0; int n,m; cin >> n >> m; for(int i=0;i<n;i++) { string s; cin >> s; if(s.find('.') != string::npos) w = 1; if(s.find('#') != string::npos) b = 1; } bool ok = 0; for(int i=0;i<m;i++) { string s; cin >> s; if(s.find('.') != string::npos && w) ok = 1; if(s.find('#') != string::npos && b) ok = 1; } if(ok) cout << "Yes"; else cout << "No"; cout << '\n' return 0; }
a.cc: In function 'int main()': a.cc:45:13: error: expected ';' before 'return' 45 | cout << '\n' | ^ | ; 46 | 47 | return 0; | ~~~~~~
s635036033
p03804
C
#include<stdio.h> int main(){ int x,y,N,M; int a[50][50],b[50][50]; scanf("%d %d\n",&N,&M); for(x=0;x<N;x++){ for(y=0;y<N;y++){ scanf("%d",&a[x][y]); } } printf("\n"); for(x=0;x<M;x++){ for(y=0;y<M;y++){ scanf("%d",&b[x][y]); } } int lx,ly,A,B,n; n=0; for(x=0;x<N;x++){ for(y=0;y<N;y++){ for(lx=0;lx<M;lx++){ for(ly=0;ly<M;ly++){ if(a[x][y]==b[lx][ly]){n=1;} } } } } if(n==1){ printf("Yes"); }else if(n==0) { printf("No"); }
main.c: In function 'main': main.c:49:7: error: expected declaration or statement at end of input 49 | } | ^
s557708250
p03804
C
#include <stdio.h> int main(void) { int N, M; char A[50][50]; char B[50][50]; int i, j; int s, t; int f = 0; int tmp = 1; scanf("%d %d", &N, &M); for(i = 0; i < N; i++) { scanf("%s", &A[i]); } for(i = 0; i < M; i++) { scanf("%s", B[i]); } for(i = 0; i < N-M+1; i++) { for(j = 0; j < N-M+1; j++) { if(A[i][j] == B[0][0]) { for(s = 0; s < M; s++) { for(t = 0; t < M; t++) { if(A[i+s][j+t] != B[s][t]) { tmp = 0; break; } } if(tmp == 0) { tmp = 1;
main.c: In function 'main': main.c:32:13: error: expected declaration or statement at end of input 32 | tmp = 1; | ^~~ main.c:32:13: error: expected declaration or statement at end of input main.c:32:13: error: expected declaration or statement at end of input main.c:32:13: error: expected declaration or statement at end of input main.c:32:13: error: expected declaration or statement at end of input main.c:32:13: error: expected declaration or statement at end of input
s193555945
p03804
C++
#include <iostream> #include <string> #include <vector> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; int N, M; vector< vector<bool> > A, B; int find1(vector<bool> X, vector<bool> Y, int pos) { int y = Y.size(); int n = X.size() - y + 1; for(int i = pos; i < n; i++) { if(X[i] == Y[i]) { for(int j = 0; j <= y; j++) { if(j == y) return i; if(X[i+j] != Y[i+j]) break; } } } return -1; } bool contains(int al, int bl, int pos) { if (bl == M) return true; else if(bl == 0) { while((pos = find1(A[al], B[bl], pos)) != -1) { if(contains(al + 1, bl + 1, pos)) return true; } if(al == N - M) return false; else return contains(al + 1, 0, 0); } else { if(find1(A[al], B[bl], pos) == pos) return contains(al + 1, bl + 1, pos); else return false; } }
/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
s687069109
p03804
C++
#include <iostream> #include <string> using namespace std; int N, M; string board[60]; string pattern[60]; int main() { cin >> N >> M; for (int i = 0; i < N; i++) cin >> board[i]; for (int i = 0; i < M; i++) cin >> pattern[i]; bool found = false; for (int i = 0; i <= N - M; i++) { for (int j = 0; j <= N - M; j++) { if (match(i, j)) found = true; } } cout << (found ? "Yes" : "No") << endl; return 0; } bool match(int x, int y) { for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { if (board[x + i][y + j] != pattern[i][j]) return false; } } return true; }
a.cc: In function 'int main()': a.cc:16:29: error: 'match' was not declared in this scope; did you mean 'rpmatch'? 16 | if (match(i, j)) found = true; | ^~~~~ | rpmatch
s430971068
p03804
C++
//Written by Zhu Zeqi //Come on,baby //Hack,please #include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cstdio> #include<cstdlib> #include<cstring> #include<ctime> #include<cwchar> #include<cwctype> #include<deque> #include<exception> #include<fstream> #include<functional> #include<iomanip> #include<ios> #include<iosfwd> #include<iostream> #include<istream> #include<iterator> #include<limits> #include<list> #include<locale> #include<map> #include<memory> #include<new> #include<numeric> #include<ostream> #include<queue> #include<set> #include<sstream> #include<stack> #include<stdexcept> #include<streambuf> #include<string> #include<typeinfo> #include<utility> #include<valarray> #include<vector> #include<string.h> #include<stdlib.h> #include<stdio.h> #define pb push_back #define mp make_pair #define F first #define S second #define pii pair<int,int> #define vi vector<int> #define MAX 100000000000000000 #define MOD 1000000007 #define PI 3.141592653589793238462 #define INF 1000000000 typedef long long ll; using namespace std; //作者:中国江苏南京朱泽齐 int N,M; char A[51][51], B[51][51]; bool check(int x, int y) { for(int i=0;i<m;i++) { for(int j=0;j<m;j++){ if(A[x+j][y+i]!=B[j][i]){ return false; } } } return true; } int main(){ //freopen("input.in","r",stdin); //freopen("output.out","w",stdout); cin>>n>>m; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>A[j][i]; } } for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ cin>>B[j][i]; } } for(int y=0;y<=n-m;y++){ for(int x=0;x<=n-m;x++){ if(check(x,y)){ cout<<"Yes"<<endl; return 0; } } } cout<<"No"<<endl; //system("pause"); return 0; }
a.cc: In function 'bool check(int, int)': a.cc:75:23: error: 'm' was not declared in this scope 75 | for(int i=0;i<m;i++) { | ^ a.cc: In function 'int main()': a.cc:87:14: error: 'n' was not declared in this scope 87 | cin>>n>>m; | ^ a.cc:87:17: error: 'm' was not declared in this scope 87 | cin>>n>>m; | ^
s573681632
p03804
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; #define REPS(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) REPS(i, 0, n) #define RREP(i, n) REPS(i, 1, n + 1) #define DEPS(i, a, n) for (int i = (a); i >= n; --i) #define DEP(i, n) DEPS(i, n, 0) #define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i]; #define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i]; #define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i]; #define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i]; #define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j]; #define string(x) string x; cin >> x; #define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); } #define all(v) (v).begin(), (v).end() #define rall(v) (v).begin(), (v).end(), std::greater<int>() #define len(v) (v).length() #define FIND(s, n) (s.find(n) != s.end()) #define SORT(a) sort(all(a)) static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); static const long long MOD = 1000000007; static const double PI=3.1415926535897932; static const int INF = 0x3f3f3f3f; static const int INFTY = (1 << 29); static const long long LINFTY = (1LL << 32); static const int dy4[]={0, 0, 1, -1}; static const int dx4[]={1, -1, 0, 0}; static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1}; static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; int main(void){ cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector<string> A(N); vector<string> B(M); REP(i, N) cin >> A[i]; REP(i, M) cin >> B[i]; int ans = 0; REP(j, N) REP(i, A[j].length()-B[0].length()+1){ if(A[j].substr(i, B[l].length()) == B[0]){ int k = j, l = 0; while(k < N && l < M){ if(A[k].substr(i, B[l].length()) == B[l]){ k++; l++; ans = 1; if(l == M){ cout << "Yes" << endl; return 0; }else if(k == N){ cout << "No" << endl; return 0; } }else{ ans = 0; break; } } } } if(ans == 1) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:56:25: error: 'l' was not declared in this scope 56 | if(A[j].substr(i, B[l].length()) == B[0]){ | ^ a.cc:57:18: error: redeclaration of 'int l' 57 | int k = j, l = 0; | ^ a.cc:56:25: note: '<typeprefixerror>l' previously declared here 56 | if(A[j].substr(i, B[l].length()) == B[0]){ | ^
s954554959
p03804
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; string S; vector<string> s,s2; cin >> n >> m; for(int i=0;i<n;i++){ cin >> S; s.push_back(S); } for(int i=0;i<m;i++){ cin >> S; s2.push_back(S); } bool ok; for(int i=0;i+m<=n;i++){ ok=true; for(int j=0;j+m<=n;j++){ for(int k=0;k<m;k++){ for(int l=0;l<b;l++){ if(s[i+k][j+l]!=s2[k][l]){ ok=false; goto aa; } } } if(ok) goto bb; } aa:; } bb:; cout << (ok?"Yes":"No") << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:47: error: 'b' was not declared in this scope 24 | for(int l=0;l<b;l++){ | ^
s466703725
p03804
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; #define REPS(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) REPS(i, 0, n) #define RREP(i, n) REPS(i, 1, n + 1) #define DEPS(i, a, n) for (int i = (a); i >= n; --i) #define DEP(i, n) DEPS(i, n, 0) #define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i]; #define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i]; #define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i]; #define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i]; #define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j]; #define string(x) string x; cin >> x; #define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); } #define all(v) (v).begin(), (v).end() #define rall(v) (v).begin(), (v).end(), std::greater<int>() #define len(v) (v).length() #define FIND(s, n) (s.find(n) != s.end()) #define SORT(a) sort(all(a)) static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); static const long long MOD = 1000000007; static const double PI=3.1415926535897932; static const int INF = 0x3f3f3f3f; static const int INFTY = (1 << 29); static const long long LINFTY = (1LL << 32); static const int dy4[]={0, 0, 1, -1}; static const int dx4[]={1, -1, 0, 0}; static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1}; static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; int main(void){ cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector<string> A(N); vector<string> B(M); REP(i, N) cin >> A[i]; REP(i, M) cin >> B[i]; int ans = 0; REP(j, N) REP(i, A[j].length()-B[0].length()+1){ if(A[j].substr(i, B[0].length()) == B[0]){ int k = j, l = 0; while(k < N && l < M){ if(A[k].substr(i, B[l].length()) == B[l]){ k++; l++; ans = 1; } }else{ ans = 0; break; } } } if(ans == 1) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:63:10: error: expected '}' before 'else' 63 | }else{ | ^~~~ a.cc:56:46: note: to match this '{' 56 | if(A[j].substr(i, B[0].length()) == B[0]){ | ^ a.cc: At global scope: a.cc:69:3: error: expected unqualified-id before 'if' 69 | if(ans == 1) cout << "Yes" << endl; | ^~ a.cc:70:3: error: expected unqualified-id before 'else' 70 | else cout << "No" << endl; | ^~~~ a.cc:71:1: error: expected declaration before '}' token 71 | } | ^
s222166538
p03804
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; #define REPS(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) REPS(i, 0, n) #define RREP(i, n) REPS(i, 1, n + 1) #define DEPS(i, a, n) for (int i = (a); i >= n; --i) #define DEP(i, n) DEPS(i, n, 0) #define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i]; #define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i]; #define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i]; #define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i]; #define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j]; #define string(x) string x; cin >> x; #define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); } #define all(v) (v).begin(), (v).end() #define rall(v) (v).begin(), (v).end(), std::greater<int>() #define len(v) (v).length() #define FIND(s, n) (s.find(n) != s.end()) #define SORT(a) sort(all(a)) static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); static const long long MOD = 1000000007; static const double PI=3.1415926535897932; static const int INF = 0x3f3f3f3f; static const int INFTY = (1 << 29); static const long long LINFTY = (1LL << 32); static const int dy4[]={0, 0, 1, -1}; static const int dx4[]={1, -1, 0, 0}; static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1}; static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; int main(void){ cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector<string> A(N); vector<string> B(M); REP(i, N) cin >> A[i]; REP(i, M) cin >> B[i]; int ans = 0; REP(j, N) REP(i, A[j].length()-B[0].length()+1){ if(A[j].substr(i, B[0].length()) == B[0]){ int k = j, l = 0; while(k < N && l < M){ if(A[k].substr(i, B[l].length()) == B[l]){ k++; l++; ans = 1; } }else{ ans = 0 break; } } } if(ans == 1) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:63:10: error: expected '}' before 'else' 63 | }else{ | ^~~~ a.cc:56:46: note: to match this '{' 56 | if(A[j].substr(i, B[0].length()) == B[0]){ | ^ a.cc:64:18: error: expected ';' before 'break' 64 | ans = 0 | ^ | ; 65 | break; | ~~~~~ a.cc: At global scope: a.cc:69:3: error: expected unqualified-id before 'if' 69 | if(ans == 1) cout << "Yes" << endl; | ^~ a.cc:70:3: error: expected unqualified-id before 'else' 70 | else cout << "No" << endl; | ^~~~ a.cc:71:1: error: expected declaration before '}' token 71 | } | ^
s280897421
p03804
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // 1行、2つ(複数)数字 String[] ss0 = br.readLine().trim().split(" ", 0); int N = Integer.parseInt(ss0[0]); int M = Integer.parseInt(ss0[1]); // 2行目以降文字列を配列に格納 String[] A = new String[N]; for(int i = 0; i < N; i++){ A[i] = br.readLine(); } String[] B = new String[M]; for(int i = 0; i < M; i++){ B[i] = br.readLine(); } //入力値確認 for(int i=0; i < N; i++){ //System.out.println(A[i]); } for(int i=0; i < M; i++){ //System.out.println(B[i]); } int a = N-M+1; String sa = ""; String sb = ""; sb = sss(B, 0, 0, a); for(int j=0; j < a; j++){ for(int i=0; i < a; i++){ sa = sss(A, i, j, a); if ( sa.equals(sb) ){ System.out.println("Yes"); return } } } System.out.println("No"); System.out.println("No"); return; } // Debug.Print static void dp(String s) { //System.out.println(s); } static void dp(StringBuilder s) { dp(s.toString()); } static void dp(int i) { dp(String.valueOf(i)); } static void dp(long i) { dp(String.valueOf(i)); } static String sss(String[] A, int I, int J, int L){ String s = ""; for(int i = I; i<I+L; i++) { s = s + A[i].substring(J, J+L); } return s; } }
Main.java:36: error: illegal start of expression if ( sa.equals(sb) ){ System.out.println("Yes"); return } ^ 1 error
s560863280
p03804
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in);; int i,tmp,pre; int n=sc.nextInt(); int m=sc.nextInt(); String[] a=new String[n]; String[] b=new String[m]; for(i=0;i<n;i++){a[i]=sc.next();} for(i=0;i<m;i++){b[i]=sc.next();} for(i=0;i<n-m+1;i++){ for(int j=0;j<n-m+1;j++){ if(j==0)tmp=0; else tmp=pre; tmp=a[i].indexOf(b[i],tmp); if(tmp==-1)break; pre=tmp; if(Main.check(m,tmp,i,a,b)){ System.out.println("Yes"); return; } } } System.out.println("No"); } public static boolean check(int m,int col,int row,String[] a,String[] b){ for(int i=1;i<m;i++){ if(a[row+i].indexOf(b[i],col)!=col)return false; } return true; } }
Main.java:14: error: variable pre might not have been initialized if(j==0)tmp=0; else tmp=pre; ^ 1 error
s736627782
p03804
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in);; int i,tmp,pre; int n=sc.nextInt(); int m=sc.nextInt(); String[] a=new String[n]; String[] b=new String[m]; for(i=0;i<n;i++){a[i]=sc.next();} for(i=0;i<m;i++){b[i]=sc.next();} for(i=0;i<n-m+1;i++){ for(int j=0;j<n-m+1;j++){ if(j==0)tmp=0; else tmp=pre; tmp=a[i].indexOf(b[i],tmp); if(tmp==-1)break; pre=tmp; if(Main.check(tmp,i,a,b)){ System.out.println("Yes"); return; } } } System.out.println("No"); } public static boolean check(int col,int row,String[] a,String[] b){ for(int i=1;i<m;i++){ if(a[row+i].indexOf(b[i],col)!=col)return false; } return true; } }
Main.java:27: error: cannot find symbol for(int i=1;i<m;i++){ ^ symbol: variable m location: class Main 1 error
s299483820
p03804
Java
import java.util.*; public class Main(){ public static void main(String[] args){ Scanner sc=new Scanner(System.in);; int i,tmp,pre; int n=sc.nextInt(); int m=sc.nextInt(); String[] a=new String[n]; String[] b=new String[m]; for(i=0;i<n;i++){a[i]=sc.next();} for(i=0;i<m;i++){b[i]=sc.next();} for(i=0;i<n-m+1;i++){ for(int j=0;j<n-m+1;j++){ if(j==0)tmp=0; else tmp=pre; tmp=a[i].indexOf(b[i],tmp); if(tmp==-1)break; pre=tmp; if(Main.check(tmp,i,a,b)){ System.out.println("Yes"); return; } } } System.out.println("No"); } public static boolean check(int col,int row,String[] a,String[] b){ for(int i=1;i<m;i++){ if(a[row+i].indexOf(b[i],col)!=col)return false; } return true; } }
Main.java:2: error: '{' expected public class Main(){ ^ 1 error
s178116563
p03804
C++
#include <iostream> #include <stdlib.h> #include <bitset> using namespace std; int main(){ int N[2]; cin >> N[0] >> N[1]; __int64 map[2][64]; for (int i = 0; i < 2; i++){ for (int j = 0; j < N[i]; j++){ char in[50]; cin >> in; map[i][j] = 0; for (int k = 0; k < N[i]; k++){ if (in[k] == '#') map[i][j] = map[i][j] | (1<<k); } //cout << static_cast<bitset<8> >(map[i][j]) << endl; } } int mask = (1 << N[1]); mask--; for (int i = 0; i <= (N[0] - N[1]); i++){ for (int j = 0; j <= (N[0] - N[1]); j++){ if (( (map[0][i] & (mask << j)) == (map[1][i] << j))){ for (int k = 1; k < N[1]; k++){ if (((map[0][i+k] & (mask << j)) != (map[1][i+k] << j))){ break; } if (k == (N[1] - 1)) { cout << "Yes" << endl; return 0; } } } } } cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 9 | __int64 map[2][64]; | ^~~~~~~ | __int64_t a.cc:14:25: error: 'map' was not declared in this scope 14 | map[i][j] = 0; | ^~~ a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 3 | #include <bitset> +++ |+#include <map> 4 | using namespace std; a.cc:26:32: error: 'map' was not declared in this scope 26 | if (( (map[0][i] & (mask << j)) == (map[1][i] << j))){ | ^~~ a.cc:26:32: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
s256922206
p03804
C++
#include "bits/stdc++.h" #define REP(i,n) for(int i=0;i<n;i++) using namespace std; using ll = long long; using ull = unsigned long long; const char en='\n'; int main(){ int n,m; char a[50][50],b[50][50]; cin>>n>>m; for(int i=0;i<n*n;i++){ cin>>a[i%n][i/n]; } for(int i=0;i<m*m;i++){ cin>>b[i%m][i/m]; } #define BR if(f)break; bool f=false; REP(i,n){ REP(j,n){ REP(k,n){ REP(l,n){ if(a[i][j]!=b[k][l]){ b=true; break; } } BR; } } } cout<<(f?"Yes":"No")<<en; return 0; }
a.cc: In function 'int main()': a.cc:28:50: error: incompatible types in assignment of 'bool' to 'char [50][50]' 28 | b=true; | ~^~~~~
s318698722
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String[] imgA=new String[]; String[] imgB=new String[]; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=""; imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=""; imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:8: error: array dimension missing String[] imgA=new String[]; ^ Main.java:9: error: array dimension missing String[] imgB=new String[]; ^ 2 errors
s722043652
p03804
C++
#include <stdio.h> int main(){ int n, m; //文字列の大きさ int i,j; int k,l; int x; scanf("%d %d", &n, &m); char A[n+1][n+1]; char B[m+1][m+1]; for(j = 0; j < n; j++){ scanf("%s", A[j]); } for(j = 0; j < m; j++){ scanf("%s", B[j]); } for(i = 0; i <= n-m; i++){ for(j = 0; j <= n-m; j++){ //どっかしらがfitした if(A[j][i] == B[0][0]){ x = 1; for(k = 0; k < m; k++){ for(l = 0; l < m; l++){ if(A[j+l][i+k] != B[k][l]){ x = 0; break; //一致しなかったら強制退出 } } //途中でおわったやつ or ぜんぶループしたやつもここ出てくる if(x == 0) break; //途中でbreakしたやつは用なしだからbreak } if(x == 1){ printf("Yes\n"); return 0; } } //全箇所fitしなかったやつがでてくる,B[1][1]を調べるループ開始 } } printf("No\n"); return 0;
a.cc: In function 'int main()': a.cc:46:18: error: expected '}' at end of input 46 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s462317265
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String[] imgA; String[] imgB; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=""; imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=""; imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:15: error: variable imgA might not have been initialized imgA[i]=""; ^ Main.java:19: error: variable imgB might not have been initialized imgB[i]=""; ^ Main.java:26: error: variable imgA might not have been initialized checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); ^ Main.java:26: error: variable imgB might not have been initialized checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); ^ 4 errors
s523378854
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String[] imgA[N]; String[] imgB[M]; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:8: error: ']' expected String[] imgA[N]; ^ Main.java:8: error: ';' expected String[] imgA[N]; ^ Main.java:9: error: ']' expected String[] imgB[M]; ^ Main.java:9: error: ';' expected String[] imgB[M]; ^ 4 errors
s125839653
p03804
C++
#include <cstdio> using namespace std; int n,m,i,j,k,h; char s[54][54],s1[54][54]; bool ok,ok1; int main() { scanf ("%d %d\n", &n, &m); for (i=0;i<=(n-1);i++) gets(s[i]); for (i=0;i<=(m-1);i++) gets(s1[i]); ok1=false; for (i=0;(i<=(n-m)) && (ok1==false);i++) for (j=0;(j<=(n-m)) && (ok1==false);j++) { ok=true; for (k=0;(k<=(m-1)) && (ok==true);k++) for (h=0;h<=(m-1);h++) { if (s[i+k][j+h]!=s1[k][h]) { ok=false; break; } } if (ok==true) ok1=true; } if (ok1==true) printf ("Yes\n"); else printf ("No\n"); return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s[i]); | ^~~~ | getw a.cc:13:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(s1[i]); | ^~~~ | getw
s345707358
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String imgA[N]; String imgB[M]; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:8: error: ']' expected String imgA[N]; ^ Main.java:8: error: ';' expected String imgA[N]; ^ Main.java:9: error: ']' expected String imgB[M]; ^ Main.java:9: error: ';' expected String imgB[M]; ^ 4 errors
s754898220
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String[N] imgA; String[M] imgB; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:8: error: not a statement String[N] imgA; ^ Main.java:8: error: ';' expected String[N] imgA; ^ Main.java:8: error: not a statement String[N] imgA; ^ Main.java:9: error: not a statement String[M] imgB; ^ Main.java:9: error: ';' expected String[M] imgB; ^ Main.java:9: error: not a statement String[M] imgB; ^ 6 errors
s493384388
p03804
C++
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <vector> #include <algorithm> #include <cstdio> #include <stack> #include <queue> #include <map> using namespace std; #define max_n 50 #define max_m 50 #define max_w 10000 #define max_h 1000 #define max_k 10000 #define max_l 10000 #define INF 9999999 typedef long long lint; int main() { int n,m; char a[max_n*2+1],b[max_m][max_m*2+1]; cin>>n>>m; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<m;i++){ cin>>b[i]; } if(strstr(a,b)!=NULL){ cout<<"yes"<<endl; }else{ cout<<"no"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:38:14: error: no matching function for call to 'strstr(char [101], char [50][101])' 38 | if(strstr(a,b)!=NULL){ | ~~~~~~^~~~~ In file included from a.cc:5: /usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)' 330 | extern char *strstr (char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:330:52: note: no known conversion for argument 2 from 'char [50][101]' to 'const char*' 330 | extern char *strstr (char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~ /usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:332:64: note: no known conversion for argument 2 from 'char [50][101]' to 'const char*' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~
s838219825
p03804
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); int M = Integer.parseInt(sc.next()); String[] imgA; String[] imgB; Boolean checkAB; int j; int k; String s = "No"; for(int i = 0;i<N;i++){ imgA[i]=sc.next(); } for(int i = 0;i<M;i++){ imgB[i]=sc.next(); } for(int i=0;i<(N-M+1);i++){ for(j=0;j<(N-M+1);j++){ checkAB = true; for (k=0;j<M;j++){ checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); } if(checkAB){ s="Yes"; } } } System.out.println(s); sc.close(); } }
Main.java:15: error: variable imgA might not have been initialized imgA[i]=sc.next(); ^ Main.java:18: error: variable imgB might not have been initialized imgB[i]=sc.next(); ^ Main.java:24: error: variable imgA might not have been initialized checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); ^ Main.java:24: error: variable imgB might not have been initialized checkAB = (checkAB) && (imgA[j+k].substring(i, i+M)==imgB[k]); ^ 4 errors
s887117353
p03804
C++
#include <stdio.h> #include <string.h> int main(void){ int a,b,hantei=0; scanf("%d %d",&a,&b); char as[a][a],bs[b][b]; for(int i=0;i<a;i++){ for (int i2=0;i2<a;i2++){ scanf("%d",as[i][i2]); } } for(int i=0;i<b;i++){ for (int i2=0;i2<b;i2++){ scanf("%d",bs[i][i2]); } } for(int i=0;i<a;i++){ for(int i2=0;i2<a;i++){ if(strcmp(bs[1][1],as[i][i2])==0){ for(int o=0;o<b;o++){ for(int u=0;u<b;u++){ if(!(as[i][i2],bs[o][u])){ hantei=-1; } } } } } } if(hantei==-1) printf("No\n"); else printf("Yes\n"); return 0; }
a.cc: In function 'int main()': a.cc:23:42: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 23 | if(strcmp(bs[1][1],as[i][i2])==0){ | ~~~~~~~^ | | | char In file included from a.cc:2: /usr/include/string.h:156:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ a.cc:23:52: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 23 | if(strcmp(bs[1][1],as[i][i2])==0){ | ~~~~~~~~^ | | | char /usr/include/string.h:156:50: note: initializing argument 2 of 'int strcmp(const char*, const char*)' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~
s856692451
p03804
C++
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int n = 0; int m = 0; scanf("%d", &n); scanf("%d", &m); int a[51][51] = { 0 }; int b[51][51] = { 0 }; char tmp; //a読み込み部 for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { scanf("%c", &tmp); if (tmp == '\n') { scanf("%c", &tmp); } if (tmp == '.') { a[i][j] = 0; } else if(tmp == '#'){ a[i][j] = 1; } } } //b読み込み部 for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { scanf("%c", &tmp); if (tmp == '\n') { scanf("%c", &tmp); } if (tmp == '.') { b[i][j] = 0; } else if (tmp == '#') { b[i][j] = 1; } } } if (n - m < 0) { printf("No"); return 0; } for (int i = 0; i < n - m; i++) { for (int j = 0; i < n - m; i++) { for (int x = 0; x < m; x++) { for (int y = 0; y < m; y++) { if (a[i+x][j+y] != b[x][y]) { goto next; } } if (x == m - 1 && y == m-1) { printf("Yes"); return 0; } } next:; } } printf("No"); return 0; }
a.cc: In function 'int main()': a.cc:52:51: error: 'y' was not declared in this scope 52 | if (x == m - 1 && y == m-1) { printf("Yes"); | ^
s449462368
p03804
C++
#include <iostream> #include <string> #include <vector> #include <cstdint> using namespace std; int main() { int_least32_t n, m; cin >> n >> m; vector<string> a( n ), b( m ); for(auto& x : a) { cin >> x; } for(auto& x : b) { cin >> x; } int_least32_t dif{ n - m }; bool isok; for(auto i = 0; i < dif; ++i) { for(auto j = 0; j < dif; ++j) { isok = true; for(auto k = 0; k < m; ++k) { if(b != a[i + k].substr(j, m)) { isok = false; break; } } if(isok) { break; } } if(isok) { break; } } if(isok) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:28:38: error: no match for 'operator!=' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'std::__cxx11::basic_string<char>') 28 | if(b != a[i + k].substr(j, m)) { | ~ ^~ ~~~~~~~~~~~~~~~~~~~~~ | | | | | std::__cxx11::basic_string<char> | std::vector<std::__cxx11::basic_string<char> > 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 a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::fpos<_StateT>' 28 | if(b != a[i + k].substr(j, m)) { | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::allocator<_CharT>' 28 | if(b != a[i + k].substr(j, m)) { | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::reverse_iterator<_Iterator>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::reverse_iterator<_Iterator>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::move_iterator<_IteratorL>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::move_iterator<_IteratorL>' 28 | if(b != a[i + k].substr(j, m)) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::pair<_T1, _T2>' 28 | if(b != a[i + k].substr(j, m)) { | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:28:61: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 28 | if(b != a[i + k].substr(j, m)) { | ^ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:28:61: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 28 | if(b != a[i + k].substr(j, m)) { | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&,
s038678160
p03804
C++
#include <bits/stdc++.h> using namespace std; #define N 55 int n,m; string s[N],r[N]; bool che(int i,int j){ for(int a=0;a<m;a++){ for(int b=0;b<m;b++){ if(s[a+i][b+j]!=r[a][b]) return 0; } } return 1; } bool solve(){ for(int i=0;i<=n-m;i++) for(int j=0;j<=n-m;j++) if(che(i,j)) return 1; return 0; } int main(){ cin>>n>>m; for(int i=0;i<n;i++) cin>>s[i]; for(int i=0;i<m;i++) cin>>r[i]; if(solve())cout<<"Yes\n"; else cout<<"No\n";
a.cc: In function 'int main()': a.cc:32:27: error: expected '}' at end of input 32 | else cout<<"No\n"; | ^ a.cc:25:11: note: to match this '{' 25 | int main(){ | ^
s877496037
p03804
Java
public class Main { static int n; static int m; public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine()); n=Integer.parseInt(st.nextToken()); m=Integer.parseInt(st.nextToken()); boolean[][] n_map=new boolean[n][n]; boolean[][] m_map=new boolean[m][m]; String str; for(int i=0;i<n;i++){ str=br.readLine(); for(int j=0;j<n;j++){ n_map[i][j]=(str.charAt(j)=='#'); } } for(int i=0;i<m;i++){ str=br.readLine(); for(int j=0;j<m;j++){ m_map[i][j]=(str.charAt(j)=='#'); } } for(int i=0;i<=n-m;i++){ for(int j=0;j<=n-m;j++){ if(check(n_map,m_map,i,j)){ System.out.println("Yes"); System.exit(0); } } }System.out.println("No"); } static boolean check(boolean[][] a,boolean[][] b,int start1,int start2){ for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ if(a[i+start1][j+start2]!=b[i][j]){ return false; } } } System.out.println(start1+" "+start2); return true; } }
Main.java:6: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:7: error: cannot find symbol BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:7: error: cannot find symbol BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:7: error: cannot find symbol BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:8: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine()); ^ symbol: class StringTokenizer location: class Main Main.java:8: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine()); ^ symbol: class StringTokenizer location: class Main 6 errors
s834690788
p03804
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <cmath> #include <vector> #include <queue> #include <stack> #include <set> #include <map> using namespace std; #define FOR(i,k,n) for(int i=k;i<n;i++) #define FORR(i,k,n) for(int i=k;i<=n;i++) #define scan(a) scanf("%d",&a) #define scann(a,b) scanf("%d%d",&a,&b) #define scannn(a,b,c) scanf("%d%d%d",&a,&b,&c) #define mst(a,n) memset(a,n,sizeof(a)) #define ll long long #define N 55 #define mod 1000000007 #define INF 0x3f3f3f3f const double eps=1e-8; const double pi=acos(-1.0); int n,m; char a[N][N],b[N][N]; bool cmp(int x,int y) { for(int i=0;i<m;i++) { for(int j=0;j<m;j++) { if(a[i+x][j+y]!=b[i][j]) return false; } } return true; } int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); scann(n,m); getchar(); for(int i=0;i<n;i++) gets(a[i]); for(int i=0;i<m;i++) gets(b[i]); for(int i=0;i<n-m;i++) { for(int j=0;j<n-m;j++) { if(a[i][j]==b[0][0]) { if(cmp(i,j)) { printf("Yes\n"); return 0; } } } } printf("No\n"); return 0; }
a.cc: In function 'int main()': a.cc:54:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 54 | gets(a[i]); | ^~~~ | getw a.cc:56:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 56 | gets(b[i]); | ^~~~ | getw
s493025187
p03804
C++
#include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; string* a = new string [n]; string* b = new string [m]; for(int i = 0; i < n; ++i) { cin >> a[i]; } for(int i = 0; i < m; ++i) { cin >> b[i]; } for(int top = 0; top < n-m+1; ++top) { for(int lef = 0; lef < n-m+1; ++lef) { found = true; for(int bt = 0; bt < m; ++bt) { for(int bl = 0; bl < m; ++bl) { if (b[bt][bl] != a[top+bt][lef+bl]) {found = false; goto nf;} } } nf: if (found) goto ff; } } ff: cout << (found ? "Yes" : "No") << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: 'found' was not declared in this scope 15 | found = true; | ^~~~~ a.cc:28:14: error: 'found' was not declared in this scope 28 | cout << (found ? "Yes" : "No") << endl; | ^~~~~
s333281198
p03804
C++
#include <bits/stdc++.h> using namespace std; vector<string>A, B; int main() { int N, M; cin>>N>>M; string inp; for(int i = 0; i < N; i++) { cin>>inp; A.push_back(inp); } for(int i = 0; i < M; i++) { cin>>inp; B.push_back(inp); } int i, j, k, l; int ans = 0; for(i = 0; i + M - 1 < N; i++) { for(j = 0; j + M - 1 < N; j++) { for(k = 0; k < M; k++) { for(l = 0; l < M; l++) { if(A[i + k][j + l] != B[k][l]) break; } if(l < M) break; } if(k == M) ans++; } } if(ans) cout<<"Yes"<<endl; else cout<<"No<<endl; return 0; }
a.cc:40:16: warning: missing terminating " character 40 | else cout<<"No<<endl; | ^ a.cc:40:16: error: missing terminating " character 40 | else cout<<"No<<endl; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:41:5: error: expected primary-expression before 'return' 41 | return 0; | ^~~~~~
s424808976
p03804
C++
#include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <cstdio> #include <fstream> #include <map> #include <vector> #include <unordered_map> #include <unordered_set> #include <stack> #include <set> #include <queue> #include <list> using namespace std; char a[55][55],b[55][55]; int main() { int n,m; bool ju=false; scanf("%d%d",&n,&m); getchar(); for(int i=0;i<n;++i) gets(a[i]); for(int i=0;i<m;++i) gets(b[i]); int k=n-m; for(int i=0;i<=k;++i) { if(ju) break; for(int j=0;j<=k;++j) { bool juu=true; for(int x=0;x<m;++x) for(int y=0;y<m;++y) { if(a[i+x][j+y]!=b[x][y]) { juu=false; break; } } if(juu) { ju=true; break; } } } if(ju) printf("Yes\n"); else printf("No\n"); return 0; }
a.cc: In function 'int main()': a.cc:25:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 25 | gets(a[i]); | ^~~~ | getw a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 27 | gets(b[i]); | ^~~~ | getw
s817913751
p03804
C++
#include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; string* a = new string [n]; string* b = new string [m]; for(int i = 0; i < n; ++i) { cin >> a[i]; } for(int i = 0; i < m; ++i) { cin >> b[i]; } bool found = true; for(int top = 0; top < n-m; ++top) { for(int lef = 0; lef < n-m; ++lef) { for(int bt = 0; bt < m; ++bt) { for(int bl = 0; bl < m; ++bl) { if (b[bt][bl] != a[top][lef]) {found = false; goto nf;} } } nf: if (found) goto ff: } } ff: cout << (found ? "Yes" : "No") << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:19: error: expected ';' before ':' token 25 | if (found) goto ff: | ^ | ; a.cc:25:19: error: expected primary-expression before ':' token
s698123627
p03804
C++
#include <cstdio> #include <iostream> using namespace std; #define REP(i, n) for(int i = 0; i < (int)(n); ++i) char a[60][60]; char b[60][60]; int main(void) { int n, m; scanf("%d %d ", &n, &m); REP(i, n) gets(a[i]); REP(i, m) gets(b[i]); REP(i, n-m+1) REP(j, n-m+1) { bool ok = true; REP(ii, m) REP(jj, m) { if (a[i+ii][j+jj] != b[ii][jj]) { ok = false; } } if (ok) { puts("Yes"); return 0; } } puts("No"); return 0; }
a.cc: In function 'int main()': a.cc:14:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(a[i]); | ^~~~ | getw a.cc:16:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(b[i]); | ^~~~ | getw
s607521374
p03804
C++
#include<cstdio> char a[50][51],b[50][51]; int main() [ int i,j,k,l,n,m;scanf("%d%d",&n,&m); for(i=0;i<n;i++)scanf("%s",a[i]); for(i=0;i<m;i++)scanf("%s",b[i]); for(i=0;i<n-m;i++) for(j=0;j<n-m;j++){ bool f=true; for(k=0;k<m&&f;k++) for(l=0;l<m&&f;l++) if(a[i+k][j+l]!=b[k][l])f=false; if(f)return puts("Yes"),0; } puts("No"); return 0; }
a.cc:5:1: error: expected primary-expression before 'int' 5 | int i,j,k,l,n,m;scanf("%d%d",&n,&m); | ^~~ a.cc:4:2: error: expected ']' before 'int' 4 | [ | ^ | ] 5 | int i,j,k,l,n,m;scanf("%d%d",&n,&m); | ~~~ a.cc:5:22: error: expected constructor, destructor, or type conversion before '(' token 5 | int i,j,k,l,n,m;scanf("%d%d",&n,&m); | ^ a.cc:6:1: error: expected unqualified-id before 'for' 6 | for(i=0;i<n;i++)scanf("%s",a[i]); | ^~~ a.cc:6:9: error: 'i' does not name a type 6 | for(i=0;i<n;i++)scanf("%s",a[i]); | ^ a.cc:6:13: error: 'i' does not name a type 6 | for(i=0;i<n;i++)scanf("%s",a[i]); | ^ a.cc:7:1: error: expected unqualified-id before 'for' 7 | for(i=0;i<m;i++)scanf("%s",b[i]); | ^~~ a.cc:7:9: error: 'i' does not name a type 7 | for(i=0;i<m;i++)scanf("%s",b[i]); | ^ a.cc:7:13: error: 'i' does not name a type 7 | for(i=0;i<m;i++)scanf("%s",b[i]); | ^ a.cc:8:1: error: expected unqualified-id before 'for' 8 | for(i=0;i<n-m;i++) | ^~~ a.cc:8:9: error: 'i' does not name a type 8 | for(i=0;i<n-m;i++) | ^ a.cc:8:15: error: 'i' does not name a type 8 | for(i=0;i<n-m;i++) | ^ a.cc:9:9: error: 'j' does not name a type 9 | for(j=0;j<n-m;j++){ | ^ a.cc:9:15: error: 'j' does not name a type 9 | for(j=0;j<n-m;j++){ | ^ a.cc:16:5: error: expected constructor, destructor, or type conversion before '(' token 16 | puts("No"); | ^ a.cc:17:1: error: expected unqualified-id before 'return' 17 | return 0; | ^~~~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s242334629
p03804
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < n; i++) #define rep1(i,n) for(int i = 1; i < n; i++) #define repv(i,n) for(int i = n-1; i >= 0; i--) #define fi first #define sc second #define pb push_back using namespace std; typedef long long ll; char BUF[3500000]; inline void I(int&a){scanf("%d",&a);} inline void I(int&a,int&b){scanf("%d%d",&a,&b);} inline void I(int&a,int&b,int&c){scanf("%d%d%d",&a,&b,&c);} inline void I(int&a,int&b,int&c,int&d){scanf("%d%d%d%d",&a,&b,&c,&d);} inline void L(ll&a){scanf("%lld",&a);} inline void L(ll&a,ll&b){scanf("%lld%lld",&a,&b);} inline void L(ll&a,ll&b,ll&c){scanf("%lld%lld%lld",&a,&b,&c);} inline void L(ll&a,ll&b,ll&c,ll&d){scanf("%lld%lld%lld%lld",&a,&b,&c,&d);} inline void S(string&str){str.clear();scanf("%s",BUF);int s=strlen(BUF);rep(i,s)str.pb(BUF[i]);} inline void SV(vector<int>&v){v.clear();scanf("%s",BUF);int s=strlen(BUF);rep(i,s)if('a'<=BUF[i]&&BUF[i]<='z')v.pb(BUF[i]-'a');else v.pb(BUF[i]-'A');} const auto EPS = 1e-10; const auto INF = 100000000; const auto MOD = 1000000007; typedef pair<ll,ll> P; int n, m; char a[50][50], b[50][50]; int main(){ I(n,m); rep(i,n) rep(j,n) cin >> a[i][j]; rep(i,m) rep(j,m) cin >> b[i][j]; rep(i,n){ rep(j,n){ bool ok = true; if(i+m-1 >= n) continue; rep(k,m){ rep(l,m){ if(a[i+k][j+l] != b[k][l]){ ok = false; break; } } if(!ok) break; } if(ok){ cout << "Yes" << endl; return 0; } } } cout << "No" << endl;
a.cc: In function 'int main()': a.cc:54:26: error: expected '}' at end of input 54 | cout << "No" << endl; | ^ a.cc:31:11: note: to match this '{' 31 | int main(){ | ^
s553042150
p03805
C++
#include <iostream> #include <vector> using namespace std; const int MAXN = 8; vector <int> g[MAXN+1]; int n,m; long long int res=0; dfs(int v, long long int mask){ if(mask==((1LL<<n)-1)){ res+=1; } else{ for(int i=0; i<g[v].size(); i++){ if(!((1LL<<g[v][i])&(mask))){ dfs(g[v][i], mask|(1LL<<g[v][i])); } } } } int main(){ cin>>n>>m; for(int i=0; i<m; i++){ int u,v; cin>>u>>v; g[u-1].push_back(v-1); g[v-1].push_back(u-1); } dfs(0,1); cout<<res<<endl; }
a.cc:8:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 8 | dfs(int v, long long int mask){ | ^~~ a.cc: In function 'int dfs(int, long long int)': a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type] 19 | } | ^
s746562982
p03805
C++
#include<bits/stdc++.h> using namespace std; int N,M,a,b,startingPoint,visit,ans; vector<int> adj[100100]; bool visited[100100]; void dfs(int x){ if(visited[x]) return; visited[x] = true; visit++; for(int i = 0;i < adj[x].size();i++){ int y = adj[x][i]; dfs(y); } if (visit == N) ans++; visited[x] = false; visit--; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>N>>M; for(int i = 1;i <= M;i++){ cin>>a>>b; adj[a].push_back(b); adj[b].push_back(a); } dfs(1); cout<<ans<<endl; return 0; }
a.cc: In function 'void dfs(int)': a.cc:11:5: error: reference to 'visit' is ambiguous 11 | visit++; | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80, from a.cc:1: /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~ a.cc:16:9: error: reference to 'visit' is ambiguous 16 | if (visit == N) ans++; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~ a.cc:18:5: error: reference to 'visit' is ambiguous 18 | visit--; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~
s713712416
p03805
C++
#include<bits/stdc++.h> using namespace std; int N,M,a,b,startingPoint,visit,ans; vector<int> adj[100100]; bool visited[100100]; void dfs(int x){ if(visited[x]) return; visited[x] = true; visit++; for(int i = 0;i < adj[x].size();i++){ int y = adj[x][i]; dfs(y); } if (visit == N) ans++; visited[x] = false; visit--; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>N>>M; for(int i = 1;i <= M;i++){ cin>>a>>b; adj[a].push_back(b); adj[b].push_back(a); } cin>>startingPoint; dfs(startingPoint); cout<<ans<<endl; return 0; }
a.cc: In function 'void dfs(int)': a.cc:11:5: error: reference to 'visit' is ambiguous 11 | visit++; | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80, from a.cc:1: /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~ a.cc:16:9: error: reference to 'visit' is ambiguous 16 | if (visit == N) ans++; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~ a.cc:18:5: error: reference to 'visit' is ambiguous 18 | visit--; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:27: note: 'int visit' 4 | int N,M,a,b,startingPoint,visit,ans; | ^~~~~
s135847402
p03805
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define rep2(i,x,n) for(int i=x; i<(n); i++) #define all(x) x.begin(),x.end() typedef long long ll; ll mod = 1000000007; ll inf = 1e18; int main(){ int n,m; cin >> n >> m; vector<int> v(n); rep(i,n) v[i]=i+1; vector<vector<int>> l(n+1); int a,b; rep(i,m){ cin >> a >> b; l[a].push_back(b); l[b].push_back(a); } int sum=0; bool ans; do{ if(v[0]!=1) break; int p=1; rep2(i,1,n){ ans=false; rep(j,l[p].size(){ if(v[i]==l[p][j]){ ans=true; p=v[i]; break; } } if(!ans) break; } if(ans) sum++; }while(next_permutation(v.begin(),v.end())); cout << sum << endl; return 0; }
a.cc:46:2: error: unterminated argument list invoking macro "rep" 46 | } | ^ a.cc: In function 'int main()': a.cc:31:13: error: 'rep' was not declared in this scope 31 | rep(j,l[p].size(){ | ^~~ a.cc:31:16: error: expected '}' at end of input 31 | rep(j,l[p].size(){ | ^ a.cc:29:20: note: to match this '{' 29 | rep2(i,1,n){ | ^ a.cc:31:16: error: expected '}' at end of input 31 | rep(j,l[p].size(){ | ^ a.cc:26:7: note: to match this '{' 26 | do{ | ^ a.cc:31:16: error: expected 'while' at end of input 31 | rep(j,l[p].size(){ | ^ a.cc:31:16: error: expected '(' at end of input 31 | rep(j,l[p].size(){ | ^ | ( a.cc:31:16: error: expected primary-expression at end of input a.cc:31:16: error: expected ')' at end of input 31 | rep(j,l[p].size(){ | ^ | ) a.cc:31:16: error: expected ';' at end of input 31 | rep(j,l[p].size(){ | ^ | ; a.cc:31:16: error: expected '}' at end of input a.cc:10:11: note: to match this '{' 10 | int main(){ | ^
s303735114
p03805
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; vector<vector<bool>>C(N,vector<bool>(N,false)); for(int i=0;i<M;i++){ int a,b; cin>>a>>b; C[a][b]=true; C[b][a]=true; } int count=1; for(int i=1;i<N;i++)count*=i; int ans=0; vector<int>B(N); for(int i=0;i<count;i++){ for(int j=1;j<N;j++){ if(!B[j][j-1])break; if(j==N-1)ans++; } next_permutation(B.begin(),B.end()); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:17:15: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 17 | if(!B[j][j-1])break; | ^