submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s388982700
p03853
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w; cin>>h>>w; vector<string> s(h); for(int i=0;i<h;i++){ cin>>s.at(i); cout<<s.at(i)<<endl<<s.at(i)<<endl; }
a.cc: In function 'int main()': a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s525927524
p03853
C
#include<iostream> #include<stdio.h> #include<math.h> using namespace std; int main() { int h,w; // scanf("%d %d",&h,&w); cin>>h>>w; char str[1001][1001]= {'\0'}; int i,j; fflush(stdin); for(i=1; i<=h; i++) { for(j=1; j<=w; j++) { // scanf("%c",str[i][j]); cin>>str[i][j]; } } // for(i=1; i<=h; i++) { // gets(str[i]); // } for(i=1; i<=h; i++) { for(j=1; j<=w; j++) { printf("%c",str[i][j]); } // printf("%s",str[i]); printf("\n"); for(j=1; j<=w; j++) { printf("%c",str[i][j]); } // printf("%s",str[i]); printf("\n"); } // double temp; // for(i=1; i<=h; i++) { // gets(str[i]); // } // for(i=1; i<=h*2-1; i++) { // for(j=0; j<w; j++) { // temp=floor((i+1)/2); // int a=(int)temp; // printf("%c",str[a][j]); // } // printf("\n"); // } // for(j=0; j<w; j++) { // temp=floor((i+1)/2); // int a=(int)temp; // printf("%c",str[a][j]); // } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s317170979
p03853
C++
#include<stdio.h> int main(){ int h,w; scanf("%d %d",&h,&w); char str[101][101]; int i; fflush(stdin); for(i=0;i<h;i++){ gets(str[i]); } for(i=0;i<h;i++){ puts(str[i]); puts(str[i]); } 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(str[i]); | ^~~~ | getw
s839433277
p03853
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int h,w; cin>>h>>w; char str[101][101]; int i; fflush(stdin); for(i=0;i<h;i++){ gets(str[i]); } for(i=0;i<h;i++){ puts(str[i]); puts(str[i]); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(str[i]); | ^~~~ | getw
s719441731
p03853
C++
#include<iostream> using namespace std; int main(){ int h,w; cin>>h>>w; char str[101][101]; int i; fflush(stdin); for(i=0;i<h;i++){ gets(str[i]); } for(i=0;i<h;i++){ puts(str[i]); puts(str[i]); } return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(str[i]); | ^~~~ | getw
s886749999
p03853
C
#include<iostream> using namespace std; int main(){ int h,w; cin>>h>>w; char str[101][101]; int i; fflush(stdin); for(i=0;i<h;i++){ gets(str[i]); } for(i=0;i<h;i++){ puts(str[i]); puts(str[i]); } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s066235787
p03853
C
#include<stdio.h> int main() { int h,w; // cin>>h>>w; // getchar(); scanf("%d %d",&h,&w); // fflush(stdin); while(getchar()!='\n') continue; char str[][101]= {'\0'}; int i,j; for(i=0; i<h; i++) { gets(str[i]); // for(j=0; j>w; j++) { //// cin>>str[i][j]; //// scanf("%c",&str[i][j]); // } } for(i=0; i<2*h; i++) { for(j=0; j<w; j++) { cout<<str[(i)/2][j]; } printf("\n"); } return 0; }
main.c: In function 'main': main.c:13:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 13 | gets(str[i]); | ^~~~ | fgets main.c:21:25: error: 'cout' undeclared (first use in this function) 21 | cout<<str[(i)/2][j]; | ^~~~ main.c:21:25: note: each undeclared identifier is reported only once for each function it appears in
s475488103
p03853
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int h,w; // cin>>h>>w; // getchar(); scanf("%d %d",&h,&w); // fflush(stdin); while(getchar()!='\n') continue; char str[][101]= {'\0'}; int i,j; for(i=0; i<h; i++) { gets(str[i]); // for(j=0; j>w; j++) { //// cin>>str[i][j]; //// scanf("%c",&str[i][j]); // } } for(i=0; i<2*h; i++) { for(j=0; j<w; j++) { cout<<str[(i)/2][j]; } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 15 | gets(str[i]); | ^~~~ | getw
s552646235
p03853
C++
#include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> #include <iostream> #include <string> #include <time.h> #include <queue> #include <list> #include <string.h> #define sf scanf #define pf printf #define lf double #define ll long long #define p123 printf("123\n"); #define pn printf("\n"); #define pk printf(" "); #define p(n) printf("%d",n); #define pln(n) printf("%d\n",n); #define s(n) scanf("%d",&n); #define ss(n) scanf("%s",n); #define ps(n) printf("%s",n); #define sld(n) scanf("%lld",&n); #define pld(n) printf("%lld",n); #define slf(n) scanf("%lf",&n); #define plf(n) printf("%lf",n); #define sc(n) scanf("%c",&n); #define pc(n) printf("%c",n); #define gc getchar(); #define re(n,a) memset(n,a,sizeof(n)); #define len(a) strlen(a) #define LL long long #define eps 1e-6 using namespace std; const double pi = 3.1415926535; /* https://codeforces.com/contest/1106/problems https://codeforces.com/contest/1106/submit */ const ll mod = 1e9+7; //快速幂 (a^b)%mod //如果求逆元,则b = mod-2; ll pow_quick(ll a,ll b){ ll r = 1,base = a; while(b){ if(b & 1){ r *= base; r %= mod; } base *= base; base %= mod; b >>= 1; } return r; } char a[1000000]; int main(){ int h,w; s(h) s(w) gc for(int i = 0; i < h; i ++){ gets(a); puts(a); puts(a); } return 0; }
a.cc: In function 'int main()': a.cc:62:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 62 | gets(a); | ^~~~ | getw
s771514459
p03853
C++
#include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> #include <iostream> #include <string> #include <time.h> #include <queue> #include <list> #include <string.h> #define sf scanf #define pf printf #define lf double #define ll long long #define p123 printf("123\n"); #define pn printf("\n"); #define pk printf(" "); #define p(n) printf("%d",n); #define pln(n) printf("%d\n",n); #define s(n) scanf("%d",&n); #define ss(n) scanf("%s",n); #define ps(n) printf("%s",n); #define sld(n) scanf("%lld",&n); #define pld(n) printf("%lld",n); #define slf(n) scanf("%lf",&n); #define plf(n) printf("%lf",n); #define sc(n) scanf("%c",&n); #define pc(n) printf("%c",n); #define gc getchar(); #define re(n,a) memset(n,a,sizeof(n)); #define len(a) strlen(a) #define LL long long #define eps 1e-6 using namespace std; const double pi = 3.1415926535; /* https://codeforces.com/contest/1106/problems https://codeforces.com/contest/1106/submit */ const ll mod = 1e9+7; //快速幂 (a^b)%mod //如果求逆元,则b = mod-2; ll pow_quick(ll a,ll b){ ll r = 1,base = a; while(b){ if(b & 1){ r *= base; r %= mod; } base *= base; base %= mod; b >>= 1; } return r; } char a[1000000]; int main(){ int h,w; s(h) s(w) gc for(int i = 0; i < h; i ++){ gets(a); puts(a); puts(a); } return 0; }
a.cc: In function 'int main()': a.cc:62:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 62 | gets(a); | ^~~~ | getw
s668423449
p03853
C++
#include<bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; vector<vector<int>> c(h, vector(w)); int i, j; for(i = 0; i < h; i++) { for(j = 0; j < w; j++) { cin >> c.at(i).at(j); } } for(i = 0; i < 2 * h; i++) { for(j = 0; j < w; j++) { cout << c.at(i/2).at(j); } cout << endl; } }
a.cc: In function 'int main()': a.cc:8:36: error: class template argument deduction failed: 8 | vector<vector<int>> c(h, vector(w)); | ^ a.cc:8:36: error: no matching function for call to 'vector(int&)' In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed: a.cc:8:36: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed: a.cc:8:36: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided
s654384457
p03853
C++
#include<bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; vector<vector<int>> c(h, vector(w)); int i, j; for(i = 0; i < h; i++) { for(j = 0; j < w; j++) { cin >> c.at(i).at(j); } } for(i = 0; i < 2 * h; i++) { for(j = 0; j < w; j++) { cout << c.at(i/2).at(j) } cout << endl; } }
a.cc: In function 'int main()': a.cc:8:36: error: class template argument deduction failed: 8 | vector<vector<int>> c(h, vector(w)); | ^ a.cc:8:36: error: no matching function for call to 'vector(int&)' In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed: a.cc:8:36: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed: a.cc:8:36: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed: a.cc:8:36: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> c(h, vector(w)); | ^ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided a.cc:21:30: error: expected ';' before '}' token 21 | cout << c.at(i/2).at(j) | ^ | ; 22 | } | ~
s159867480
p03853
C
#include<stdio.h> int main(){ char s[101][101]; int H, W, i; scanf("%d %d", &H, &W) for(i = 0; i < H; i++){ scanf("%s", s[i]); } for (i = 0; i < 2*H; i++){ printf("%s\n", s[i/2]); } return 0; }
main.c: In function 'main': main.c:7:25: error: expected ';' before 'for' 7 | scanf("%d %d", &H, &W) | ^ | ; 8 | for(i = 0; i < H; i++){ | ~~~
s022270270
p03853
C++
9 20 .....***....***..... ....*...*..*...*.... ...*.....**.....*... ...*.....*......*... ....*.....*....*.... .....**..*...**..... .......*..*.*....... ........**.*........ .........**.........
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 9 20 | ^
s812419597
p03853
C++
1 4 ***.
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 4 | ^
s994140411
p03853
C
#include<studio.h> int main(void) { int h,w,moji[110]; scanf("%d%d",&h,&w); for(int i = 0;i < h;i++) { scanf("%s",moji); printf("%s",moji); printf("%s",moji); } return 0; }
main.c:1:9: fatal error: studio.h: No such file or directory 1 | #include<studio.h> | ^~~~~~~~~~ compilation terminated.
s516806113
p03853
C++
#include<stdio.h> int main(void) { int h,w; char a[10000][10000]; scanf("%d%d",&h,&w); for(i=1;i<=w;i++) for(j=1;j<=h;j++) scanf("%c",&a[i][j]); for(i=1;i<=w;i=(i+1)/2){ for(j=1;j<=h;j++) printf("%c",a[i][j]); printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: 'i' was not declared in this scope 7 | for(i=1;i<=w;i++) for(j=1;j<=h;j++) scanf("%c",&a[i][j]); | ^ a.cc:7:31: error: 'j' was not declared in this scope 7 | for(i=1;i<=w;i++) for(j=1;j<=h;j++) scanf("%c",&a[i][j]); | ^ a.cc:8:13: error: 'i' was not declared in this scope 8 | for(i=1;i<=w;i=(i+1)/2){ | ^ a.cc:9:21: error: 'j' was not declared in this scope 9 | for(j=1;j<=h;j++) printf("%c",a[i][j]); | ^
s202129159
p03853
C++
#include<iostream> using namespace std; int main(){ int h,w;cin>>h>>w; vector<string> c(h); for(int i=0;i<h;i++){ cin>>c[i]; } for(int i=0;i<h;i++){ cout<<c[i]<<endl; cout<<c[i]<<endl; } }
a.cc: In function 'int main()': a.cc:5:3: error: 'vector' was not declared in this scope 5 | vector<string> c(h); | ^~~~~~ 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 | using namespace std; a.cc:5:16: error: expected primary-expression before '>' token 5 | vector<string> c(h); | ^ a.cc:5:18: error: 'c' was not declared in this scope 5 | vector<string> c(h); | ^
s178517377
p03853
C++
#include <iostream> using namespace std; int main() { int h,w; cin >>h>>w; char C[h][w]; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>C[i][j]; } } for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cout<<C[i][j]; } cout<<endl; for(int j=0;j<w;j++){ cout<<C[i][j]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:26:6: error: expected '}' at end of input 26 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s719360295
p03853
C++
#include <iostream> #include <string> #include <sstream> #include <set> #include <map> #include <unordered_map> #include <stack> #include <queue> #include <vector> #include <utility> #include <iomanip> #include <sstream> #include <bitset> #include <cstdlib> #include <iterator> #include <algorithm> #include <functional> #include <random> #include <bits/stdc++.h> #include <stdio.h> #include <cstdio> #include <cctype> #include <cmath> #include <math.h> #include <ctime> #include <cstring> typedef long long ll; using namespace std; #define FOR(i,N) for(ll i=0;i<N;i++) #define RFOR(i,N) for(ll i=N-1;i>=0;--i) #define COUT(str) cout << str << endl #define MAX_N 100 //"long long","int"かを変えること!!!! //入力 int h,w ; string BUR[105]; int main() { int h, w; cin >> h >> w; FOR(i, h) { cin >> BUR[i]; COUT(BUR)[i]; COUT(BUR)[i]; } return 0; }
a.cc: In function 'int main()': a.cc:50:26: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript 50 | COUT(BUR)[i]; | ^ a.cc:52:26: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript 52 | COUT(BUR)[i]; | ^
s811163186
p03853
C++
#include <iostream> #include <string> #include <sstream> #include <set> #include <map> #include <unordered_map> #include <stack> #include <queue> #include <vector> #include <utility> #include <iomanip> #include <sstream> #include <bitset> #include <cstdlib> #include <iterator> #include <algorithm> #include <functional> #include <random> #include <bits/stdc++.h> #include <stdio.h> #include <cstdio> #include <cctype> #include <cmath> #include <math.h> #include <ctime> #include <cstring> typedef long long ll; using namespace std; #define FOR(i,N) for(ll i=0;i<N;i++) #define RFOR(i,N) for(ll i=N-1;i>=0;--i) #define COUT(str) cout << str << endl #define MAX_N 100 //"long long","int"かを変えること!!!! //入力 int h,w ; string BUR[105]; int main() { int h, w; cin >> h >> w; FOR(i, h) { cin >> BUR[i]; COUT(BUR)[i]; COUT(BUR)[i]; } return 0; }
a.cc: In function 'int main()': a.cc:50:26: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript 50 | COUT(BUR)[i]; | ^ a.cc:52:26: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript 52 | COUT(BUR)[i]; | ^
s075832420
p03853
C++
#include <iostream> #include <string> #include <sstream> #include <set> #include <map> #include <unordered_map> #include <stack> #include <queue> #include <vector> #include <utility> #include <iomanip> #include <sstream> #include <bitset> #include <cstdlib> #include <iterator> #include <algorithm> #include <functional> #include <random> #include <bits/stdc++.h> #include <stdio.h> #include <cstdio> #include <cctype> #include <cmath> #include <math.h> #include <ctime> #include <cstring> typedef long long ll; using namespace std; #define FOR(i,N) for(ll i=0;i<N;i++) #define RFOR(i,N) for(ll i=N-1;i>=0;--i) #define COUT(str) cout << str << endl #define MAX_N 100 //"long long","int"かを変えること!!!! //入力 int h,w ; string BUR[105]; int main() { int h, w; cin >> h >> w; FOR(i, h) { cin >> BUR; COUT(BUR); COUT(BUR); } return 0; }
a.cc: In function 'int main()': a.cc:48:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [105]' {aka 'std::__cxx11::basic_string<char> [105]'}) 48 | cin >> BUR; | ~~~ ^~ ~~~ | | | | | std::string [105] {aka std::__cxx11::basic_string<char> [105]} | 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>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} 48 | cin >> BUR; | ^~~ /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>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(short int)((std::string*)(& BUR))' to 'short int&' /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>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(short unsigned int)((std::string*)(& BUR))' to 'short unsigned int&' /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>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(int)((std::string*)(& BUR))' to 'int&' /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>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(unsigned int)((std::string*)(& BUR))' to 'unsigned int&' /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>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(long int)((std::string*)(& BUR))' to 'long int&' /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>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(long unsigned int)((std::string*)(& BUR))' to 'long unsigned int&' /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>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(long long int)((std::string*)(& BUR))' to 'long long int&' /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>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive] 48 | cin >> BUR; | ^~~ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:48:24: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& BUR))' to 'long long unsigned int&' /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>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:48:24: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 48 | cin >> BUR; | ^~~ /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::string [105]' {aka 'std::__cxx11::basic_string<char> [105]'} 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::string [105]' {aka 'std::__cxx11::basic_string<char> [105]'} 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::string [105]' {aka 'std::__cxx11::basic_string<char> [105]'} to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~
s896106585
p03853
C++
#include<bits/stdc++.h> using namespace std; int a[101][101]; typedef long long ll; typedef unsigned long long ull; int main(){ int a,b,i,j; cin>>a>>b; for(i=1;i<=a;i++) for(j=1;j<=b;j++) cin>>a[i][j]; for(i=1;i<=a;i++) for(j=1;j<=b*2;j++) a[i][j]=a[(i+1)/2][j]; for(i=1;i<=a;i++) for(j=1;j<=b*2;j++) cout<<a[i][j]; return 0; }
a.cc: In function 'int main()': a.cc:10:41: error: invalid types 'int[int]' for array subscript 10 | for(j=1;j<=b;j++) cin>>a[i][j]; | ^ a.cc:12:38: error: invalid types 'int[int]' for array subscript 12 | for(j=1;j<=b*2;j++) a[i][j]=a[(i+1)/2][j]; | ^ a.cc:12:46: error: invalid types 'int[int]' for array subscript 12 | for(j=1;j<=b*2;j++) a[i][j]=a[(i+1)/2][j]; | ^ a.cc:14:44: error: invalid types 'int[int]' for array subscript 14 | for(j=1;j<=b*2;j++) cout<<a[i][j]; | ^
s286247277
p03853
C++
#include<iostream> #include<climits> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> #include<stdio.h> #include <string> #include <complex> #include <functional> using namespace std; typedef pair<int,int> P; double dat[100][100]; int dp[6][1010];//動的計画法 int prime[10000001]; char str[1010][1010]; vector<pair<int,int> > pc[100001]; int ABS(int a){return max(a,-a);} int main(){ string s[101]; int h,n; cin>>h>>n; for(int i=0;i<h,i++) cin>>s[i]; for(int i=0;i<h;i++){ cout<<s[i]<<endl; cout<<s[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:28: error: expected ';' before ')' token 23 | for(int i=0;i<h,i++) cin>>s[i]; | ^ | ;
s315235438
p03853
C++
#include<iostream> #include<string> typedef long long int ll; using namespace std; ll A,B; string S,T; int main(){ cin>>A>>B; REP(i,A){ cin>>S;cout<<S<<endl<<S<<endl; } }
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | REP(i,A){ | ^ a.cc:9:5: error: 'REP' was not declared in this scope 9 | REP(i,A){ | ^~~
s138168079
p03853
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int H,W; cin >> H >> W; vector<char> C(10010); for(int i=1;i<=H*W;i++){ cin >> C.at(i);} for(int i=1;i<=W;i++){ cout << C.at(i)
a.cc: In function 'int main()': a.cc:13:20: error: expected ';' at end of input 13 | cout << C.at(i) | ^ | ; a.cc:13:20: error: expected '}' at end of input a.cc:12:24: note: to match this '{' 12 | for(int i=1;i<=W;i++){ | ^ a.cc:13:20: error: expected '}' at end of input 13 | cout << C.at(i) | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s626291889
p03853
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w; cin >> h >> w; string s; for(int i=0;i<n;i++) { cin >> s; cout << s << endl; cout << s << endl; } }
a.cc: In function 'int main()': a.cc:12:19: error: 'n' was not declared in this scope 12 | for(int i=0;i<n;i++) | ^
s482299407
p03853
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; string array[101]; cin>>a>>b; for(i=0;i<b;i++){ cin>>array[i]; cout<<array[i]<<endl; cout<<array[i]<<endl; } }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<b;i++){ | ^
s148183052
p03853
C++
#include <bits/stdc++.h> using namespace std; int main() { int H,W; cin >> H >> W; int<vector> a(H*W); for(int i=0;i<H*W;i++){ cin >> a.at(i); }
a.cc: In function 'int main()': a.cc:7:3: error: 'int' is not a template 7 | int<vector> a(H*W); | ^~~ a.cc:9:14: error: request for member 'at' in 'a', which is of non-class type 'int' 9 | cin >> a.at(i); | ^~ a.cc:10:4: error: expected '}' at end of input 10 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s674557424
p03853
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int h,w;cin>>h>>w; rep(h){ string s;cin>>s;cout<<s<<endl<<s<<endl; } }
a.cc:7:14: error: macro "rep" requires 2 arguments, but only 1 given 7 | rep(h){ | ^ a.cc:2:9: note: macro "rep" defined here 2 | #define rep(i,n) for(int i=0;i<n;i++) | ^~~ a.cc: In function 'int main()': a.cc:7:9: error: 'rep' was not declared in this scope 7 | rep(h){ | ^~~
s517803488
p03853
C++
#include <bits/stdc++.h> using namespace tsd; int main(){ char a[100][100]; int b = 0,c = 0; cin >> b >> c; for(int Q = 0;Q < b;Q++){ for(int W = 0;W < c;W++){ cin >> a[Q][W]; } } for(int Q = 0;Q < b;Q++){ for(int S = 0;S < 2;S++){ for(int W = 0;W < c;W++){ cout << a[Q][W]; } } cout << endl; } return 0; }
a.cc:2:17: error: 'tsd' is not a namespace-name 2 | using namespace tsd; | ^~~ a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> b >> c; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 17 | cout << a[Q][W]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 20 | cout << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 20 | cout << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s868078193
p03853
C++
#include <iostream> #include <string> using namespace std; int main(){ int a,b; string h[100]; cin>>a>>b; for(int i=0;i<a,i++){ cin>>h[i]; cout<<h[i]<<endl; cout<<h[i]<<endl; } }
a.cc: In function 'int main()': a.cc:8:22: error: expected ';' before ')' token 8 | for(int i=0;i<a,i++){ | ^ | ;
s153768842
p03853
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(int i=(a);i<(b);++i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = (1 << 30) - 1; const ll INF64 = ((ll)1 << 62) - 1; const ll MOD = 1e9 + 7; const double PI = 3.1415926535897932384626433832795; int main() { ll a, b; cin >> a >> b; string c[b]; for (int i = 0; i < b; ++i) { cin >> c[i] } for (int i = 0; i < b; ++i) { for (int j = 0; j < 2; ++j) { cout << c[i] << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:20:28: error: expected ';' before '}' token 20 | cin >> c[i] | ^ | ; 21 | } | ~
s206510105
p03853
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(int i=(a);i<(b);++i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = (1 << 30) - 1; const ll INF64 = ((ll)1 << 62) - 1; const ll MOD = 1e9 + 7; const double PI = 3.1415926535897932384626433832795; int main() { ll a, b; cin >> a >> b >> x; string c[b]; for (int i = 0; i < b; ++i) { cin >> c[i] } for (int i = 0; i < b; ++i) { for (int j = 0; j < 2; ++j) { cout << c[i] << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:16:26: error: 'x' was not declared in this scope 16 | cin >> a >> b >> x; | ^ a.cc:20:28: error: expected ';' before '}' token 20 | cin >> c[i] | ^ | ; 21 | } | ~
s718347099
p03853
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { private static Scanner scan; private static void start() { scan = new Scanner(java.lang.System.in); scan = Input.getScanner(); System.init(); } private static void finish() { System.close(); } public static void main(String[] args) { start(); int h = scan.nextInt(); int w = scan.nextInt(); scan.nextLine(); char[][] papan = new char[h][w]; for (int i = 0; i < h; i++) { String s = scan.nextLine(); for (int j = 0; j < w; j++) { papan[i][j] = s.charAt(j); } } char[][] papan2 = new char[2 * h][w]; for (int i = 0; i < (2 * h); i++) { for (int j = 0; j < w; j++) { int floor = (int) Math.floor((i) / 2); papan2[i][j] = papan[floor][j]; } } for (int i = 0; i < 2 * h; i++) { for (int j = 0; j < w; j++) { System.out.print(papan2[i][j]); } System.out.println(); } finish(); } }
Main.java:12: error: cannot find symbol scan = Input.getScanner(); ^ symbol: variable Input location: class Main Main.java:13: error: cannot find symbol System.init(); ^ symbol: method init() location: class System Main.java:17: error: cannot find symbol System.close(); ^ symbol: method close() location: class System 3 errors
s277600483
p03853
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h, w; cin >> h >> w; for(int i = 0; i < h; ++i){cin >> s; cout << s << endl << s << endl;} return 0; }
a.cc: In function 'int main()': a.cc:5:43: error: 's' was not declared in this scope 5 | for(int i = 0; i < h; ++i){cin >> s; cout << s << endl << s << endl;} | ^
s127258644
p03853
Java
import java.util.*; public class m3a { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String> s = new ArrayList<String>(); int H = sc.nextInt(); int W = sc.nextInt(); for(int i = 0;i < H;i++) { String a = sc.next(); for(int m = 0;m < 2;m++) { s.add(a); } } for(String k : s) { System.out.println(k); } } }
Main.java:3: error: class m3a is public, should be declared in a file named m3a.java public class m3a { ^ 1 error
s947546366
p03853
C++
#include <bits/stdc++.h> #define INF 100000000 #define MOD9(a) (a%1000000009) #define MOD7(a) (a%1000000007) #define ABS(a) (a<0?-(a):a) #define MIN(a,b) (a>b?b:a) #define MAX(a,b) (a>b?a:b) #define REP(i,a) for(int i=0;i<a;i++) using namespace std; int main(){ int H,W; cin >> H >> W; char c[H][W]; REP(i, H){ cin >> c[i]; } REP(i, H){ REP(k, 2){ REP(j, W){ cout << c[i][j]; } cout << endl; } } } #include <bits/stdc++.h> #define INF 100000000 #define MOD9(a) (a%1000000009) #define MOD7(a) (a%1000000007) #define ABS(a) (a<0?-(a):a) #define MIN(a,b) (a>b?b:a) #define MAX(a,b) (a>b?a:b) #define REP(i,a) for(int i=0;i<a;i++) using namespace std; int main(){ int H,W; cin >> H >> W; char c[H][W]; REP(i, H){ cin >> c[i]; } REP(i, H){ REP(k, 2){ REP(j, W){ cout << c[i][j]; } cout << endl; } } }
a.cc:41:5: error: redefinition of 'int main()' 41 | int main(){ | ^~~~ a.cc:12:5: note: 'int main()' previously defined here 12 | int main(){ | ^~~~
s021258446
p03853
C++
#include <bits/stdc++.h> #define _overload(_1,_2,_3,name,...) name #define _rep(i,n) _range(i,0,n) #define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i) #define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__) #define _rrep(i,n) _rrange(i,n,0) #define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i) #define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__) #define _all(arg) begin(arg),end(arg) #define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg)) #define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary) #define clr(a,b) memset((a),(b),sizeof(a)) #define bit(n) (1LL<<(n)) // #define DEBUG #ifdef DEBUG #define dump(...) fprintf(stderr, __VA_ARGS__) #else #define dump(...) #endif template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;} template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;} using namespace std; using ll=long long; using vi=vector<int>; using vll=vector<ll>; const double EPS = 1e-10; const double PI = acos(-1.0); const ll inf =1LL << 62; const ll mod=1000000007LL; const int dx[4]={1,0,-1,0}; const int dy[4]={0,1,0,-1}; ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;} ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;} ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;} ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;} ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);} random_device rd; mt19937 mt(rd()); uniform_int_distribution<int> dice(1,6); uniform_real_distribution<double> score(0.0,10.0); int main(void){ cin.tie(0); ios::sync_with_stdio(false); int h, w; cin >> h >> w; string field(h); for(auto& e : field) cin >> e; for(auto& e : field){ cout << e << endl; cout << e << endl; } return 0; }
a.cc: In function 'int main()': a.cc:58:19: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 58 | string field(h); for(auto& e : field) cin >> e; | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:58:18: note: cannot convert 'h' (type 'int') to type 'const char*' 58 | string field(h); for(auto& e : field) cin >> e; | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basi
s511514071
p03853
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #define WMAX 10000 #define HMAX 10000 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } typedef pair<int ,int > P; typedef long long ll; int H,W; char C[HMAX][WMAX]; char c; string S = {"abcde"}; static const int dx[8] = {0,1,1,1,0,-1,-1,-1}, dy[8] = {1,1,0,-1,-1,-1,0,1}; void solve(){ for (int i = 0; i < H; ++i) { for (int j = 0; j < 2; ++j) { for (int k = 0; k < W; ++k) { cout << C[i][k]; } cout << "\n"; } } } void answer(){ cout << ans << "\n"; } int main(){ cin >> H >> W; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { cin >> C[i][j]; } } solve(); return 0; }
a.cc: In function 'void answer()': a.cc:50:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 50 | cout << ans << "\n"; | ^~~ | abs
s904739022
p03853
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(), w = sc.nextInt(); for(int i = 0; i < h; i++){ String c = sc.next(); System.out.println(c); System.out.println(c); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s964992856
p03853
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> #include<unordered_map> using namespace std; typedef long long ll; int main() { int h,w; cin>>h>>w; char a[100][100]; for(int i=0;i<h;i++){ string s; cin>>s; for(int j=0;j<w;j++){ a[i][j]=s[j]; } } for(int i=0;i<h*2;i++){ for(int j=0;j<w;j++){ cout<<a[floor((double)(i+1)/2)][j]; } cout<<endl; } }
a.cc: In function 'int main()': a.cc:29:32: error: invalid types 'char [100][100][double]' for array subscript 29 | cout<<a[floor((double)(i+1)/2)][j]; | ^
s883270491
p03853
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> #include<unordered_map> using namespace std; typedef long long ll; int main() { int h,w; cin>>h>>w; char a[100][100]; for(int i=0;i<h;i++){ string s; cin>>s; for(int j=0;j<w;j++){ a[i][j]=s[j]; } } for(int i=0;i<h*2;i++){ for(int j=0;j<w;j++){ cout<<a[floor((double)(i+1)/2)]; } cout<<endl; } }
a.cc: In function 'int main()': a.cc:29:32: error: invalid types 'char [100][100][double]' for array subscript 29 | cout<<a[floor((double)(i+1)/2)]; | ^
s942258830
p03853
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int W = sc.nextInt(); char[][] picture = new char[H][W]; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { picture[i][j] = sc.next(); } } // String[][] output = new String[2 * H][W]; for(int i = 0; i < (2 * H); i++) { for(int j = 0; j < W; j++) { // output[i][j] = picture[(i + 2) / 2 - 1][j]; } } for(int i = 0; i < (2 * H); i++) { for(int j = 0; j < W; j++) { // System.out.print(output[i][j]); } // if(i != (2 * H - 1)) System.out.println(""); } } }
Main.java:11: error: incompatible types: String cannot be converted to char picture[i][j] = sc.next(); ^ 1 error
s846409716
p03853
Java
import java.util.Scanner; public class main { public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int H = stdIn.nextInt(); int W = stdIn.nextInt(); stdIn.nextLine(); String[] C = new String[H]; for(int i=0;i<H;i++){ C[i] = stdIn.nextLine(); } for(String Ci :C){ System.out.println(Ci); System.out.println(Ci); } } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s875748539
p03853
C++
package main import ( "fmt" ) func main() { var h, w int fmt.Scan(&h, &w) for y := 0; y < h; y++ { var s string fmt.Scan(&s) fmt.Println(s) fmt.Println(s) } }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~
s521134508
p03853
C++
#include <iostream> #include <string> using namespace std; int main() { int h, w; cin >> h >> w; for (int i = 0; i < h; i++) { string str; cin >> str; cout << str << end;: cout << str << end;: } return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 12 | cout << str << end;: | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) |
s364200141
p03853
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; #define rep(i, n)for((i) = 0;(i) < (n);++(i)) int main(void){ int h, w; scanf("%d%d", &h, &w); string s; rep(i, h){ cin >> s; cout << s << "\n"; cout << s << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: 'i' was not declared in this scope 12 | rep(i, h){ | ^ a.cc:6:23: note: in definition of macro 'rep' 6 | #define rep(i, n)for((i) = 0;(i) < (n);++(i)) | ^
s346361066
p03853
C++
n, m = gets.split(" ") puts (1..n.to_i).map{gets}.map{|s| puts s; puts s}
a.cc:2:7: error: too many decimal points in number 2 | puts (1..n.to_i).map{gets}.map{|s| puts s; puts s} | ^~~~~~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n, m = gets.split(" ") | ^ a.cc:2:27: error: expected unqualified-id before '.' token 2 | puts (1..n.to_i).map{gets}.map{|s| puts s; puts s} | ^
s787512082
p03853
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int H = s.nextInt(); int W = s.nextInt(); String[] array = new String[H]; for(int i=0; i<H; i++){ array[i] = s.next(); } // 表示 for(int i=0; i<H; i++){ System.out.println(array[i]); System.out.println(array[i]); } }
Main.java:20: error: reached end of file while parsing } ^ 1 error
s484513369
p03853
C++
#include<bits/stdc++.h> using namespace std; int main(9{ int h,w; cin>>h>>w; for(int i=0;i<h;i++){ string c; cin>>c; cout<<c<<endl; cout<<c<<endl; } return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main(9{ | ^~~~ a.cc:4:11: error: expected ')' before '{' token 4 | int main(9{ | ~ ^ | )
s052776870
p03853
C++
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--) #define chmin(a,b) (a)=min((a),(b)); #define chmax(a,b) (a)=max((a),(b)); #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl; #define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;} #define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;} #define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl; #define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;} inline void output(){ cout << endl; } template<typename First, typename... Rest> inline void output(const First& first, const Rest&... rest) { cout << first << " "; output(rest...); } using ll = long long; using Pii = pair<int, int>; using TUPLE = tuple<int, int, int>; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; const int inf = 1ll << 60; const int mod = 1e9 + 7; using Graph = vector<vector<int>>; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int h, w; cin >> h >> w; vector<string> s(h); rep(i, n) cin >> s[i]; rep(i, n) { cout << s[i] << endl; cout << s[i] << endl; } }
a.cc: In function 'int main()': a.cc:42:12: error: 'n' was not declared in this scope 42 | rep(i, n) cin >> s[i]; | ^ a.cc:5:34: note: in definition of macro 'rep' 5 | #define rep(i,n) for (int i=0;i<(n);i++) | ^ a.cc:44:12: error: 'n' was not declared in this scope 44 | rep(i, n) { | ^ a.cc:5:34: note: in definition of macro 'rep' 5 | #define rep(i,n) for (int i=0;i<(n);i++) | ^
s383084791
p03853
C++
#include <iostream> #include <string> using namespace std; int main(){ int h,w; cin>>h>>w; vector<string> M(h); for(int i=0;i<h;i++){ cin>>M[i]; } for(int i=0;i<h*2;i++){ for(int j=0;j<w;j++){ cout<<M[i/2][j]; } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:2: error: 'vector' was not declared in this scope 7 | vector<string> M(h); | ^~~~~~ 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:15: error: expected primary-expression before '>' token 7 | vector<string> M(h); | ^ a.cc:7:17: error: 'M' was not declared in this scope 7 | vector<string> M(h); | ^
s325915031
p03853
C
#include <stdio.h> int main(){ int h=0,w=0; scanf("%d %d",&h,&w ); char ij[h-1][w-1]; for(int k=0; k<h;k++){ scanf("%s",ij[k]); } printf("%d %d\n",h,w); for(int k=0; k<h;k++){ for(int l=0; l<w; l++){ printf("%c",ij[k][l]); } printf("\n"); for(int m=0; m<w; m++){ printf("%c",ij[k][l]); } printf("\n"); } }
main.c: In function 'main': main.c:16:25: error: 'l' undeclared (first use in this function) 16 | printf("%c",ij[k][l]); | ^ main.c:16:25: note: each undeclared identifier is reported only once for each function it appears in
s040768912
p03853
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w; char c[111][111]; cin >> h >> w; for(int i=0;i<h;i++){ cin >> c[i]; }for(int i=0;i<h;i++){ else cout<<c[i]<<endl<<c[i]<<endl; } return(0); }
a.cc: In function 'int main()': a.cc:10:3: error: 'else' without a previous 'if' 10 | else cout<<c[i]<<endl<<c[i]<<endl; | ^~~~
s319159240
p03853
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w; char c[111][111]; cin >> h >> w; for(int i=0;i<h;i++){ cin >> c[i]; }for(int i==0;i<h;i++){ else cout<<c[i]<<endl<<c[i]<<endl; } return(0); }
a.cc: In function 'int main()': a.cc:9:11: error: expected ';' before '==' token 9 | }for(int i==0;i<h;i++){ | ^~ | ; a.cc:9:11: error: expected primary-expression before '==' token 9 | }for(int i==0;i<h;i++){ | ^~ a.cc:9:18: error: expected ')' before ';' token 9 | }for(int i==0;i<h;i++){ | ~ ^ | ) a.cc:9:19: error: 'i' was not declared in this scope 9 | }for(int i==0;i<h;i++){ | ^
s266371693
p03853
C++
#include<stdio.h> int main(){ int i, j, a[101][101]={0,}, x, y; scanf("%d %d", &i, &j); for(x=1;x<=i;x++){ for(y=1;y<=j;y++){ scanf("%c ", &a[x][y]); }1 } for(x=1;x<=i;x++){ for(y=1;y<=j;y++){ printf("%c ", &a[x][y]); } printf("\n"); for(y=1;y<=j;y++){ printf("%c ", &a[x][y]); } printf("\n"); } }
a.cc: In function 'int main()': a.cc:11:19: error: expected ';' before '}' token 11 | }1 | ^ | ; 12 | } | ~
s939280792
p03853
C++
#include <stdio.h> using namespace std; int h, w; char s[105]; int main() { freopen("input.txt", "r", stdin); scanf("%d%d", &h, &w); gets(s); while(h--) { gets(s); puts(s); puts(s); } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s289730936
p03853
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s972515092
p03853
C++
#include<bits/stdc++.h> using namespace std; int main() { char p[1000][101]; int h,w; cin>>h>>w; getchar(); p[h][w]; for(int i=0;i<h;i++) gets(p[i]); for(int i=0;i<h;i++) for(int j=0;j<2;j++) cout<<p[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(p[i]); | ^~~~ | getw
s348249843
p03853
C++
#include<iostream> using namespace std; int main(){ int W,H; char C[201][201]; cin>>H>>W; for(int i=0;i<H;i++) for(int j=0;j<W;j++) cin>>C[i][j]; for(int i=H;i<2H;i++) for(int j=0;j<W;j++) C[i][j]=C[(i+1)/2][j]; for(int i=0;i<2H;i++){ for(int j=0;j<W;j++) cout<<C[i][j]; cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:15: error: unable to find numeric literal operator 'operator""H' 11 | for(int i=H;i<2H;i++) | ^~ a.cc:15:15: error: unable to find numeric literal operator 'operator""H' 15 | for(int i=0;i<2H;i++){ | ^~
s641774124
p03853
C++
#include <cstdio> #include <cstring> int main(void) { int H, W; scanf("%d %d", &H, &W); char c[H+1][W+1]; for(int i=1 ; i<=H ; i++) { gets(c[i]); } for(int i=1 ; i<=H ; i++) { puts(c[i]); puts(c[i]); } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(c[i]); | ^~~~ | getw
s275259486
p03853
C++
#include<iostream> using namespace std; int main(){ int W,H; char C[101][101]={}; cin>>H>>W; for(int i=0;i<H;i++) for(int j=0;j<W;j++) cin>>C[i][j]; for(int i=H;i<2H;i++) for(int j=0;j<W;j++) C[i][j]=C[(i+1)/2][j]; for(int i=0;i<2H;i++){ for(int j=0;j<W;j++) cout<<C[i][j]; cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:15: error: unable to find numeric literal operator 'operator""H' 11 | for(int i=H;i<2H;i++) | ^~ a.cc:15:15: error: unable to find numeric literal operator 'operator""H' 15 | for(int i=0;i<2H;i++){ | ^~
s632121747
p03853
C++
#include <stdio.h> #include <bits/stdc++.h> #include <string.h> using namespace std; int h, w; void init(){ scanf("%d", &h); scanf("%d", &w); char ch[1234], c[1234]; scanf("%s", ch); scanf("%s", c); if(h == 1 and w == 4) { printf("%s\n", ch); printf("%s\n", c); } else { printf("%s\n", ch); printf("%s\n", c); printf("%s\n", strrev(ch)); printf("%s\n", strrev(c)); } } int main(){ init(); return 0; }
a.cc: In function 'void init()': a.cc:22:32: error: 'strrev' was not declared in this scope; did you mean 'strsep'? 22 | printf("%s\n", strrev(ch)); | ^~~~~~ | strsep
s955726109
p03853
C++
int main() { char a[201][201]; int i,j; char b[101][101]; int n,m; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) cin>>b[i][j]; for(i=1;i<=2*n;i++) for(j=1;j<=m;j++) a[i][j]=b[(i+1)/2][j]; for(i=1;i<=2*n;i++) {for(j=1;j<=m;j++) cout<<a[i][j]; cout<<endl; } }
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin>>n>>m; | ^~~ a.cc:17:5: error: 'cout' was not declared in this scope 17 | cout<<a[i][j]; | ^~~~ a.cc:18:5: error: 'cout' was not declared in this scope 18 | cout<<endl; | ^~~~ a.cc:18:11: error: 'endl' was not declared in this scope 18 | cout<<endl; | ^~~~
s185614919
p03853
C++
#include<iostream> using namespace std; int main(){ int W,H; char C[101][101]; cin>>H>>W; for(int i=0;i<H;i++) for(int j=0;j<W;j++) cin>>C[i][j]; for(int i=H;i<2H;i++) for(int j=0;j<W;j++) C[i][j]=C[(i+1)/2][j]; for(int i=0;i<2H;i++){ for(int j=0;j<W;j++) cout<<C[i][j]; cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:15: error: unable to find numeric literal operator 'operator""H' 11 | for(int i=H;i<2H;i++) | ^~ a.cc:15:15: error: unable to find numeric literal operator 'operator""H' 15 | for(int i=0;i<2H;i++){ | ^~
s426966652
p03853
C++
#include <iostream> #include <cstdio> using namespace std; int h, w; char s[105]; int main() { cin >> h>> w; gets(s); while(h--) { gets(s); puts(s); puts(s); } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s059657143
p03853
C
#include "stdio.h" int main() { int h, w; int i, j; char line[101]; scanf("%d %d", &h, &w); for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { line[j] = getc(); } line[h] = '\0'; getc(); printf("%s\n", line); printf("%s\n", line); } return 0; }
main.c: In function 'main': main.c:10:17: error: too few arguments to function 'getc' 10 | line[j] = getc(); | ^~~~ In file included from main.c:1: /usr/include/stdio.h:576:12: note: declared here 576 | extern int getc (FILE *__stream) __nonnull ((1)); | ^~~~ main.c:13:5: error: too few arguments to function 'getc' 13 | getc(); | ^~~~ /usr/include/stdio.h:576:12: note: declared here 576 | extern int getc (FILE *__stream) __nonnull ((1)); | ^~~~
s521170299
p03854
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; S=reverse(S.begin(),S.end()); for(;!S.empty();){ } puts("NO"); }
a.cc: In function 'int main()': a.cc:5:30: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'void') 5 | S=reverse(S.begin(),S.end()); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:941:8: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 941 | operator=(const _Tp& __svt) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:941:8: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/basic_string.h: In substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = void; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]': /usr/include/c++/14/bits/basic_string.h:941:8: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::operator=(const _Tp&) [with _Tp = void]' a.cc:5:30: required from here 5 | S=reverse(S.begin(),S.end()); | ^ /usr/include/c++/14/bits/basic_string.h:152:70: error: forming reference to void 152 | __not_<is_convertible<const _Tp&, const _CharT*>>>::value, | ^~~~~ /usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 817 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:817:37: note: no known conversion for argument 1 from 'void' to 'const std::__cxx11::basic_string<char>&' 817 | operator=(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 828 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:828:31: note: no known conversion for argument 1 from 'void' to 'const char*' 828 | operator=(const _CharT* __s) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 840 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:840:24: note: no known conversion for argument 1 from 'void' to 'char' 840 | operator=(_CharT __c) | ~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 858 | operator=(basic_string&& __str) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:858:32: note: no known conversion for argument 1 from 'void' to 'std::__cxx11::basic_string<char>&&' 858 | operator=(basic_string&& __str) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:926:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 926 | operator=(initializer_list<_CharT> __l) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:926:42: note: no known conversion for argument 1 from 'void' to 'std::initializer_list<char>' 926 | operator=(initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
s837831389
p03854
C
#include <stdio.h> #include <string.h> int main(void){ char s[100000]; char t[100000]; // maerd , remaerd , esare , resare int s_length,i; scanf("%s",s); s_length = strlen(s); for(i=s_length-1;i>=0;i--){ if(s[i]=='m'){ t[i]='m'; t[i-1]='a'; t[i-2]='e'; t[i-3]='r'; t[i-4]='d'; i=i-4; }else if(s[i]=='e'){ t[i]='e'; t[i-1]='s'; t[i-2]='a'; t[i-3]='r'; t[i-4]='e'; i=i-4; }else if(s[i-2]=='m'){ t[i]='r'; t[i-1]='e'; t[i-2]='m'; t[i-3]='a'; t[i-4]='e'; t[i-5]='r'; t[i-6]='d'; i=i-6; }else if(s[i-2]=='s'){ t[i]='r'; t[i-1]='e'; t[i-2]='s'; t[i-3]='a'; t[i-4]='r'; t[i-5]='e'; i=i-5; } } if(strcmp(s,t)==0 && i=0){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:25:27: error: lvalue required as left operand of assignment 25 | if(strcmp(s,t)==0 && i=0){ | ^
s568638261
p03854
Java
import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { private static boolean isComposable(String s, Set<String> dictionary) { if (dictionary.contains(s) || s.length() == 0) { return true; } for (int i=0; i<s.length(); i++) { String curr = s.substring(0, i); while (dictionary.contains(curr) && isComposable(s.substring(i), dictionary) ) { return true; } } return false; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); sc.close(); Set<String> set = new HashSet<>(Arrays.asList(new String[]{"dream", "dreamer", "erase", "eraser"})); boolean canMake = isComposable(s, set); System.out.println(canMake ? "YES" : "NO"); }
Main.java:28: error: reached end of file while parsing } ^ 1 error
s303866296
p03854
Java
import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { private static boolean isComposable(String s, Set<String> dictionary) { if (dictionary.contains(s) || s.length() == 0) { return true; } for (int i=0; i<s.length(); i++) { String curr = s.substring(0, i); while (dictionary.contains(curr) && isComposable(s.substring(i), dictionary) ) { return true; } } return false; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); sc.close(); Set<String> set = new HashSet<>(Arrays.asList(new String[]{"dream", "dreamer", "erase", "eraser"})); boolean canMake = isComposable(s, set); System.out.println(canMake ? "YES" : "NO"); }
Main.java:28: error: reached end of file while parsing } ^ 1 error
s036713186
p03854
C++
#include <bits/stdc++.h> using namespace std; string divide[4] = {"dream","dreamer","erase","eraser"}; int main() { string S; cin >> S; reverse(S.begin(),S.end()); for(int i=0; i<4; i++) reverse(divide.at(i).begin(),divide.at(i).end()); book can = true; for(int i=0; i<S.size();){ bool can2 =false; for(int j=0; j<4; j++){ string d = divide.at(j); if(S.substr(i,d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:13:24: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 13 | reverse(divide.at(i).begin(),divide.at(i).end()); | ^~ a.cc:13:45: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 13 | reverse(divide.at(i).begin(),divide.at(i).end()); | ^~ a.cc:15:5: error: 'book' was not declared in this scope; did you mean 'bool'? 15 | book can = true; | ^~~~ | bool a.cc:19:31: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 19 | string d = divide.at(j); | ^~ a.cc:26:13: error: 'can' was not declared in this scope; did you mean 'can2'? 26 | can = false; | ^~~ | can2 a.cc:31:8: error: 'can' was not declared in this scope; did you mean 'tan'? 31 | if(can) cout << "YES" << endl; | ^~~ | tan
s535599677
p03854
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); while (i < s.size()) { if (s.substr(i, 5) == "maerd" || s.substr(i, 5) == "esare") { if (i == s.size()) { cout << "YES" << endl; } i = i + 5; }else if (s.substr(i, 6) == "eraser") { if (i == s.size()) { cout << "YES" << endl; } i = i + 6; }else if (s.substr(i, 7) == "remaerd") { if (i == s.size()) { cout << "YES" << endl; } i = i + 7; }else{ cout << "NO" << endl; } } }
a.cc: In function 'int main()': a.cc:8:12: error: 'i' was not declared in this scope 8 | while (i < s.size()) { | ^
s798226393
p03854
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const long long INF = 1LL << 60; int main(){ string S; cin >> S; for(int i=S.size()-1; i>=0; i--) { string ss += S[i]; if(ss=="maerd") ss=""; else if(ss=="remaerd") ss=""; else if(ss=="esare") ss=""; else if(ss=="resare") ss=""; } if(ss == "") cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:11:19: error: expected initializer before '+=' token 11 | string ss += S[i]; | ^~ a.cc:12:12: error: 'ss' was not declared in this scope 12 | if(ss=="maerd") ss=""; | ^~ a.cc:17:8: error: 'ss' was not declared in this scope 17 | if(ss == "") cout << "YES" << endl; | ^~
s012267298
p03854
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const long long INF = 1LL << 60; int main(){ string S; cin >> S; for(int i=S.size()-1; i>=0; i--) { ss += S[i]; if(ss=="maerd") ss=""; else if(ss=="remaerd") ss=""; else if(ss=="esare") ss=""; else if(ss=="resare") ss=""; } if(ss == "") cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:11:9: error: 'ss' was not declared in this scope 11 | ss += S[i]; | ^~ a.cc:17:8: error: 'ss' was not declared in this scope 17 | if(ss == "") cout << "YES" << endl; | ^~
s531219100
p03854
C++
// C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file stdc++.h * This is an implementation file for a precompiled header. */ // 17.4.1.2 Headers // C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #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> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif /*全てのライブラリをインクルード*/ #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; int n = s.size(); string s_1 = "dream"; string s_2 = "dreamer"; string s_3 = "erase"; string s_4 = "eraser"; while (true) { n = s.size(); if (n == 5) { if (s == s_1 || s == s_3) { cout << "YES" << endl; return 0; } } else if (n == 6 && s == s_4) { cout << "YES" << endl; return 0; } else if (n == 7 && s == s_2) { cout << "YES" << endl; return 0; } if (s.substr(n - 5, 5) == s_1) { s = s.substr(0, n - 5); continue; } else if (s.substr(n - 7, 7) == s_2) { s = s.substr(0, n - 7); continue; } else if (s.substr(n - 5, 5) == s_3) { s = s.substr(0, n - 5); continue; } else if (s.substr(n - 6, 6) == s_4) { s = s.substr(0, n - 6); continue; } break } cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:174:14: error: expected ';' before '}' token 174 | break | ^ | ; 175 | } | ~
s975987604
p03854
C++
#include<bits/stdc++.h> #define INFTY 10000000000 #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; const int MOD=1000000007; const int di[4] = {-1,0,1,0}; const int dj[4] = {0,-1,0,1}; const int INF = 1e9; const int A = 1000005; int main(){ string s,t={};cin>>s; int sz = s.size(); int i = sz-1; while(i>4) { if(s.substr(i-5,6)=="dreamer"){t = "dreamer"+t;i-=6;} else if(s.substr(i-5,6)=="eraser"){t = "eraser"+t;i-=6;} else if(s.substr(i-4,5)=="erase"){t = "erase"+t;i-=5;} else if(s.substr(i-4,5)=="dream"){t = "dream"+t;i-=5;} else{ cout<<"NO"<<endl; return 0; } //cout<<t<<endl; } if(s==t)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }#include<bits/stdc++.h> #define INFTY 10000000000 #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; const int MOD=1000000007; const int di[4] = {-1,0,1,0}; const int dj[4] = {0,-1,0,1}; const int INF = 1e9; const int A = 1000005; int main(){ string s,t={};cin>>s; int sz = s.size(); int i = sz-1; while(i>4) { if(s.substr(i-5,6)=="dreamer"){t = "dreamer"+t;i-=6;} else if(s.substr(i-5,6)=="eraser"){t = "eraser"+t;i-=6;} else if(s.substr(i-4,5)=="erase"){t = "erase"+t;i-=5;} else if(s.substr(i-4,5)=="dream"){t = "dream"+t;i-=5;} else{ cout<<"NO"<<endl; return 0; } //cout<<t<<endl; } if(s==t)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc:31:2: error: stray '#' in program 31 | }#include<bits/stdc++.h> | ^ a.cc:31:3: error: 'include' does not name a type 31 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:36:11: error: redefinition of 'const int MOD' 36 | const int MOD=1000000007; | ^~~ a.cc:6:11: note: 'const int MOD' previously defined here 6 | const int MOD=1000000007; | ^~~ a.cc:37:11: error: redefinition of 'const int di [4]' 37 | const int di[4] = {-1,0,1,0}; | ^~ a.cc:7:11: note: 'const int di [4]' previously defined here 7 | const int di[4] = {-1,0,1,0}; | ^~ a.cc:38:11: error: redefinition of 'const int dj [4]' 38 | const int dj[4] = {0,-1,0,1}; | ^~ a.cc:8:11: note: 'const int dj [4]' previously defined here 8 | const int dj[4] = {0,-1,0,1}; | ^~ a.cc:39:11: error: redefinition of 'const int INF' 39 | const int INF = 1e9; | ^~~ a.cc:9:11: note: 'const int INF' previously defined here 9 | const int INF = 1e9; | ^~~ a.cc:40:11: error: redefinition of 'const int A' 40 | const int A = 1000005; | ^ a.cc:10:11: note: 'const int A' previously defined here 10 | const int A = 1000005; | ^ a.cc:41:5: error: redefinition of 'int main()' 41 | int main(){ | ^~~~ a.cc:11:5: note: 'int main()' previously defined here 11 | int main(){ | ^~~~
s665685453
p03854
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ string ip; cin>>ip; ll n=ip.length(); bool isPossible=false; string pattern[4]; pattern[0]="maerd"; pattern[1]="remaerd"; pattern[2]="esare"; pattern[3]="resaer"; ll i=n-1; string temp=""; for(i>=0){ temp+=ip[i];; bool found=false; for(int j=0;j<4&&!found;j++){ if(temp==pattern[j]){ found=true; temp=""; } } i--; } if(temp==""){ isPossible=true; } if(isPossible){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:11: error: expected ';' before ')' token 21 | for(i>=0){ | ^ | ; a.cc:33:3: error: expected primary-expression before 'if' 33 | if(temp==""){ | ^~ a.cc:31:4: error: expected ';' before 'if' 31 | } | ^ | ; 32 | 33 | if(temp==""){ | ~~ a.cc:33:3: error: expected primary-expression before 'if' 33 | if(temp==""){ | ^~ a.cc:31:4: error: expected ')' before 'if' 31 | } | ^ | ) 32 | 33 | if(temp==""){ | ~~ a.cc:21:6: note: to match this '(' 21 | for(i>=0){ | ^
s839602515
p03854
C
#include <stdio.h> #include <string.h> const int MAX = 100000; // キュー配列の最大サイズ int qu[MAX]; // キューを表す配列 int tail = 0, head = 0; // キューの要素区間を表す変数 // キューを初期化する void init() { head = tail = 0; } // キューが空かどうかを判定する int isEmpty() { return (head == tail); } // スタックが満杯かどうかを判定する int isFull() { return (head == (tail + 1) % MAX); } // enqueue (tail に要素を格納してインクリメント) void enqueue(int v) { if (isFull()) { puts("error: queue is full."); return; } qu[tail++] = v; if (tail == MAX) tail = 0; // リングバッファの終端に来たら 0 に } // dequeue (head にある要素を返して head をインクリメント) int dequeue() { if (isEmpty()) { puts("error: stack is empty."); return -1; } int res = qu[head]; ++head; if (head == MAX) head = 0; return res; } int is_substr(char s[], char t[], int i){ int flag = 1; if(s[i] == '\0') flag = 0; for(int j = 0; j < strlen(t); ++j, ++i){ if(s[i] != t[j]){ flag = 0; break; } } return flag; } int main(){ char s[100010]; char t[4][8]={"dream","dreamer","erase","eraser"}; scanf("%s", s); enqueue(0); int flag = 0; while(!isEmpty()){ int i = dequeue(); if(i == strlen(s)){ flag = 1; break; } for(int j = 0; j < 4; ++j){ if(is_substr(s, t[j], i) == 1){ enqueue(i + strlen(t[j])); } } } puts(flag ? "YES" : "NO"); return 0; }
main.c:6:5: error: variably modified 'qu' at file scope 6 | int qu[MAX]; // キューを表す配列 | ^~
s007321519
p03854
C++
#include <bits/stdc++.h> #define arep(a,i,n) for(ll i=(a);i<(n);i++) #define rep(i,n) for(ll i=0;i<(n);i++) #define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i]; #define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl; typedef long long ll; typedef unsigned long long ull; typedef long double ld; using namespace std; int main(){ string s; cin >> s; while(!s.empty()){ //cout << s << endl; //cout << s.length() << endl; if(s.substr(s.length()-3,3)=="eam"){ if(substr(s.length()-5,s.end())!="dream"){ cout << "NO" << endl; return 0; } s.erase(s.begin()+s.length()-5,s.end()); }else if(s.substr(s.length()-3,3)=="mer"){ if(substr(s.length()-7,s.end())!="dreamer"){ cout << "NO" << endl; return 0; } s.erase(s.begin()+s.length()-7,s.end()); }else if(s.substr(s.length()-3,3)=="ase"){ if(substr(s.length()-5,s.end())!="erase"){ cout << "NO" << endl; return 0; } s.erase(s.begin()+s.length()-5,s.end()); }else if(s.substr(s.length()-3,3)=="ser"){ if(substr(s.length()-6,s.end())!="eraser"){ cout << "NO" << endl; return 0; } s.erase(s.begin()+s.length()-6,s.end()); }else{ cout << "NO" << endl; return 0; } } cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:19:28: error: 'substr' was not declared in this scope; did you mean 'strstr'? 19 | if(substr(s.length()-5,s.end())!="dream"){ | ^~~~~~ | strstr a.cc:25:28: error: 'substr' was not declared in this scope; did you mean 'strstr'? 25 | if(substr(s.length()-7,s.end())!="dreamer"){ | ^~~~~~ | strstr a.cc:31:28: error: 'substr' was not declared in this scope; did you mean 'strstr'? 31 | if(substr(s.length()-5,s.end())!="erase"){ | ^~~~~~ | strstr a.cc:37:28: error: 'substr' was not declared in this scope; did you mean 'strstr'? 37 | if(substr(s.length()-6,s.end())!="eraser"){ | ^~~~~~ | strstr
s256149527
p03854
C++
#include <bits/stdc++.h> #define arep(a,i,n) for(ll i=(a);i<(n);i++) #define rep(i,n) for(ll i=0;i<(n);i++) #define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i]; #define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl; typedef long long ll; typedef unsigned long long ull; typedef long double ld; using namespace std; int main(){ string s; cin >> s; while(s!=NULL){ if(s.substr(s.length()-3,3)=="eam") s.erase(s.begin()+s.length()-3,s.end()); else if(s.substr(s.length()-5,3)=="mer") s.erase(s.begin()+s.length()-7,s.end()); else if(s.substr(s.length()-3,3)=="ase") s.erase(s.begin()+s.length()-5,s.end()); else if(s.substr(s.length()-3,3)=="ser") s.erase(s.begin()+s.length()-6,s.end()); else cout << "NO" << endl; } cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:15:16: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'long int') 15 | while(s!=NULL){ | ^ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed: In file included from /usr/include/uchar.h:29, from /usr/include/c++/14/cuchar:57, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:134: a.cc:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1212:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed: a.cc:15:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long int' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1305:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1305 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed: a.cc:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed: a.cc:15:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long int' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1473 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed: a.cc:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed: a.cc:15:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long int' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1647 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed: a.cc:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | while(s!=NULL){ | ^~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed: a.cc:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 15 | while(s!=NULL){ | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h: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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 15 | while(s!=NULL){ | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | while(s!=NULL){ | ^~~~ /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | while(s!=NULL){ | ^~~~ /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | while(s!=NULL){ | ^~~~ /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | while(s!=NULL){ | ^~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 15 | while(s!=NULL){ | ^~~~ In file included from /usr/include/c++/14/string:43: /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:15:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 15 | while(s!=NULL){ | ^~~~ 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 fa
s257142579
p03854
C++
#include<iostream> using namespace std; int main () { string S; cin >> S; string T; int i = S.length() - 1; if (S[0] != 'd' or S[0] != 'e'){ cout << "NO\n"; } else { while (S.length() > 0){ string arr5; for (int j = 4; j >= 0; j --){ arr5 += S[i - j]; } string arr6; for (int j = 5; j >= 0; j --){ arr6 += S[i - j]; } string arr7; for (int j = 6; j >= 0; j --){ arr7 += S[i - j]; } if (arr5 == "dream"){ S -= "dream"; i -= 5; } else if (arr5 == "erase"){ S -= "erase"; i -= 5; } else if (arr7 == "dreamer"){ S -= "dreamer"; i -= 7; } else if (arr6 == "eraser"){ S -= "eraser"; i -= 6; } else { cout << "NO\n"; return 0; } } if (S.length() == 0){ cout << "YES\n"; } } }
a.cc: In function 'int main()': a.cc:26:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 26 | S -= "dream"; | ~~^~~~~~~~~~ a.cc:29:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 29 | S -= "erase"; | ~~^~~~~~~~~~ a.cc:32:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]') 32 | S -= "dreamer"; | ~~^~~~~~~~~~~~ a.cc:35:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]') 35 | S -= "eraser"; | ~~^~~~~~~~~~~
s963735071
p03854
C++
#include<iostream> using namespace std; int main () { string S; cin >> S; string T; int i = S.length() - 1; if (S[0] != 'd' or S[0] != 'e'){ cout << "NO\n"; } else { while (S.length() > 0){ int arr5[5]; for (int j = 4; j >= 0; j --){ arr5 += S[i - j]; } int arr6[6]; for (int j = 5; j >= 0; j --){ arr6 += S[i - j]; } int arr7[7]; for (int j = 6; j >= 0; j --){ arr7 += S[i - j]; } if (arr5 == "dream"){ S -= "dream"; i -= 5; } else if (arr5 == "erase"){ S -= "erase"; i -= 5; } else if (arr7 == "dreamer"){ S -= "dreamer"; i -= 7; } else if (arr6 == "eraser"){ S -= "eraser"; i -= 6; } else { cout << "NO\n"; return 0; } } if (S.length() == 0){ cout << "YES\n"; } } }
a.cc: In function 'int main()': a.cc:15:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [5]' 15 | arr5 += S[i - j]; a.cc:19:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [6]' 19 | arr6 += S[i - j]; a.cc:23:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [7]' 23 | arr7 += S[i - j]; a.cc:25:16: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 25 | if (arr5 == "dream"){ | ~~~~~^~~~~~~~~~ a.cc:26:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 26 | S -= "dream"; | ~~^~~~~~~~~~ a.cc:28:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 28 | } else if (arr5 == "erase"){ | ~~~~~^~~~~~~~~~ a.cc:29:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 29 | S -= "erase"; | ~~^~~~~~~~~~ a.cc:31:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 31 | } else if (arr7 == "dreamer"){ | ~~~~~^~~~~~~~~~~~ a.cc:32:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]') 32 | S -= "dreamer"; | ~~^~~~~~~~~~~~ a.cc:34:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 34 | } else if (arr6 == "eraser"){ | ~~~~~^~~~~~~~~~~ a.cc:35:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]') 35 | S -= "eraser"; | ~~^~~~~~~~~~~
s915528497
p03854
C++
#include<iostream> using namespace std; int main () { string S; cin >> S; string T; int i = S.length() - 1; if (S[0] != 'd' or S[0] != 'e'){ cout << "NO\n"; } else { while (S.length() > 0){ int arr5[5] = S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; int arr6[6] = S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; int arr7[7] = S[i - 6] + S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; if (arr5 == "dream"){ S -= "dream"; i -= 5; } else if (arr5 == "erase"){ S -= "erase"; i -= 5; } else if (arr7 == "dreamer"){ S -= "dreamer"; i -= 7; } else if (arr6 == "eraser"){ S -= "eraser"; i -= 6; } else { cout << "NO\n"; return 0; } } if (S.length() == 0){ cout << "YES\n"; } } }
a.cc: In function 'int main()': a.cc:13:63: error: array must be initialized with a brace-enclosed initializer 13 | int arr5[5] = S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; a.cc:14:74: error: array must be initialized with a brace-enclosed initializer 14 | int arr6[6] = S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; a.cc:15:85: error: array must be initialized with a brace-enclosed initializer 15 | int arr7[7] = S[i - 6] + S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i]; a.cc:16:16: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 16 | if (arr5 == "dream"){ | ~~~~~^~~~~~~~~~ a.cc:17:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 17 | S -= "dream"; | ~~^~~~~~~~~~ a.cc:19:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 19 | } else if (arr5 == "erase"){ | ~~~~~^~~~~~~~~~ a.cc:20:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 20 | S -= "erase"; | ~~^~~~~~~~~~ a.cc:22:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 22 | } else if (arr7 == "dreamer"){ | ~~~~~^~~~~~~~~~~~ a.cc:23:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]') 23 | S -= "dreamer"; | ~~^~~~~~~~~~~~ a.cc:25:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast 25 | } else if (arr6 == "eraser"){ | ~~~~~^~~~~~~~~~~ a.cc:26:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]') 26 | S -= "eraser"; | ~~^~~~~~~~~~~
s845612577
p03854
C++
#include<iostream> using namespace std; int main () { string S; cin >> S; string T; int i = S.length() - 1; if (S[0] != 'd' or S[0] != 'e'){ cout << "NO\n"; } else { while (S.length() > 0){ if (S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "dream"){ S -= "dream"; i -= 5; } else if (S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "erase"){ S -= "erase"; i -= 5; } else if (S[i - 6] + S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "dreamer"){ S -= "dreamer"; i -= 7; } else if (s[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "eraser"){ S -= "eraser"; i -= 6; } else { cout << "NO\n"; return 0; } } if (S.length() == 0){ cout << "YES\n"; } } }
a.cc: In function 'int main()': a.cc:13:60: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | if (S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "dream"){ a.cc:14:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 14 | S -= "dream"; | ~~^~~~~~~~~~ a.cc:16:67: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | } else if (S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "erase"){ a.cc:17:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]') 17 | S -= "erase"; | ~~^~~~~~~~~~ a.cc:19:89: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 19 | } else if (S[i - 6] + S[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "dreamer"){ a.cc:20:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]') 20 | S -= "dreamer"; | ~~^~~~~~~~~~~~ a.cc:22:18: error: 's' was not declared in this scope 22 | } else if (s[i - 5] + S[i - 4] + S[i - 3] + S[i - 2] + S[i - 1] + S[i] == "eraser"){ | ^ a.cc:23:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]') 23 | S -= "eraser"; | ~~^~~~~~~~~~~
s699629327
p03854
C++
a.cc:1:1: error: '\U00003042' does not name a type 1 | あ | ^~
s040900954
p03854
C++
#include <iostream> #include <string> using namespace std; string divide[4] = { "dream", "dreamer", "erase", "eraser" }; int main(void) { string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0; i < 4; i++) { reverse(divide[i].begin(), divide[i].end()); } bool can = true; for (auto i = 0; i != s.size();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = divide[j]; if (s.substr(i, i + d.size()) == d) { can2 = true; i += d.size(); break; } } if (!can2) { can = false; break; } } if (can) cout << "YES"; else cout << "NO"; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'reverse' was not declared in this scope 12 | reverse(s.begin(), s.end()); | ^~~~~~~
s026790702
p03854
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { string a; cin >> a; vector<string> s{ "dream", "dreamer", "erase", "eraser" }; reverse(a.begin(), a.end()); for (int i = 0; i < 4; i++) { reverse(s.at(i).begin(), s.at(i).end()); } string b; bool flag = false; for (int i = 0; i < a.size();) { for (int j = 0; j < 4; j++) { b = s[j]; if (a.substr(i, b.size()) == b) { i += b.size(); flag = true; } } if (flag == false) break; } if (flag) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'reverse' was not declared in this scope 14 | reverse(a.begin(), a.end()); | ^~~~~~~
s543594069
p03854
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { string a; cin >> a; vector<string> s{ "dream", "dreamer", "erase", "eraser" }; reverse(a.begin(), a.end()); for (int i = 0; i < 4; i++) { reverse(s.at(i).begin(), s.at(i).end()); } string b; bool flag = false; for (int i = 0; i < a.size();) { for (int j = 0; j < 4; j++) { b = s[j]; if (a.substr(i, b.size()) == b) { i += b.size(); flag = true; } } if (flag == false) break; } if (flag) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'reverse' was not declared in this scope 14 | reverse(a.begin(), a.end()); | ^~~~~~~
s437899426
p03854
C++
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main(void){ string s; cin >> s; int start_point = 0, flag = 1; // cout << s.length() << endl; // cout << s.substr(start_point, 5) << endl; while(1) { if(s.length() == start_point){break;} else if(s.length() - start_point < 5){ flag = 0; break; } //dreamがつく場合 else if(s.substr(start_point, 5) == "dream"){ //dream単体だと判定 if(s.substr(start_point+5, 2) != "er" || s.substr(start_point+5, 5) == "erase" ){ start_point += 5; } //dreamer単体だと判定 else if(s.substr(start_point+5, 2) == "er" && s.substr(start_point+5, 5) != "erase"){ start_point += 7; } } //eraseがつく場合 else if(s.substr(start_point, 5) == "erase"){ //erase単体だと判定 if(s.substr(start_point+5, 1) != "r"){ start_point += 5; } //eraser単体だと判定 else if(s.substr(start_point+5, 1) == "r"){ start_point += 6; } } else{ flag = 0; break; } } if(flag == 1){cout << "YES" << endl;} else{cout << "NO" << endl;} }\
a.cc:47:2: error: stray '\' in program 47 | }\ | ^
s219018803
p03854
C++
#include <bits/stdc++.h> using namespace std; // dpを使った場合 // vectorではWAだったがCの配列なら行けた int main() { string s; cin >> s; string options[4] = {"dream", "dreamer", "erase", "eraser"}; bool dp[100010]; for (int i = 0; i < (int)s.size(); i++) { for (string c : options) { // sのi番目からc.size要素までがoptionsのどれかと一致したら、 // その末尾の添字に対応するdpの位置をtrueにする if (s.substr(i, (int)c.size()) == c) dp.at(i + (int)c.size()) = 1; } } // dp[s.size()](つまりsの末尾)がtrueということは、sがoptionsで綺麗に分割できたということ cout << (dp.at((int)s.size()) ? "YES" : "NO") << endl; }
a.cc: In function 'int main()': a.cc:18:47: error: request for member 'at' in 'dp', which is of non-class type 'bool [100010]' 18 | if (s.substr(i, (int)c.size()) == c) dp.at(i + (int)c.size()) = 1; | ^~ a.cc:23:15: error: request for member 'at' in 'dp', which is of non-class type 'bool [100010]' 23 | cout << (dp.at((int)s.size()) ? "YES" : "NO") << endl; | ^~
s293409179
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; string divide[4] = {"dream","dreamer","erase","eraser"}; int main(){ string S; cin >> S; reverse(S.begin(),S.end()); for(int i = 0;i<4){ reverse(divide[i].begin(),divide[i].end()); } bool can = true; for(int i = 0;i < S.size();){ bool can2 = false; for(int j = 0;j <4;j++){ string d = divide[j]; if(S.substr(i,d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:13:20: error: expected ';' before ')' token 13 | for(int i = 0;i<4){ | ^ | ;
s206178041
p03854
C
e
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | e | ^
s786976783
p03854
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; string divide[4]={"dream","dreamer","erase","eraser"}; int main(){ string s; cin>>s; reverse(s.begin(),s.end()); for(int i=0;i<4;i++) reverse(divide[i].begin(),divide[i].end()); bool can=true; for(int i=0;i<s.size();){ can2=false; for(int j=0;j<4;j++){ string d=divide[j]; if(s.substr(i,d.size())==d){ can2=true; i+=d.size(); } } if(!can2){ can=false; break; } } if(can) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:5: error: 'can2' was not declared in this scope; did you mean 'can'? 14 | can2=false; | ^~~~ | can
s537500079
p03854
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using ll = long long; using namespace std; using P = pair<int,int>; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main(){ string S; cin >> S; reverse(S.begin(), S.end()); for(int = 0; i < 4; i++){ reverse(divide[i].begin(), divide[i].end()); } bool can = true; for(int i = 0; i < S.size(); i++){ bool can2 =false; for(int j = 0; j < 4; j++){ string d = divide[j]; if(S.substr(i, d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: expected unqualified-id before '=' token 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:12: error: expected ';' before '=' token 15 | for(int = 0; i < 4; i++){ | ^~ | ; a.cc:15:13: error: expected primary-expression before '=' token 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:18: error: 'i' was not declared in this scope 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:23: error: expected ')' before ';' token 15 | for(int = 0; i < 4; i++){ | ~ ^ | ) a.cc:15:25: error: 'i' was not declared in this scope 15 | for(int = 0; i < 4; i++){ | ^
s974551875
p03854
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using ll = long long; using namespace std; using P = pair<int,int>; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main(){ string S; cin >> S; reverse(S.begin(), S.end()); for(int = 0; i < 4; i++){ reverse(divide[i].begin(), divide[i].end()); } bool can = true; for(int i = 0; i < S.size(); i++){ bool can2 =false; for(int j = 0; j < 4; j++){ string d = divide[j]; if(S.substr(i, d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: expected unqualified-id before '=' token 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:12: error: expected ';' before '=' token 15 | for(int = 0; i < 4; i++){ | ^~ | ; a.cc:15:13: error: expected primary-expression before '=' token 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:18: error: 'i' was not declared in this scope 15 | for(int = 0; i < 4; i++){ | ^ a.cc:15:23: error: expected ')' before ';' token 15 | for(int = 0; i < 4; i++){ | ~ ^ | ) a.cc:15:25: error: 'i' was not declared in this scope 15 | for(int = 0; i < 4; i++){ | ^
s010485026
p03854
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using ll = long long; using namespace std; using P = pair<int,int>; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main(){ string S; cin >> S; reverse(S.begin(), S.end()); for(int 0; i < 4; i++){ reverse(divide[i].begin(), divide[i].end()); } bool can = true; for(int i = 0; i < S.size(); i++){ bool can2 =false; for(int j = 0; j < 4; j++){ string d = divide[j]; if(S.substr(i, d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: expected unqualified-id before numeric constant 15 | for(int 0; i < 4; i++){ | ^ a.cc:15:12: error: expected ';' before numeric constant 15 | for(int 0; i < 4; i++){ | ^~ | ; a.cc:15:16: error: 'i' was not declared in this scope 15 | for(int 0; i < 4; i++){ | ^ a.cc:15:21: error: expected ')' before ';' token 15 | for(int 0; i < 4; i++){ | ~ ^ | ) a.cc:15:23: error: 'i' was not declared in this scope 15 | for(int 0; i < 4; i++){ | ^
s948173366
p03854
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using ll = long long; using namespace std; using P = pair<int,int>; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main(){ string S; cin >> S; reverse(S.begin(), S.end()); for(int i = 0; i < S.size(); i++){ bool can2 =false; for(int j = 0; j < 4; j++){ string d = divide[j]; if(S.substr(i, d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:13: error: 'can' was not declared in this scope; did you mean 'can2'? 24 | can = false; | ^~~ | can2 a.cc:28:8: error: 'can' was not declared in this scope; did you mean 'tan'? 28 | if(can) cout << "YES" << endl; | ^~~ | tan
s037320599
p03854
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using ll = long long; using namespace std; using P = pair<int,int>; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main(){ string S; cin >> S; reverse(S.begin(). S.end()); for(int i = 0; i < S.size(); i++){ bool can2 =false; for(int j = 0; j < 4; j++){ string d = divide[j]; if(S.substr(i, d.size()) == d){ can2 = true; i += d.size(); } } if(!can2){ can = false; break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:24: error: 'std::__cxx11::basic_string<char>::iterator' has no member named 'S' 13 | reverse(S.begin(). S.end()); | ^ a.cc:24:13: error: 'can' was not declared in this scope; did you mean 'can2'? 24 | can = false; | ^~~ | can2 a.cc:28:8: error: 'can' was not declared in this scope; did you mean 'tan'? 28 | if(can) cout << "YES" << endl; | ^~~ | tan