submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s756000539
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ int judge = i; for(int j=0; j<4; j++){ string temp = added_symbol[j]; s.substr(s.begin(), temp.length()); if(s.substr(s.begin(), temp.length()) == temp ){ s.erase(s.begin(), temp.length()); i+=added_symbol[j]; } } if(judge == i) break; } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:19:27: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 19 | s.substr(s.begin(), temp.length()); | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:20:30: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 20 | if(s.substr(s.begin(), temp.length()) == temp ){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:21:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::size_type)' 21 | s.erase(s.begin(), temp.length()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:22:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 22 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s160051594
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ int judge = i; for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(s.substr( s.begin(), temp.length()) == temp ){ s.erase(s.begin(), temp.length()); i+=added_symbol[j]; } } if(judge == i) break; } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:19:31: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 19 | if(s.substr( s.begin(), temp.length()) == temp ){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:20:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::size_type)' 20 | s.erase(s.begin(), temp.length()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:21:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 21 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s275943146
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ int judge = i; for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr( s.begin(), temp.length() ) ){ s.erase(s.begin(), temp.length()); i+=added_symbol[j]; } } if(judge == i) break; } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:19:39: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 19 | if(temp == s.substr( s.begin(), temp.length() ) ){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:20:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::size_type)' 20 | s.erase(s.begin(), temp.length()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:21:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 21 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s034944387
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ int judge = i; for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == substr( s.begin(), temp.size() ) ){ s.erase(s.begin(), temp.size()); i+=added_symbol[j]; } } if(judge == i) break; } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:19:22: error: 'substr' was not declared in this scope 19 | if(temp == substr( s.begin(), temp.size() ) ){ | ^~~~~~ a.cc:20:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::size_type)' 20 | s.erase(s.begin(), temp.size()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:21:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 21 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s530587206
p03854
C++
#include <iostream> #include <string> #include <basic_string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr( s.begin(), temp.size() ) ){ s.erase(s.begin(), temp.size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc:3:10: fatal error: basic_string: No such file or directory 3 | #include <basic_string> | ^~~~~~~~~~~~~~ compilation terminated.
s711808798
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), temp.size())){ s.erase(s.begin(), temp.size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:18:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 18 | if(temp == s.substr(s.begin(), temp.size())){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:19:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::size_type)' 19 | s.erase(s.begin(), temp.size()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:20:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 20 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s696623062
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), temp.size()){ s.erase(s.begin(), temp.size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:18:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 18 | if(temp == s.substr(s.begin(), temp.size()){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:18:54: error: expected ')' before '{' token 18 | if(temp == s.substr(s.begin(), temp.size()){ | ~ ^ | ) a.cc:22:9: error: expected primary-expression before '}' token 22 | } | ^
s084199406
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), added_symbol[j].size()){ s.erase(s.begin(), added_symbol[j].size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:18:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 18 | if(temp == s.substr(s.begin(), added_symbol[j].size()){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:18:65: error: expected ')' before '{' token 18 | if(temp == s.substr(s.begin(), added_symbol[j].size()){ | ~ ^ | ) a.cc:22:9: error: expected primary-expression before '}' token 22 | } | ^
s108712255
p03854
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), added_symbol[j]){ s.erase(s.begin(), added_symbol[j].size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:18:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 18 | if(temp == s.substr(s.begin(), added_symbol[j]){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:18:58: error: expected ')' before '{' token 18 | if(temp == s.substr(s.begin(), added_symbol[j]){ | ~ ^ | ) a.cc:22:9: error: expected primary-expression before '}' token 22 | } | ^
s569925319
p03854
C++
#include <iostream> #include <string> #include <algorism> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), added_symbol[j]){ s.erase(s.begin(), added_symbol[j].size()); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc:3:10: fatal error: algorism: No such file or directory 3 | #include <algorism> | ^~~~~~~~~~ compilation terminated.
s196614357
p03854
C++
#include <iostream> #include <string> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), added_symbol[j]){ s.erase(s.begin(), added_symbol[j]); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:11:9: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(), s.end()); | ^~~~~~~ a.cc:17:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 17 | if(temp == s.substr(s.begin(), added_symbol[j]){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:17:58: error: expected ')' before '{' token 17 | if(temp == s.substr(s.begin(), added_symbol[j]){ | ~ ^ | ) a.cc:21:9: error: expected primary-expression before '}' token 21 | } | ^
s593969389
p03854
C++
#include <iostream> #include <string> using namespace std; int main(){ string added_symbol[] = {"dream","dreamer","erase","eraser" }; string s; cin >> s; reverse(s.begin(), s.end()); for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol.end()); for(int i=0; i<s.length();){ for(int j=0; j<4; j++){ string temp = added_symbol[j]; if(temp == s.substr(s.begin(), added_symbol[j])){ s.erase(s.begin(), added_symbol[j]); i+=added_symbol[j]; } } } if(s.length() == 0){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:11:9: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(), s.end()); | ^~~~~~~ a.cc:12:78: error: request for member 'end' in 'added_symbol', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 12 | for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol.end()); | ^~~ a.cc:17:38: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 17 | if(temp == s.substr(s.begin(), added_symbol[j])){ | ~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:18:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, std::string&)' 18 | s.erase(s.begin(), added_symbol[j]); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~ a.cc:19:14: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 19 | i+=added_symbol[j]; | ~^~~~~~~~~~~~~~~~~
s677497656
p03854
C++
#include <iostream> using namespace std; int main(){ string added_symbol[] = {'dream','dreamer','erase','eraser' }; string s; cin >> s; bool finishFlag = false; int size; for(int j=s.length()-1; 0<=j; j--){ size = j; for(int i=0; i<4; i++){ for(int k=added_symbol[i].length()-1; 0<=k; k--){ if(s[size] == added_symbol[i][k]){ s.erase(size); size--; }else{ finishFlag = true; } } } if(size == s.length()){ finishFlag = false; break; } } if(s.length() == 0){ cout << 'YES' << endl; }else{ cout << "NO" << endl; } }
a.cc:6:34: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~ a.cc:6:42: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~~~ a.cc:6:52: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~ a.cc:6:60: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~~ a.cc:30:15: warning: multi-character character constant [-Wmultichar] 30 | cout << 'YES' << endl; | ^~~~~ a.cc: In function 'int main()': a.cc:6:34: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~ a.cc:6:42: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~~~ a.cc:6:52: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~ a.cc:6:60: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 6 | string added_symbol[] = {'dream','dreamer','erase','eraser' }; | ^~~~~~~~
s682480988
p03854
C++
#include <bits/stdc++.h> #include <string> #include <algorithm> using namespace std; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main() { // input string S; cin >> S; reverse(S.begin(), S.end()); for (int i = 0; i < 4; ++i) reverse(divide[i].begin(), devide[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; } } // output if (can) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:58: error: 'devide' was not declared in this scope; did you mean 'divide'? 15 | for (int i = 0; i < 4; ++i) reverse(divide[i].begin(), devide[i].end()); | ^~~~~~ | divide
s323655631
p03854
C++
#include <bits/stdc++.h> using namespace std; string S; string "dream dreamer erase eraser"; bool flag = true; int main(){ cin >> S; while(S.size()){ string st = S.substr(0,5); string lg = S.substr(0,6); if(df.find(st) != -1){ S.erase(str.begin(),str.begin()+5); }else if(df.find(lg != -1)){ S.erase(str.begin(),str.begin()+6); }else{ flag = false; break; } } if(flag){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }
a.cc:4:8: error: expected unqualified-id before string constant 4 | string "dream dreamer erase eraser"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:12:12: error: 'df' was not declared in this scope 12 | if(df.find(st) != -1){ | ^~ a.cc:13:21: error: 'str' was not declared in this scope; did you mean 'st'? 13 | S.erase(str.begin(),str.begin()+5); | ^~~ | st a.cc:14:29: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 14 | }else if(df.find(lg != -1)){ | ~~ ^~ ~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} 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: a.cc:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 14 | }else if(df.find(lg != -1)){ | ^ 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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 14 | }else if(df.find(lg != -1)){ | ^ 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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 14 | }else if(df.find(lg != -1)){ | ^ /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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 14 | }else if(df.find(lg != -1)){ | ^ 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:14:33: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 14 | }else if(df.find(lg != -1)){ | ^ 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 alloc
s522164664
p03854
C++
#include <bits/stdc++.h> using namespace std; string divide[]={"dream","dreamer","erase","eraser"}; int main(){//切れるタイミングを確定させるために反転しておく string s;cin << s; reverse(s.begin(),s.end());//逆順にする for(int i=0;i<divede.size();i++) reverse(divide.at(i).begin(),divide.at(i).end()); bool can=true; for(int i=0;i<s.size();){//iは切れたら更新 bool can2=flase;//4つのうちどれかで切れたらtrue for(int j=0;j<4;j++){//divideを一つずつ試す string d=divide[j]; if(s.substr(i,d.size())==d){//分割できればcan2を更新 can2=true; i+=d.size(); } }//どれでも切れなかったら if(!can2){ can=false; break; } }//canをfalseにすることなく生き残れたら if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:5:18: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 5 | string s;cin << s; | ~~~ ^~ ~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} 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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:5:14: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 5 | string s;cin << s; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, 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: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ 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:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | string s;cin << s; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:5:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ost
s964182446
p03854
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int n; while(n = s.size()) { if (s.end(5) == "erase" || s.end(5) == "dream") s = s.substr(0, l - 5); else if (s.end(6) == "eraser") s = s.substr(0, l - 6); else if (s.end(7) == "dreamer") s = s.subdtr(0, l - 7); else cout << "NO" << endl; } cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:11:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)' 11 | if (s.end(5) == "erase" || s.end(5) == "dream") s = s.substr(0, l - 5); | ~~~~~^~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]' 978 | end() _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 987 | end() const _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate expects 0 arguments, 1 provided a.cc:11:37: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)' 11 | if (s.end(5) == "erase" || s.end(5) == "dream") s = s.substr(0, l - 5); | ~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]' 978 | end() _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 987 | end() const _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate expects 0 arguments, 1 provided a.cc:11:69: error: 'l' was not declared in this scope 11 | if (s.end(5) == "erase" || s.end(5) == "dream") s = s.substr(0, l - 5); | ^ a.cc:12:19: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)' 12 | else if (s.end(6) == "eraser") s = s.substr(0, l - 6); | ~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]' 978 | end() _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 987 | end() const _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate expects 0 arguments, 1 provided a.cc:12:52: error: 'l' was not declared in this scope 12 | else if (s.end(6) == "eraser") s = s.substr(0, l - 6); | ^ a.cc:13:19: error: no matching function for call to 'std::__cxx11::basic_string<char>::end(int)' 13 | else if (s.end(7) == "dreamer") s = s.subdtr(0, l - 7); | ~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]' 978 | end() _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:978:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::end() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 987 | end() const _GLIBCXX_NOEXCEPT | ^~~ /usr/include/c++/14/bits/basic_string.h:987:7: note: candidate expects 0 arguments, 1 provided a.cc:13:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subdtr'; did you mean 'substr'? 13 | else if (s.end(7) == "dreamer") s = s.subdtr(0, l - 7); | ^~~~~~ | substr a.cc:13:53: error: 'l' was not declared in this scope 13 | else if (s.end(7) == "dreamer") s = s.subdtr(0, l - 7); | ^
s889583740
p03854
C++
s = input()[::-1] while True: if s[:5] == "maerd": s = s[5:] elif s[:7] == "remaerd": s - s[7:] elif s[:5] == "esare": s = s[5:] elif s[:6] == "resare": s - s[6:] else: break if s == "": print("YES") else: print("NO")
a.cc:1:1: error: 's' does not name a type 1 | s = input()[::-1] | ^
s792349559
p03854
C++
#include<iostream> #include<string> #include<vector> using namespace std; int main() { string s; cin >> s; reverse(s.begin(),s.end()); string sa[4]={"maerd","remaerd","esare","resare"}; while(s.empty() == false) { int ssize = s.size(); for(int as = 0; as<4;++as) { int flag = 1; for(int i = 0; i<sa[as].size();++i) { if(sa[as][i] != s[i]) { flag=0; break; } } if(flag == 1) { for(int i = 0; i<sa[as].size();++i) { s.erase(s.begin()); } } } if(ssize == s.size()) { break; } } if(s.empty() == true) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(),s.end()); | ^~~~~~~
s568174640
p03854
C++
#include <iostream> #include <string> #include <vector> int main(){ std::string texts[] = {"dream", "dreamer", "erase", "eraser"}; for(int i = 0; i < 4; i++){ std::reverse(texts[i].begin(), texts[i].end()); } std::string str; std::cin >> str; std::reverse(str.begin(), str.end()); int answer = true; int w = 0; while(w < str.size()){ answer = false; for(int i = 0; i < 4; i++){ if(texts[i] == str.substr(w, texts[i].size())){ answer = true; w += texts[i].size(); break; } } if(!answer) break; } if(answer){ std::cout << "YES"; }else{ std::cout << "NO"; } }
a.cc: In function 'int main()': a.cc:8:14: error: 'reverse' is not a member of 'std' 8 | std::reverse(texts[i].begin(), texts[i].end()); | ^~~~~~~ a.cc:12:10: error: 'reverse' is not a member of 'std' 12 | std::reverse(str.begin(), str.end()); | ^~~~~~~
s532955147
p03854
C++
#include <iostream> #include <string> int main(){ std::string texts[] = {"dream", "dreamer", "erase", "eraser"}; for(int i = 0; i < 4; i++){ std::reverse(texts[i].begin(), texts[i].end()); } std::string str; std::cin >> str; std::reverse(str.begin(), str.end()); int answer = true; int w = 0; while(w < str.size()){ answer = false; for(int i = 0; i < 4; i++){ if(texts[i] == str.substr(w, texts[i].size())){ answer = true; w += texts[i].size(); break; } } if(!answer) break; } if(answer){ std::cout << "YES"; }else{ std::cout << "NO"; } }
a.cc: In function 'int main()': a.cc:7:14: error: 'reverse' is not a member of 'std' 7 | std::reverse(texts[i].begin(), texts[i].end()); | ^~~~~~~ a.cc:11:10: error: 'reverse' is not a member of 'std' 11 | std::reverse(str.begin(), str.end()); | ^~~~~~~
s746303965
p03854
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ vector<string> devide = {"dream","dreamer","erase","eraser"}; string S; cin >> S; reverse(S.begin(),S.end()); for(int i = 0;i < 4;i++) reverse(devide.at(i).begin(),devide.at(i).end()); bool can = 1; for(int i = 0;i < S.size();){ bool can2 = 0; for(int j = 0;j < 4;j++){ string d = devide(j); if(S.substr(i,d.size()) == d){ can2 = 1; i++; } if(!can2){ can = 0; break; } } } if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:19:30: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 19 | string d = devide(j); | ~~~~~~^~~
s174766404
p03854
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ vector<string> devide = {"dream","dreamer","erase","eraser"}; string S; cin >> S; reverse(S.begin(),S.end()); for(int i = 0;i < 4;i++) reverse(devide.at(i).begin(),devide.at(i).end()); bool can = 1; for(int i = 0;i < S.size();){ bool can2 = 0; for(int j = 0;j < 4;j++){ string d = devide(j); if(S.substr(i,d.size()) == d){ can2 = 1; i++; } if(!can2){ can = 0; break; } } } if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'reverse' was not declared in this scope 11 | reverse(S.begin(),S.end()); | ^~~~~~~ a.cc:18:30: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 18 | string d = devide(j); | ~~~~~~^~~
s451927454
p03854
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); string v[4] = {"dream", "dreamer", "erase", "eraser"}; for (int i = 0; i < 4; i++) { reverse(v[i].begin(), v[i].end()); } bool f1 = false; int i = 0; while (true) { if (i >= s.size() || f1) { break; } bool f3 = true; for (int j = 0; j < 4; j++) { bool f2 = true; for (int k = 0; k < v[j].size(); k++) { if (v[j][k] != s[i + k]) { f2 = false; } } if (f2) { i += v[j].size(); f3 = false; } } if (f3) { f1 = true; } } if (f1) { cout << "NO" << endl; } else { cout << "YES" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'reverse' was not declared in this scope 8 | reverse(s.begin(), s.end()); | ^~~~~~~
s626340649
p03854
C++
eraseeraseeraseeraseerase
a.cc:1:1: error: 'eraseeraseeraseeraseerase' does not name a type 1 | eraseeraseeraseeraseerase | ^~~~~~~~~~~~~~~~~~~~~~~~~
s144589441
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;i++) 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;} return 0; }
a.cc: In function 'int main()': a.cc:12:31: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::__cxx11::basic_string<char>::iterator)' 12 | for(int i=0;i<4;i++) reverse(divide[i].begin,divide[i].end()); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'void std::reverse(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >]' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s651487056
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;i++) 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;} return 0; }
a.cc: In function 'int main()': a.cc:12:31: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 12 | for(int i=0;i<4;i++) reverse(divide[i].begin,divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:12:31: note: couldn't deduce template parameter '_BIter' 12 | for(int i=0;i<4;i++) reverse(divide[i].begin,divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s443059341
p03854
C++
#include <iostream> #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();) { bool can2 = false; for (int j = 0; j < 4; j++) { if (s.substr(i, divide[j].size()) == divide[j]) { can2 = true; i += divide[j].size(); } } if (!can2) { can = false; break; } } if (can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: expected initializer before 'true' 14 | bool can true; | ^~~~ a.cc:24:25: error: 'can' was not declared in this scope; did you mean 'can2'? 24 | can = false; | ^~~ | can2 a.cc:28:13: error: 'can' was not declared in this scope; did you mean 'scanf'? 28 | if (can) cout << "YES" << endl; | ^~~ | scanf
s269197677
p03854
C++
#include <bits/stdc++.h> using namespace std; int strMatch(string str1,string str2,int pos){ int res=-1; bool flag=true; int s1=str1.size();int s2=str2.size(); if (pos+s2>=s1){ flag=false; }else{ for(int i=0,i<s2;i++){ if(str1[pos+i] != str2[i]){ flag=false; } } if(flag){ res=pos+s2-1; } } return res; } bool enableT(string s1){ s int main(){ string S; cin >> S; }
a.cc: In function 'int strMatch(std::string, std::string, int)': a.cc:11:18: error: expected ';' before '<' token 11 | for(int i=0,i<s2;i++){ | ^ | ; a.cc:11:18: error: expected primary-expression before '<' token a.cc: In function 'bool enableT(std::string)': a.cc:23:5: error: 's' was not declared in this scope; did you mean 's1'? 23 | s | ^ | s1 a.cc:32:4: error: expected '}' at end of input 32 | } | ^ a.cc:22:26: note: to match this '{' 22 | bool enableT(string s1){ | ^ a.cc:32:4: warning: no return statement in function returning non-void [-Wreturn-type] 32 | } | ^
s251063632
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;++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){ if(s.substr(i, divide[j].size()) == divide[j]){ can2=true; i+=divide[j].size(); break; } } if(!can2){ can=false: break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:26:16: error: expected ';' before ':' token 26 | can=false: | ^ | ;
s944412280
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;++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){ if(s.substr(i, divide[j].size()) == divide[j]){ can2=true; i+=divide[j].size(); break; } } if(!can2){ can=false: break; } } if(can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc:8:1: error: expected ',' or ';' before 'int' 8 | int main() { | ^~~
s785814129
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; ++i) reverse(divide[i].begin(), divide[i].end()); // 端から切っていく bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; // 4 個の文字列たちどれかで divide できるか 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:24:22: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'Size'; did you mean 'size'? 24 | i += d.Size(); | ^~~~ | size
s973458982
p03854
C++
//file_name:ABC49_C.cpp #include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define limit(x,l,r) max(l,min(x,r)) #define lims(x,l,r) (x = max(l,min(x,r))) #define isin(x,l,r) ((l) <= (x) && (x) < (r)) #define pb push_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll #define uni(x) x.erase(unique(rng(x)),x.end()) #define snuke srand((unsigned)clock()+(unsigned)time(NULL)); #define show(x) cout<<#x<<" = "<<x<<endl; #define PQ(T) priority_queue<T,v(T),greater<T> > #define bn(x) ((1<<x)-1) #define dup(x,y) (((x)+(y)-1)/(y)) #define newline puts("") #define v(T) vector<T> #define vv(T) v(v(T)) using namespace std; typedef long long int ll; typedef unsigned uint; typedef unsigned long long ull; typedef pair<int,int> P; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<P> vp; inline int in() { int x; scanf("%d",&x); return x;} template<typename T>inline istream& operator>>(istream&i,v(T)&v) {rep(j,sz(v))i>>v[j];return i;} template<typename T>string join(const v(T)&v) {stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);} template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v) {if(sz(v))o<<join(v);return o;} template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v) {return i>>v.fi>>v.se;} template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v) {return o<<v.fi<<","<<v.se;} template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;} const double eps = 1e-10; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define dame { puts("-1"); return 0;} #define yn {puts("Yes");}else{puts("No");} const int MX = 200005; // int scan /* int x; scanf("%d",&x); int y; scanf("%d",&y); int z; scanf("%d",&z); // matrix scan /* ll a[n] = {}; rep(i,n){ scanf("%lld",&a[i]); } */ // string scan /* string s; cin >> s; */ int main() { string s; cin >> s; int i = 0; while(true){ if(s[i]!='d'||s[i]!='e'||s.size()-i<5){ puts("NO"); return 0; } if(s[i]=='d'){ if(s[i+1]!='r'||s[i+2]!='e'||s[i+3]!='a'||s[i+4]!='m'){ puts("NO"); return 0; } if(i+5==s.size())break; if(s[i+5]=='d'){ i += 5; continue; }else if(s[i+5]=='e'&&s.size()>i+6){ if(s[i+6]=='r'){ if(s.size()==i+7)break; if(s[i+7]=='d'||s[i+7]=='e'){ i += 7; continue; } if(s[i+7]=='a'){ i += 5; continue; } puts("NO"); return 0; } } } if(s[i]=='e'){ if(s[i+1]!='r'||s[i+2]!='a'||s[i+3]=='s'||s[i+4]!='e'){ puts("NO"); return 0; } if(i+5==s.size())break; if(s[i+5]=='d'){ i += 5; continue; }else if(s[i+5]=='r'{ if(s.size()==i+5)break; i += 5; continue; } } } puts("YES"); return 0; }
a.cc: In function 'int main()': a.cc:122:33: error: expected ')' before '{' token 122 | }else if(s[i+5]=='r'{ | ~ ^ | ) a.cc:127:9: error: expected primary-expression before '}' token 127 | } | ^
s071952417
p03854
C++
n = input() t_list = ['dream', 'dreamer', 'erase', 'eraser'] i = 0 while len(n) != 0: for t in t_list: if n[-len(t):] == t: n = n[:-len(t)] break if not n: print('YES') else: print('NO')
a.cc:2:11: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 2 | t_list = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~ a.cc:2:20: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 2 | t_list = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~~~ a.cc:2:31: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 2 | t_list = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~ a.cc:2:40: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 2 | t_list = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~~ a.cc:10:11: warning: multi-character character constant [-Wmultichar] 10 | print('YES') | ^~~~~ a.cc:12:11: warning: multi-character character constant [-Wmultichar] 12 | print('NO') | ^~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = input() | ^
s087399425
p03854
C++
#include<iostream> #include<cstring> using namespace std; int main(){ string s; cin>>s; while(s!=""){ if(s.substr(0,5)=="dream"||s.substr(0,7)=="dreamer"||s.substr(0,5)=="erase"||s.substr(0,6)=="eraser"){ if(s.substr(0,6)=="eraser"){ s.erase(0,6); continue; if(s.substr(0,5)=="erase"){ s.erase(0,5); continue; } if(s.substr(0,7)=="dreamer"){ if(s.substr(7,1)=="a") s.erase(0,5); else s.erase(0,7); continue; } if(s.substr(0,5)=="dream"){ s.erase(0,5); continue; } } else{ cout<<"NO"; return 0; } } cout<<"YES"; return 0; }
a.cc: In function 'int main()': a.cc:35:2: error: expected '}' at end of input 35 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s308120853
p03854
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String devider[] = {"maerd","remaerd","esare","resare"}; String str = new StringBuffer(sc.nextLine()).reverse().toString(); boolean flag1 = true; for(int i=0;i<str.length();){ boolean flag2 = false; for(int j=0;j<4;j++){ String d = devider[j]; if(str.substring(i,i+d.length())==d){ flag2 = true; i += d.length(); } } if(!flag2){ flag1 = false; break; } } flag1 ? System.out.println("YES") : System.out.println("NO"); } }
Main.java:23: error: not a statement flag1 ? System.out.println("YES") : System.out.println("NO"); ^ 1 error
s757011817
p03854
C++
include <iostream> #include <string> #include <algorithm> using namespace std; const int NUM = 4; string divide[NUM] = { "dream", "dreamer", "erase", "eraser" }; int main() { string str; cin >> str; reverse( str.begin(), str.end() ); for ( int i = 0; i < NUM; ++i ) { reverse( divide[i].begin(), divide[i].end() ); } bool can1 = true; for ( size_t i = 0; i < str.size(); ) { bool can2 = false; for ( int j = 0; j < NUM; ++j ) { string d = divide[j]; if ( str.substr( i, d.size() ) == d ) { can2 = true; i += d.size(); break; } } if ( !can2 ) { can1 = false; break; } } cout << ( can1 ? "YES" : "NO" ) << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type 198 | _GLIBCXX14_CONSTEXPR std::size_t |
s381279167
p03854
C++
#include<iostream> using namespace std; int main() { string words[4] = {"maerd", "remaerd", "resare", "esare"}; string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0; i < s.size(); ) { for (int j = 0; j < 4; ++j) { if (s.substr(i, words[j].size()) == words[j]) { //substr : sのi番目からwords[j].size()個を取り出す i += words[j].size(); break; } if (j == 3) { cout << "NO" << endl; return 0; } } } cout << "YES" << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'reverse' was not declared in this scope 6 | reverse(s.begin(), s.end()); | ^~~~~~~
s736583373
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 (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; return 0; } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:10:3: error: 'reverse' was not declared in this scope 10 | reverse(S.begin(), S.end()); | ^~~~~~~
s381069205
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 (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; return 0; } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:10:3: error: 'reverse' was not declared in this scope 10 | reverse(S.begin(), S.end()); | ^~~~~~~
s184200738
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 (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; return 0; } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:10:3: error: 'reverse' was not declared in this scope 10 | reverse(S.begin(), S.end()); | ^~~~~~~
s576775475
p03854
C++
#include<iostream> #include<string> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); while (1) { if (s.find("ecare") == 0 || s.find("maerd") == 0) { s.erase(0, 5); } else if (s.find("resare") == 0) { s.erase(0, 6); } else if (s.find("remaerd") == 0) { s.erase(0, 7); } else { cout << "NO" << endl; return 0; } if (s == "") { cout << "YES" << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:8:9: error: 'reverse' was not declared in this scope 8 | reverse(s.begin(), s.end()); | ^~~~~~~
s309881323
p03854
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0; i < 4; i++) { reverse(divide[i].begin(), divide[i].end()); } bool flag = true; for (int i = 0; i < s.length();) { bool can = false; for (int j = 0; j < 4; j++) { if (s.substr(i, divide[j].length()) == divide[j]){ can = true; i += divide[j].length(); } } if (!can) { flag = false; break; } } if (flag) cout << "YES" << endl; else cout << "NO" << endl; } #include <bits/stdc++.h> using namespace std; typedef long long ll; string divide[4] = {"dream", "dreamer", "erase", "eraser"}; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; reverse(s.begin(), s.end()); for (int i = 0; i < 4; i++) { reverse(divide[i].begin(), divide[i].end()); } bool flag = true; for (int i = 0; i < s.length();) { bool can = false; for (int j = 0; j < 4; j++) { if (s.substr(i, divide[j].length()) == divide[j]){ can = true; i += divide[j].length(); } } if (!can) { flag = false; break; } } if (flag) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc:47:8: error: redefinition of 'std::string divide [4]' 47 | string divide[4] = {"dream", "dreamer", "erase", "eraser"}; | ^~~~~~ a.cc:7:8: note: 'std::string divide [4]' previously declared here 7 | string divide[4] = {"dream", "dreamer", "erase", "eraser"}; | ^~~~~~ a.cc:49:5: error: redefinition of 'int main()' 49 | int main() { | ^~~~ a.cc:9:5: note: 'int main()' previously defined here 9 | int main() { | ^~~~
s286861409
p03854
C++
s=input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","") if s: print("NO") else: print("YES")
a.cc:1:1: error: 's' does not name a type 1 | s=input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","") | ^
s230276004
p03854
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); bool flag; while (true) { if (s.compare(0, 7, "remaerd", 0, 7) == 0)s.erase(0, 7); else if (s.compare(0, 6, "resare", 0, 6) == 0)s.erase(0, 6); else if (s.compare(0, 5, "maerd", 0, 5) == 0)s.erase(0, 5); else if (s.compare(0, 5, "esare", 0, 5) == 0)s.erase(0, 5); else if (s.empty()) { flag = true; break; } else { flag = false; break; } } puts(flag ? "YES" : "NO"); }
a.cc: In function 'int main()': a.cc:7:9: error: 'reverse' was not declared in this scope 7 | reverse(s.begin(), s.end()); | ^~~~~~~
s449083952
p03854
C++
#include <iostream> #include <string> using namespace std; #define REVE(x) reverse((x).begin(),(x).end()) int main() { string s; cin >> s; REVE(s); bool flag; while (true) { if (s.compare(0, 7, "remaerd", 0, 7) == 0)s.erase(0, 7); else if (s.compare(0, 6, "resare", 0, 6) == 0)s.erase(0, 6); else if (s.compare(0, 5, "maerd", 0, 5) == 0)s.erase(0, 5); else if (s.compare(0, 5, "esare", 0, 5) == 0)s.erase(0, 5); else if (s.empty()) { flag = true; break; } else { flag = false; break; } } puts(flag ? "YES" : "NO"); }
a.cc: In function 'int main()': a.cc:4:17: error: 'reverse' was not declared in this scope 4 | #define REVE(x) reverse((x).begin(),(x).end()) | ^~~~~~~ a.cc:8:9: note: in expansion of macro 'REVE' 8 | REVE(s); | ^~~~
s522629834
p03854
C++
#include<iostream> #include<string> #include<stack> #include<map> #include<utility> #include<vector> #include<cmath> using namespace std; int main(){ string S,temp; typedef pair<string, int> P; vector <P> arry (4); arry[0].first="dreamer"; arry[0].second=arry[0].first.size(); arry[1].first="dream"; arry[1].second=arry[1].first.size(); arry[2].first="eraser"; arry[2].second=arry[2].first.size(); arry[3].first="erase"; arry[3].second=arry[3].first.size(); //stack<string> temp; cin >> S; int num=0,ss; bool flag =0; reverse(S.begin(),S.end()); for(int i=0; i<4; i++) reverse(arry[i].first.begin(),arry[i].first.end()); while(temp !=S ){ for(int i=0; i<4; i++){ flag=0; if(arry[i].first == S.substr(num,arry[i].second+num) && S.size() >= temp.size()+arry[i].second){ temp+=arry[i].first; //cout << temp <<endl; num += arry[i].second; //cout <<S.substr(num,arry[i].second=arry[i].first.size()) <<endl; flag=1; break; } // cout << i <<" " <<temp <<" " << temp+arry[i].first<< " " << S.substr(num,arry[i].second+num) << " " <<num <<" " <<arry[i].second+num <<" "<<S.size()<<" " << temp.size()+arry[i].second<<endl; } if(flag==0) break; // cout <<temp <<" "<<S <<endl; } if(S==temp)cout <<"YES" <<endl; else cout << "NO" <<endl; }
a.cc: In function 'int main()': a.cc:31:9: error: 'reverse' was not declared in this scope 31 | reverse(S.begin(),S.end()); | ^~~~~~~
s376015687
p03854
C++
s=input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","") if s: print("NO") else: print("YES")
a.cc:1:1: error: 's' does not name a type 1 | s=input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","") | ^
s414754051
p03854
C++
import java.util.*; class Main { static String[] strs = { "dream", "dreamer", "erase", "eraser" }; public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); while (true) { boolean endsWithStr = false; for (String str: strs) { if (S.endsWith(str)) { endsWithStr = true; S = S.substring(0, S.length() - str.length()); break; } } if (!endsWithStr) { System.out.println("NO"); break; } if (S.length() <= 0) { System.out.println("YES"); break; } } } }
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:4:12: error: 'String' does not name a type 4 | static String[] strs = { | ^~~~~~ a.cc:11:11: error: expected ':' before 'static' 11 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:11:29: error: 'String' has not been declared 11 | public static void main(String[] args) { | ^~~~~~ a.cc:11:38: error: expected ',' or '...' before 'args' 11 | public static void main(String[] args) { | ^~~~ a.cc:34:2: error: expected ';' after class definition 34 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:12:9: error: 'Scanner' was not declared in this scope 12 | Scanner sc = new Scanner(System.in); | ^~~~~~~ a.cc:13:9: error: 'String' was not declared in this scope 13 | String S = sc.next(); | ^~~~~~ a.cc:16:13: error: 'boolean' was not declared in this scope; did you mean 'bool'? 16 | boolean endsWithStr = false; | ^~~~~~~ | bool a.cc:17:25: error: expected ';' before 'str' 17 | for (String str: strs) { | ^~~ a.cc:24:13: error: expected primary-expression before 'if' 24 | if (!endsWithStr) { | ^~ a.cc:24:13: error: expected ';' before 'if' a.cc:24:13: error: expected primary-expression before 'if' a.cc:24:13: error: expected ')' before 'if' a.cc:17:17: note: to match this '(' 17 | for (String str: strs) { | ^ a.cc:24:18: error: 'endsWithStr' was not declared in this scope 24 | if (!endsWithStr) { | ^~~~~~~~~~~ a.cc:25:17: error: 'System' was not declared in this scope 25 | System.out.println("NO"); | ^~~~~~ a.cc:28:17: error: 'S' was not declared in this scope 28 | if (S.length() <= 0) { | ^ a.cc:29:17: error: 'System' was not declared in this scope 29 | System.out.println("YES"); | ^~~~~~
s065437989
p03854
C++
A = ['dream', 'dreamer', 'erase', 'eraser'] for i in range(len(A)): A[i] = A[i][::-1] s = input()[::-1] i = 0 while True: f = True for a in A: if len(a) > len(s) - i: continue if s[i:i+len(a)] == a: i += len(a) f = False break else: if i == len(s): print('YES') exit() if f == True: print('NO') exit() print('YES')
a.cc:1:6: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 1 | A = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~ a.cc:1:15: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 1 | A = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~~~ a.cc:1:26: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 1 | A = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~ a.cc:1:35: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 1 | A = ['dream', 'dreamer', 'erase', 'eraser'] | ^~~~~~~~ a.cc:19:19: warning: multi-character character constant [-Wmultichar] 19 | print('YES') | ^~~~~ a.cc:22:19: warning: multi-character character constant [-Wmultichar] 22 | print('NO') | ^~~~ a.cc:26:7: warning: multi-character character constant [-Wmultichar] 26 | print('YES') | ^~~~~ a.cc:1:1: error: 'A' does not name a type 1 | A = ['dream', 'dreamer', 'erase', 'eraser'] | ^
s813550922
p03854
C++
S=str(input()) for i in range(20000): if S[-7:]=="dreamer": S=S[:-7] if S[-6:]=="eraser": S=S[:-6] if S[-5:]=="dream" or S[-5:]=="erase": S=S[:-5] if S[-7:]!="dreamer" and S[-6:]!="eraser" and S[-5:]!="dream" and S[-5:]!="erase": break if len(S)==0: print("YES") else: print("NO")
a.cc:1:1: error: 'S' does not name a type 1 | S=str(input()) | ^
s742581427
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 = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; // 4 個の文字列たちどれかで divide できるか for (int j = 0; j < 4; ++j) { string d = divide[j]; if (S.substr(i, d.size()) == d) { // d で divide できるか can2 = true; i += d.size(); // divide できたら i を進める } } if (!can2) { // divide できなかったら can = false; break; } } if (can) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:13:12: error: expected unqualified-id before '=' token 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ^ a.cc:13:11: error: expected ';' before '=' token 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ^~ | ; a.cc:13:12: error: expected primary-expression before '=' token 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ^ a.cc:13:17: error: 'i' was not declared in this scope 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ^ a.cc:13:22: error: expected ')' before ';' token 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ~ ^ | ) a.cc:13:26: error: 'i' was not declared in this scope 13 | for (int = 0; i < 4; ++i) reverse(divide[i].begin(), divide[i].end()); | ^
s273436464
p03854
Java
import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // programming String s = getInputString(sc); StringBuilder temp = new StringBuilder(s); boolean isFound = false; String[] words = {"dream","dreamer","erase","eraser"}; int i = 0; l1: while (true) { i++ if (i % 1000 == 0) { System.gc(); } for (String w : words) { if (temp.toString().endsWith(w)) { temp.delete(temp.length() - w.length(), temp.length()); if (temp.length() == 0) { isFound = true; break l1; } continue l1; } } break; } if (isFound) { output("YES"); } else { output("NO"); } } public static String getInputString(Scanner sc) { return sc.next(); } public static int getInputInteger(Scanner sc) { return Integer.parseInt(sc.next()); } public static void output(String... params) { boolean isInit = true; String str = ""; for (String s : params) { if (!isInit) { str += " "; } str += s; isInit = false; } System.out.println(str); } public static int[] toIntegerList(String[] ss) { return Stream.of(ss).mapToInt(Integer::parseInt).toArray(); } public static String[] toList(String s) { String[] ret = s.split(""); return ret; } public static int sum(int[] vals) { int sum = 0; for (int val : vals) { sum += val; } return sum; } public static int[] sort(int[] vals, boolean isAsc) { Arrays.sort(vals); if (isAsc) { return vals; } int[] ret = new int[vals.length]; for (int i = 0; i < vals.length; i++) { ret[vals.length - i - 1] = vals[i]; } return ret; } }
Main.java:15: error: ';' expected i++ ^ 1 error
s480472441
p03854
Java
import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // programming String s = getInputString(sc); StringBuilder temp = new StringBuilder(s); boolean isFound = false; String[] words = {"dream","dreamer","erase","eraser"}; if (temp.length() == 0) { output("NO"); return; } l1: while (true) { for (String w : words) { if (temp.ToString().endsWith(w)) { temp = temp.delete(temp.ToString().length() - w.length(), temp.ToString().length()); if (temp.ToString().length() == 0) { isFound = true; break l1; } continue l1; } } break; } if (isFound) { output("YES"); } else { output("NO"); } } public static String getInputString(Scanner sc) { return sc.next(); } public static int getInputInteger(Scanner sc) { return Integer.parseInt(sc.next()); } public static void output(String... params) { boolean isInit = true; String str = ""; for (String s : params) { if (!isInit) { str += " "; } str += s; isInit = false; } System.out.println(str); } public static int[] toIntegerList(String[] ss) { return Stream.of(ss).mapToInt(Integer::parseInt).toArray(); } public static String[] toList(String s) { String[] ret = s.split(""); return ret; } public static int sum(int[] vals) { int sum = 0; for (int val : vals) { sum += val; } return sum; } public static int[] sort(int[] vals, boolean isAsc) { Arrays.sort(vals); if (isAsc) { return vals; } int[] ret = new int[vals.length]; for (int i = 0; i < vals.length; i++) { ret[vals.length - i - 1] = vals[i]; } return ret; } }
Main.java:19: error: cannot find symbol if (temp.ToString().endsWith(w)) { ^ symbol: method ToString() location: variable temp of type StringBuilder Main.java:20: error: cannot find symbol temp = temp.delete(temp.ToString().length() - w.length(), temp.ToString().length()); ^ symbol: method ToString() location: variable temp of type StringBuilder Main.java:20: error: cannot find symbol temp = temp.delete(temp.ToString().length() - w.length(), temp.ToString().length()); ^ symbol: method ToString() location: variable temp of type StringBuilder Main.java:21: error: cannot find symbol if (temp.ToString().length() == 0) { ^ symbol: method ToString() location: variable temp of type StringBuilder 4 errors
s014815734
p03854
C++
#include <iostream> #include <cstring> #include <array> using namespace std; string words[4] = {"dream", "dreamer", "erase", "eraser"}; int main() { string S; cin >> S; reverse(S.begin(), S.end()); for(int i =0; i< 4; i++) reverse(words[i].begin(), words[i].end()); while(1) { const string current = S; for(const auto w: words) { if (S.find(w) == 0) { S.erase(0, w.length()); } } if (S.empty()) { cout << "YES"; return 0; } else if(current == S) { cout << "NO"; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:12:3: error: 'reverse' was not declared in this scope 12 | reverse(S.begin(), S.end()); | ^~~~~~~
s474337429
p03854
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; string divide[4] = { "dream","dreamer","erase","eraser" }; int main() { string 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();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = divide[i]; 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:14:24: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 14 | reverse(divide[i].begin, divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:14:24: note: couldn't deduce template parameter '_BIter' 14 | reverse(divide[i].begin, divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s805243576
p03854
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; string devide[4] = { "dream","dreamer","erase","eraser" }; int main() { string 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();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = divide[i]; 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:14:25: error: 'divide' was not declared in this scope; did you mean 'devide'? 14 | reverse(divide[i].begin, divide[i].end); | ^~~~~~ | devide a.cc:22:36: error: 'divide' was not declared in this scope; did you mean 'devide'? 22 | string d = divide[i]; | ^~~~~~ | devide
s019804322
p03854
C++
#include<bits/stdc++.h> using namespace std; string divide[4] = { "dream","dreamer","erase","eraser" }; int main() { string 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();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = divide[i]; 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:12:24: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 12 | reverse(divide[i].begin, divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:12:24: note: couldn't deduce template parameter '_BIter' 12 | reverse(divide[i].begin, divide[i].end); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s900270895
p03854
C++
#include<bits/stdc++.h> using namespace std; string devide[4] = { "dream","dreamer","erase","eraser" }; int main() { string 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();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = divide[i]; 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:12:25: error: 'divide' was not declared in this scope; did you mean 'devide'? 12 | reverse(divide[i].begin, divide[i].end); | ^~~~~~ | devide a.cc:20:36: error: 'divide' was not declared in this scope; did you mean 'devide'? 20 | string d = divide[i]; | ^~~~~~ | devide
s464660153
p03854
C++
#include<bits/stdc++.h> using namespace std; string devide[4]={"dream","dreamer","erase","eraser"}; int main() { string S; reverse(S.begin(), S.end()); for (int i = 0; i < 4; i++) { reverse(d[i].begin, d[i].end); } bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = d[i]; 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:12:25: error: 'd' was not declared in this scope 12 | reverse(d[i].begin, d[i].end); | ^ a.cc:20:39: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string d = d[i]; | ^
s317875524
p03854
C++
#include<bits/stdc++.h> using namespace std; string devide[4]={"dream","dreamer","erase","eraser"} int main() { string S; reverse(S.begin(), S.end()); for (int i = 0; i < 4; i++) { reverse(d[i].begin, d[i].end); } bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; for (int j = 0; j < 4; j++) { string d = d[i]; 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:7:1: error: expected ',' or ';' before 'int' 7 | int main() { | ^~~
s348794539
p03854
C++
#include<bits/stdc++.h> using namespace std; int main(){ string S; cin>>S; reveres(S.begin(),S.end()); string P[4]={"dream","dreamer","erase","eraser"}; for(int i=0;i<4;i++){ reveres(S[i].begin(),S[i].end()); } for(int i=0;i<S.size();){ bool f=false; for(int j=0;j<4;j++){ if(S.compare(i,P[j].size(),p[j])==0){ i+=p[j].size(); f=true; break; } } if(!f){ cout<<"NO"<<endl; return 0; } } cout<<"YES"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'reveres' was not declared in this scope 6 | reveres(S.begin(),S.end()); | ^~~~~~~ a.cc:9:30: error: request for member 'begin' in 'S.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 9 | reveres(S[i].begin(),S[i].end()); | ^~~~~ a.cc:9:43: error: request for member 'end' in 'S.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 9 | reveres(S[i].begin(),S[i].end()); | ^~~ a.cc:14:52: error: 'p' was not declared in this scope 14 | if(S.compare(i,P[j].size(),p[j])==0){ | ^
s534854251
p03854
C++
#include<bits/stdc++.h> using namespace std; string s; string c[4] = {"maerd", "remaerd", "esare", "resare"}; int main(){ cin>>s; int i=0; int len=s.size(); reverse(s.begin(),s.end()); while(i<len){ bool flag=false; for(int j=0;j<4;j++){ string tmp=substr(i,c[j].size()); if(tmp==c[j]){ i+=c[j].size(); flag=true; } } if(!flag){ cout<<"NO"; return 0; } } cout<<"YES"; return 0; }
a.cc: In function 'int main()': a.cc:13:36: error: 'substr' was not declared in this scope; did you mean 'strstr'? 13 | string tmp=substr(i,c[j].size()); | ^~~~~~ | strstr
s339180097
p03854
C++
#include<bits/stdc++.h> using namespace std; int main(){ cout<<"YES"; else cout<<"NO"; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'else' without a previous 'if' 5 | else cout<<"NO"; | ^~~~
s147526504
p03854
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ if(s.size()%2==0) cout<<"YES"; else cout<<"NO"; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: 's' was not declared in this scope 6 | if(s.size()%2==0) cout<<"YES"; | ^
s770988942
p03854
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s; string s; cout<<"Frist"; return 0; }
a.cc: In function 'int main()': a.cc:5:16: error: conflicting declaration 'std::string s' 5 | string s; | ^ a.cc:4:13: note: previous declaration as 'int s' 4 | int s; | ^
s301584809
p03854
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; string a[4] = {"dream","dreamer","erase","eraser"}; int len = s.length(); reverse(s.begin(),s.end()); for(int i=0;i<4;i++){ reverse(a[i].begin(),a[i].end()); } for(int s=0;s<len;){ bool can = false; for(int i=0;i<4;i++){ if(s.substr(s,a[i].size())==a[i]){ i += a[i].size(); can = true; } } if(!can){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:30: error: request for member 'substr' in 's', which is of non-class type 'int' 22 | if(s.substr(s,a[i].size())==a[i]){ | ^~~~~~
s176021274
p03854
C++
#include <iostream> #include <string> #include <vector> using namespace std; string word[4] = {"dream", "dreamer", "erase", "eraser"}; string S; int main() { cin >> S; reverse(S.begin(), S.end()); for (int i = 0; i < 4; i++) { reverse(word[i].begin(), word[i].end()); } bool r; for (int i = 0; i < S.size();) { r = 0; for (int j = 0; j < 4; j++) { string d = word[j]; if (S.substr(i,d.size()) == d) { r = 1; i += d.size(); } } if (!r) { break; } } if (r) { cout << "YES" << endl; } else { cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:11:5: error: 'reverse' was not declared in this scope 11 | reverse(S.begin(), S.end()); | ^~~~~~~
s294918076
p03854
C++
#include <iostream> #include<string> using namespace std; //解説参考 int main() { string s; cin >> s; reverse(s.begin(), s.end()); while (s != "") { if (s.substr(0, 5) == "emerd") s = s.substr(5); else if (s.substr(0, 7) == "eremerd") s = s.substr(7); else if (s.substr(0, 5) == "esare") s = s.substr(5); else if (s.substr(0, 6) == "resare") s = s.substr(6); else break; } cout << ((s.size()) ? "NO" : "YES") << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(), s.end()); | ^~~~~~~
s834407044
p03854
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; while(S!=""){ if (s.substr(0,6)=="dreamer") S=s.substr(7); else if (s.substr(0,4)=="dream") S=s.substr(5); else if (s.substr(0,5)=="eraser") S=s.substr(6); else if (s.substr(0,4)=="erase") S=s.substr(5); else break; } if (S.size()) cout << "NO" << endl; else cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:10:13: error: 's' was not declared in this scope 10 | if (s.substr(0,6)=="dreamer") S=s.substr(7); | ^
s495989613
p03854
C++
#include<iostream> #include<functional> #include<algorithm> using namespace std; int main(){ string S; cin >> S; string words[4]={'dream','dreamer','erase','eraser'}; reverse(S.begin(),S.end()); for(int i=0; i<4; i++) reverse(words.begin(),words.end()); for(int i=0; i<S.size();){ bool can=false; for(int j=0; j<4; j++){ if(S.substr(i,words[j].size())==words[j]){ i+=words[j].size(); can=true; } } if(!can){ can=false; break; } } if(can) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc:10:26: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~ a.cc:10:34: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~~~ a.cc:10:44: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~ a.cc:10:52: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:10:26: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~ a.cc:10:34: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~~~ a.cc:10:44: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~ a.cc:10:52: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 10 | string words[4]={'dream','dreamer','erase','eraser'}; | ^~~~~~~~ a.cc:13:31: error: request for member 'begin' in 'words', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 13 | reverse(words.begin(),words.end()); | ^~~~~ a.cc:13:45: error: request for member 'end' in 'words', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} 13 | reverse(words.begin(),words.end()); | ^~~ a.cc:27:12: error: 'can' was not declared in this scope; did you mean 'scanf'? 27 | if(can) | ^~~ | scanf
s819116292
p03854
C
#include <stdio.h> #include <string.h> int main(){ char divide[4][8] = {"dream", "dreamer", "erase", "eraser"}; int dp[100010]; int len; int i, j; char S[100010]; scanf("%s", S); len = strlen(S); dp[0] = 1; for(i = 1; i < len; i++){ dp[i] = 0; } for(i = 0; i < len; ++i){ for(j = 0; j < 4; j++){ if(!strncmp(S+i, divide[j], strlen(divide[j]))){ dp[i + strlen(divide[j])] = d[i]; } } } if(dp[len]) printf("YES"); else printf("NO"); return 0; }
main.c: In function 'main': main.c:24:45: error: 'd' undeclared (first use in this function) 24 | dp[i + strlen(divide[j])] = d[i]; | ^ main.c:24:45: note: each undeclared identifier is reported only once for each function it appears in
s773975800
p03854
C++
#include <iostream> #include <string> using namespace std; int main() { string S, T; cin >> S; string much_ptrn[4] = {"dream", "dreamer", "erase", "eraser"}; reverse(S.begin(), S.end()); for (int i=0; i<4; i++) { reverse(much_ptrn[i].begin(), much_ptrn[i].end()); } bool can_solve = true; for (int i=0; i<S.size();) { bool is_much = false; for (int j=0; j<4; j++) { string pattern = much_ptrn[i]; if (S.substr(i, pattern.size()) == pattern) { is_much = true; i += pattern.size(); } } if (!is_much) { can_solve = false; break; } } if (can_solve) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'reverse' was not declared in this scope 11 | reverse(S.begin(), S.end()); | ^~~~~~~
s415958358
p03854
C
#include<stdio.h> #include<string.h> #include<stdlib.h> void rev(char *s){ int l=strlen(s),i; for(i = 0;i<l/2;i++){ char t=s[i]; s[i] = s[l - i -1]; s[l-1-i]=t; } int main(void){ int i, j, k; char s[100001]; char divide[4][8] = {"dream", "dreamer", "erase", "eraser"}; int len; scanf("%s",s); len = strlen(s); for(i = 0; i < 4; i++) rev(divide[i]); rev(s); for(i = 0; i < len;){ k = -1; for(j = 0; j < 4; j++){ if(!strncpy(s+i, divide[j], strlen(divide[j]))){ k += strlen(divide[j]); break; } } if(k == -1){ printf("NO"); return 0;; } i += k; } printf("YES"); return 0; }
main.c: In function 'rev': main.c:43:1: error: expected declaration or statement at end of input 43 | } | ^
s569154104
p03854
C++
#include<iostream> using namespace std; int main(){ string a,t,c[4]={"dream","erase","eraser","dreamer"}; int n=0,size; cin>>a; size=a.size(); a+="dre"; cout<<size<<endl; for(int i=0;i<size;i++){ t=a.substr(i,5); if(t==c[0]){ if(a[i+5]=='\0'||a[i+5]=='e'&&a[i+6]=='r'&&a[i+7]=='a'||a[i+5]=='d'){ i+=4; continue; } }else(t==c[1]){ i+=4; continue; } t=a.substr(i,6); if(t==c[2]){ i+=5; continue; } t=a.substr(i,7); if(t==c[3]){ i+=6; continue; } //------------------------------ cout<<"NO"; return 0; } cout<<"YES"; return 0; }
a.cc: In function 'int main()': a.cc:17:31: error: expected ';' before '{' token 17 | }else(t==c[1]){ | ^ | ; a.cc:17:24: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result] 17 | }else(t==c[1]){ | ~~^~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3755:5: note: declared here 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~
s590771317
p03854
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(int argc, char const *argv[]) { string s, t; cin >> s; reverse(s.begin(),s.end()); vector<string> tset = {"dream", "dreamer", "erase", "eraser"}; for (size_t i = 0; i < tset.size(); i++) reverse(tset[i].begin(), tset[i].end()); bool tf = true; while (s.size()>0 and tf) { bool check = false; for (size_t i = 0; i < tset.size(); i++) { if (tset[i]==s.substr(0, tset[i].size())) { check=true; s.erase(s.begin(), s.begin()+tset[i].size()); break; } } if (!check) tf = false; } if (tf) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:10:3: error: 'reverse' was not declared in this scope 10 | reverse(s.begin(),s.end()); | ^~~~~~~
s147675916
p03854
C++
#include<iostream> using namespace std; int main(){ string divide[4]={"dream","dreamer","erase","eraser"} string S; cin >> S; //後ろから解く代わりに全ての文字列を左右反転 reverse(S.begin(),S.end()); for(int i=0; i<4; i++) reverse(devide[i].begin(),devide[i].end()); //橋から切って行く bool can=true; for(int i=0; i<S.size();){ bool can2 = false ; //4個の文字列たちのどれでdevideできるのか for(int j=0; j<4; j++){ string d=divide[j] if(S.substr(i,d.size())==d){ //dでdivideできるか can2=true; i += d.size(); //divideできたらiをすすめる } } if(!can2){ //divide できなかったら can= false; break; } } if(can) cout <<"YES" <<endl; else cout<<"NO"<<endl; }
a.cc: In function 'int main()': a.cc:7:3: error: expected ',' or ';' before 'string' 7 | string S; | ^~~~~~ a.cc:8:10: error: 'S' was not declared in this scope 8 | cin >> S; | ^ a.cc:10:4: error: 'reverse' was not declared in this scope 10 | reverse(S.begin(),S.end()); | ^~~~~~~ a.cc:11:35: error: 'devide' was not declared in this scope; did you mean 'divide'? 11 | for(int i=0; i<4; i++) reverse(devide[i].begin(),devide[i].end()); | ^~~~~~ | divide a.cc:19:8: error: expected ',' or ';' before 'if' 19 | if(S.substr(i,d.size())==d){ //dでdivideできるか | ^~
s762463535
p03854
C++
#include<bits/stdc++.h> using namespace std; int main () { string S; cin >> S; reverse(S.begin(), S.end()); vector <string> judge = {maerd, remaerd, esare, resare}; bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; for (int j = 0; j < 4; j ++) { string juge = judge[j]; if (S.substr(i, juge.size()) == juge) { can2 = true; i += juge.size(); } } if (!can2) { can = false; break; } } if (can) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:7:28: error: 'maerd' was not declared in this scope 7 | vector <string> judge = {maerd, remaerd, esare, resare}; | ^~~~~ a.cc:7:35: error: 'remaerd' was not declared in this scope; did you mean 'read'? 7 | vector <string> judge = {maerd, remaerd, esare, resare}; | ^~~~~~~ | read a.cc:7:44: error: 'esare' was not declared in this scope; did you mean 'unshare'? 7 | vector <string> judge = {maerd, remaerd, esare, resare}; | ^~~~~ | unshare a.cc:7:51: error: 'resare' was not declared in this scope; did you mean 'rename'? 7 | vector <string> judge = {maerd, remaerd, esare, resare}; | ^~~~~~ | rename a.cc:7:57: error: could not convert '{<expression error>, <expression error>, <expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<std::__cxx11::basic_string<char> >' 7 | vector <string> judge = {maerd, remaerd, esare, resare}; | ^ | | | <brace-enclosed initializer list>
s321143955
p03854
C++
#include<bits/stdc++.h> using namespace std; int main () { string S; cin >> S; reverse(S.begin(), S.end()); vector<string>judge(4) = {maerd, remaerd, esare, resare}; bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; for (int j = 0; j < 4; j ++) { string juge = judge[j]; if (S.substr(i, juge.size()) == juge) { can2 = true; i += juge.size(); } } if (!can2) { can = false; break; } } if (can) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:7:26: error: expected ',' or ';' before '=' token 7 | vector<string>judge(4) = {maerd, remaerd, esare, resare}; | ^
s634896994
p03854
C++
#include<bits/stdc++.h> using namespace std; int main () { string S; cin >> S; reverse(S.begin(), S.end()); vector <string> judge(4) = {maerd, remaerd, esare, resare}; bool can = true; for (int i = 0; i < S.size();) { bool can2 = false; for (int j = 0; j < 4; j ++) { string juge = judge[j]; if (S.substr(i, juge.size()) == juge) { can2 = true; i += juge.size(); } } if (!can2) { can = false; break; } if (can) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:7:28: error: expected ',' or ';' before '=' token 7 | vector <string> judge(4) = {maerd, remaerd, esare, resare}; | ^ a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:3:13: note: to match this '{' 3 | int main () { | ^
s250576343
p03854
Java
public class Main { public static void main(String[] args) { String[] words = {"dream", "dreamer", "erase", "eraser"}; for (int i = 0; i < 4; i++) { words[i] = reverseString(words[i]); } BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); String S = null; try { S = bufferedReader.readLine(); } catch (IOException e) { e.printStackTrace(); } S = reverseString(S); String answer = "YES"; boolean isMatch = false; for (int i = 0; i < S.length(); i++) { isMatch = false; for (String word : words) { if (S.startsWith(word)) { isMatch = true; //S = S.substring(word.length()); i += word.length(); break; } } if (!isMatch) { answer = "NO"; break; } } System.out.format(answer); } private static String reverseString(String input) { StringBuilder builder = new StringBuilder(); builder.append(input); return builder.reverse().toString(); } }
Main.java:9: error: cannot find symbol BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:9: error: cannot find symbol BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:9: error: cannot find symbol BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:13: error: cannot find symbol } catch (IOException e) { ^ symbol: class IOException location: class Main 4 errors
s437406574
p03854
Java
import java.util.Scanner; public class ABC_049_C_Daydream { public static void main(String[] args) { String[] words = {"eraser", "dreamer", "erase", "dream"}; Scanner scanner = new Scanner(System.in); String S = scanner.next(); String answer = "YES"; while (S.length() > 0) { boolean isMatch = false; for (String word : words) { if (S.endsWith(word)) { isMatch = true; S = S.substring(0, S.lastIndexOf(word)); break; } } if (!isMatch) { answer = "NO"; break; } } System.out.format(answer); } }
Main.java:3: error: class ABC_049_C_Daydream is public, should be declared in a file named ABC_049_C_Daydream.java public class ABC_049_C_Daydream { ^ 1 error
s963731381
p03854
Java
import java.util.Scanner; public class ABC_049_C_Daydream { public static void main(String[] args) { String[] words = {"", "dream", "dreamer", "erase", "eraser"}; Scanner scanner = new Scanner(System.in); String S = scanner.next(); String answer = "NO"; loop: for (int a = 0; a < 5; a++) { for (int b = 0; b < 5; b++) { for (int c = 0; c < 5; c++) { for (int d = 0; d < 5; d++) { for (int e = 0; e < 5; e++) { String T = words[a] + words[b] + words[c] + words[d] + words[e]; if(S.equals(T)) { answer = "YES"; break loop; } } } } } } System.out.format(answer); } }
Main.java:3: error: class ABC_049_C_Daydream is public, should be declared in a file named ABC_049_C_Daydream.java public class ABC_049_C_Daydream { ^ 1 error
s018227717
p03854
C++
#院cぅで <stぢお。h> 院t マイン(ヴォイd){  院t あ=100;  pりんtf(”%d¥n”、あ);  列rん 0; }
a.cc:1:1: error: extended character   is not valid in an identifier 1 | #院cぅで <stぢお。h> | ^ a.cc:1:1: error: extended character 。 is not valid in an identifier a.cc:3:1: error: extended character   is not valid in an identifier 3 | 院t マイン(ヴォイd){ | ^ a.cc:4:1: error: extended character   is not valid in an identifier 4 |  院t あ=100; | ^ a.cc:4:1: error: extended character   is not valid in an identifier a.cc:5:1: error: extended character   is not valid in an identifier 5 |  pりんtf(”%d¥n”、あ); | ^ a.cc:5:1: error: extended character ” is not valid in an identifier a.cc:5:1: error: extended character ” is not valid in an identifier a.cc:5:1: error: extended character 、 is not valid in an identifier a.cc:6:1: error: extended character   is not valid in an identifier 6 |  列rん 0; | ^ a.cc:6:1: error: extended character   is not valid in an identifier a.cc:1:1: error: '\U0000ff03\U00009662c\U00003045\U00003067\U00003000\U0000ff1cst\U00003062\U0000304a\U00003002h\U0000ff1e' does not name a type 1 | #院cぅで <stぢお。h> | ^~~~~~~~~~~~~~~~~~~~~~~~
s289306533
p03854
C
#include <stdio.h> #include <string.h> void rev(char *s) { int l = strlen(s), i; for (i = 0; i<l / 2; i++) { char t = s[i]; s[i] = s[l - 1 - i]; s[l - 1 - i] = t; } } char T[4][8] = { "dream","dreamer","erase","eraser" }; int main() { int i , c=0, l; char s[100001]; for (i = 0; i<4; i++)rev(T[i]); scanf("%s",& s); l = strlen(s); rev(s); for (; c<l;) { int k = -1; for (i = 0; i<4; i++) { if (strncmp(s + c, T[i], strlen(T[i]))!==0) { k = strlen(T[i]); break; } } if (k<0) { puts("NO"); return 0; } c += k; } puts("YES"); return 0; }
main.c: In function 'main': main.c:22:65: error: expected expression before '=' token 22 | if (strncmp(s + c, T[i], strlen(T[i]))!==0) { | ^
s843003410
p03854
Java
import com.sun.tools.doclets.formats.html.SourceToHTMLConverter; import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner sc = new Scanner(System.in); String S = sc.next(); String[] str = S.split(""); int i = 0; boolean flag = false; while(i < str.length){ if(S.substring(i).indexOf("dream") == -1 && S.substring(i).indexOf("erase") == -1) { System.out.println("NO"); flag = true; break; }else if(S.substring(i, i + 5).equals("dream")){ try { if (str[i + 5].concat(str[i + 6]).equals("er")) { if(i + 7 < str.length){ if(str[i + 7].equals("a")){ i = i + 5; }else{ i = i + 7; } }else{ i = i + 5; } } else { i = i + 5; } }catch (ArrayIndexOutOfBoundsException e){ i = i + 5; } }else if(S.substring(i, i + 5).equals("erase")){ try { if (str[i + 5].equals("r")) { i = i + 6; } else { i = i + 5; } }catch(ArrayIndexOutOfBoundsException e){ i = i + 5; } } } if(!flag){ System.out.println("YES"); } } }
Main.java:1: error: package com.sun.tools.doclets.formats.html does not exist import com.sun.tools.doclets.formats.html.SourceToHTMLConverter; ^ 1 error
s220798563
p03854
C++
#include <bits/stdc++.h> using namespace std; char s[111111]; int m[111111]; string p[]={"dream", "dreamer", "erase", "eraser" }; bool f(int i){ if(m[i]==0){ for(string &t:p){ int flag=1; for(int j=0;j<t.size();j++){ if(s[i+j]!=t[j]){ flag=0; break; } } if(flag&&f(i+t.size()))return m[i]=1; } } return m[i]=-1; } int main(){ gets(s); m[strlen(s)]=1; cout<<(f(0)?"YES":"NO")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:26:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 26 | gets(s); | ^~~~ | getw
s022901011
p03854
C++
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<iostream> #include<algorithm> #include<queue> #include<time.h> using namespace std; char s[100008]={0}; int jd(int i) { if(s[i-4]=='d'&&s[i-3]=='r'&&s[i-2]=='e'&&s[i-1]=='a'&&s[i]=='m')return 1; else return 0; } int jdr(int i) { if(s[i-6]=='d'&&s[i-1]=='r'&&s[i-4]=='e'&&s[i-3]=='a'&&s[i-2]=='m'&&s[i-1]=='e'&&s[i]=='r')return 1; else return 0; } int je(int i) { if(s[i-4]=='e'&&s[i-3]=='r'&&s[i-2]=='a'&&s[i-1]=='s'&&s[i]=='e')return 1; else return 0; } int jer(int i) { if(s[i-5]=='e'&&s[i-4]=='r'&&s[i-3]=='a'&&s[i-2]=='s'&&s[i-1]=='e'&&s[i]=='r')return 1; else return 0; } int main() { int i,j,k,n,l; gets(s); l=strlen(s); for(i=l-1;i>=0;) { int f=0; if(i>=4&&jd(i)) { f=1; i=i-5; } else if(i>=6&&jdr(i)) { f=1; i=i-7; } else if(i>=5&&jer(i)) { f=1; i=i-6; } else if(i>=4&&je(i)) { f=1; i=i-5; } if(f==0||(i<4&&i>=0)) { printf("NO\n"); exit(0); } } printf("YES\n"); return 0; }
a.cc: In function 'int main()': a.cc:36:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 36 | gets(s); | ^~~~ | getw
s493903378
p03854
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; reverse(s.begin(),s.end()); vector< string>div(4){"maerd","remaerd","esare","eresare"}; bool isyes=true; for(int i=0;i<s.size();){ bool t=true; for(int j=0;j<4;j++){ if(div.at(j)==s.substr(i,div.at(j).size())){ t=false; i+=div.at(j).size(); } } if(!t){ isyes=false; break; } } if(isyes) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: expected ',' or ';' before '{' token 9 | vector< string>div(4){"maerd","remaerd","esare","eresare"}; | ^
s624118841
p03854
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; reverse(s.begin(),s.end()); vector< string>div(4)={"maerd","remaerd","esare","eresare"}; bool isyes=true; for(int i=0;i<s.size();){ bool t=true; for(int j=0;j<4;j++){ if(div.at(j)==s.substr(i,div.at(j).size())){ t=false; i+=div.at(j).size(); } if(!t){ isyes=false; break; } } if(isyes) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: expected ',' or ';' before '=' token 9 | vector< string>div(4)={"maerd","remaerd","esare","eresare"}; | ^ a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s868275307
p03854
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; reverse(s.begin(),s.end()); vector< string>div(4)={"maerd","remaerd","esare","eresare"}; bool isyes=true; for(int i=0;i<s.size();){ bool t=true; for(int j=0;j<4;j++){ if(div.at(j)==s.substr(i,div.at(j).size())){ t=false; i+=div.at(j).size(); } if(!t){ isyes=false; break; } } if(isyes) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: expected ',' or ';' before '=' token 9 | vector< string>div(4)={"maerd","remaerd","esare","eresare"}; | ^ a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s759498804
p03854
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; reverse(s.begin(),s.end()); vector< string>div(4)={"maerd","remaerd","esare","eresare"}; bool isyes=true; for(int i=0;i<s.size();){ bool t=true; for(int j=0;j<4;j++){ if(div.at(j)==s.substr(i,div.at(j).size())){ t=false; i+=div.at(j).size(); } if(!t){ isyes=false; break; } if(isyes) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: expected ',' or ';' before '=' token 9 | vector< string>div(4)={"maerd","remaerd","esare","eresare"}; | ^ a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:12:28: note: to match this '{' 12 | for(int i=0;i<s.size();){ | ^ a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s309817830
p03854
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); boolean divi = true; while(divi) { divi = false; if(s.endsWith("eraser")) { divi = true; s -= "eraser"; } if(s.endsWith("erase")) { divi = true; s -= "erase"; } if(s.endsWith("dreamer")) { divi = true; s -= "dreamer"; } if(s.endsWith("dream")) { divi = true; s -= "dream"; } } if(s.length() == 0) { System.out.println("YES"); } else { System.out.println("NO"); } } }
Main.java:12: error: bad operand types for binary operator '-' s -= "eraser"; ^ first type: String second type: String Main.java:16: error: bad operand types for binary operator '-' s -= "erase"; ^ first type: String second type: String Main.java:20: error: bad operand types for binary operator '-' s -= "dreamer"; ^ first type: String second type: String Main.java:24: error: bad operand types for binary operator '-' s -= "dream"; ^ first type: String second type: String 4 errors
s151139362
p03854
C++
string S; cin >> S; string devide[4]={ "maerd","remaerd","esare","resare" }; reverse(S.begin(), S.end()); int N = 0; int i = 0; for (int k = 0; k < 4; k++) { string d = devide[k]; if (devide[k] == S.substr(i, devide[k].size()) ){ i += d.size(); k = -1; } } if (i == S.size()) { cout<<"YES"<<endl; } else { cout << "NO" << endl; } return 0; }
a.cc:1:1: error: 'string' does not name a type 1 | string S; | ^~~~~~ a.cc:2:9: error: 'cin' does not name a type 2 | cin >> S; | ^~~ a.cc:4:9: error: 'string' does not name a type 4 | string devide[4]={ "maerd","remaerd","esare","resare" }; | ^~~~~~ a.cc:6:16: error: expected constructor, destructor, or type conversion before '(' token 6 | reverse(S.begin(), S.end()); | ^ a.cc:12:17: error: expected unqualified-id before 'for' 12 | for (int k = 0; k < 4; k++) { | ^~~ a.cc:12:33: error: 'k' does not name a type 12 | for (int k = 0; k < 4; k++) { | ^ a.cc:12:40: error: 'k' does not name a type 12 | for (int k = 0; k < 4; k++) { | ^ a.cc:22:17: error: expected unqualified-id before 'if' 22 | if (i == S.size()) { | ^~ a.cc:25:17: error: expected unqualified-id before 'else' 25 | else { | ^~~~ a.cc:32:9: error: expected unqualified-id before 'return' 32 | return 0; | ^~~~~~ a.cc:33:1: error: expected declaration before '}' token 33 | } | ^
s146526205
p03854
C++
#include <iostream> #include<string> using namespace std; int main() { string S; cin >> S; string devide[4]={ "maerd","remaerd","esare","resare" }; reverse(S.begin(), S.end()); int N = 0; int i = 0; for (int k = 0; k < 4; k++) { string d = devide[k]; if (devide[k] == S.substr(i, devide[k].size()) ){ i += d.size(); k = -1; } } if (i == S.size()) { cout<<"YES"<<endl; } else { cout << "NO" << endl; } 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()); | ^~~~~~~
s809863545
p03854
C++
#include <iostream> #include <string> 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();) { 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:11:5: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(), s.end()); | ^~~~~~~
s984875451
p03854
C++
#include <iostream> #include <string> 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();) { 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:11:5: error: 'reverse' was not declared in this scope 11 | reverse(s.begin(), s.end()); | ^~~~~~~
s743299159
p03854
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #define MAX 100000000 using namespace std; string di[4]={"dream","dreamer","erase", "eraser"}; int main (void) { string S; cin >> S; reverse(S.begin(), S.end()); for (int i=0; i<=3; i++){ reverse(di[i].begin(), di[i].end()); } bool can = true; for (int i=0; i<S.size();){ bool can2 =false; for (int j=0; j<=3; j++){ string d=di[j]; if (d==S.substr(i,d.size())){ can2 =true; i=i+d.size(); } } if (!can2){ can =false; break; } if (can) cout << "Yes"; else cout << "No;" }
a.cc: In function 'int main()': a.cc:33:21: error: expected ';' before '}' token 33 | else cout << "No;" | ^ | ; 34 | } | ~ a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:11:17: note: to match this '{' 11 | int main (void) { | ^
s064521846
p03854
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #define MAX 100000000 using namespace std; string di[4]={"dream","dreamer","erase", "eraser"}; int main (void) { string S; cin >> S; reverse(S.begin(), S.end()); for (int i=0; i<=3; i++){ reverse(di[i].begin(), di[i].end()); } bool can = true; for (int i=0; i<=S.size();){ bool can2 =false; for (int j=0; j<=3; j++){ string d=di[j]; if (d==S.substr(i,d.size())){ can2 =true; i=i+d.size(); } } if (!can2){ can =false; break; } if (can) cout << "Yes"; else cout << "No;" }
a.cc: In function 'int main()': a.cc:33:21: error: expected ';' before '}' token 33 | else cout << "No;" | ^ | ; 34 | } | ~ a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:11:17: note: to match this '{' 11 | int main (void) { | ^
s638593879
p03854
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #define MAX 100000000 using namespace std; string di[4]=["dream","dreamer","erase", "eraser"]; int main (void) { string S; cin >> S; reverse(S.begin(), S.end()); for (int i=0; i<=3; i++){ reverse(di[i].begin(), di[i].end()); } bool can1= true; for (int i=0; i<=S.size();){ bool can2 =false; for (int j=0; j<=3; j++){ if (di[j]==S.substr(i,di[j].size())){ i=i+di[j].size(); can2 =true; } } if (!can2){ cout << "No"; retunr 0; } } cout << "Yes"; }
a.cc:9:15: error: expected identifier before string constant 9 | string di[4]=["dream","dreamer","erase", "eraser"]; | ^~~~~~~ a.cc:9:22: error: expected ']' before ',' token 9 | string di[4]=["dream","dreamer","erase", "eraser"]; | ^ | ] a.cc: In lambda function: a.cc:9:22: error: expected '{' before ',' token a.cc: At global scope: a.cc:9:14: error: array must be initialized with a brace-enclosed initializer 9 | string di[4]=["dream","dreamer","erase", "eraser"]; | ^~~~~~~~ a.cc:9:23: error: expected unqualified-id before string constant 9 | string di[4]=["dream","dreamer","erase", "eraser"]; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:29:7: error: 'retunr' was not declared in this scope 29 | retunr 0; | ^~~~~~