submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s802921722
p04019
C++
#include<bits/stdc++.h> using namespace std; int b,l; string s; int main(){ cin>>s; l=s.length(); for(register int i=0;i<l;++i){ if(s[i]=='S'){ b=0; for(register int i=0;i<l;++i)if(a[i]=='N'){ b=1; break; } if(!b){ puts("No"); return 0; } }if(a[i]=='N'){ b=0; for(register int i=0;i<l;i++)if(a[i]=='S'){ b=1; break; }if(!b){ puts("No"); return 0; } }if(a[i]=='E'){ b=0; for(register int i=0;i<l;i++)if(a[i]=='W'){ b=1; break; } if(!b){ puts("No"); return 0; } }if(a[i]=='W'){ b=0; for(register int i=0;i<l;i++)if(a[i]=='E'){ b=1; break; }if(!b){ puts("No"); return 0; } } } puts("Yes"); return 0; }
a.cc: In function 'int main()': a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 8 | for(register int i=0;i<l;++i){ | ^ a.cc:11:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 11 | for(register int i=0;i<l;++i)if(a[i]=='N'){ | ^ a.cc:11:45: error: 'a' was not declared in this scope 11 | for(register int i=0;i<l;++i)if(a[i]=='N'){ | ^ a.cc:19:13: error: 'a' was not declared in this scope 19 | }if(a[i]=='N'){ | ^ a.cc:21:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 21 | for(register int i=0;i<l;i++)if(a[i]=='S'){ | ^ a.cc:28:13: error: 'a' was not declared in this scope 28 | }if(a[i]=='E'){ | ^ a.cc:30:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 30 | for(register int i=0;i<l;i++)if(a[i]=='W'){ | ^ a.cc:38:13: error: 'a' was not declared in this scope 38 | }if(a[i]=='W'){ | ^ a.cc:40:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 40 | for(register int i=0;i<l;i++)if(a[i]=='E'){ | ^
s121718631
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; int N=count(S.begin(),S.end(),'N'); int S=count(S.begin(),S.end(),'S'); int E=count(S.begin(),S.end(),'E'); int W=count(S.begin(),S.end(),'W'); if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; else cout<<"Yes"<<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: conflicting declaration 'int S' 6 | int S=count(S.begin(),S.end(),'S'); | ^ a.cc:4:10: note: previous declaration as 'std::string S' 4 | string S;cin>>S; | ^ a.cc:9:8: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::complex<_Tp>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::complex<_Tp>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed: a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::valarray<_Tp>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:9:9: note: mismatched types 'const std::valarray<_Tp>' and 'int' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:9:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ a.cc:9:16: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/string:54,
s158244758
p04019
C++
#include<bits/stdc++.h> #include<cmath> #pragma GCC optimize("Ofast") using namespace std; #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() typedef long long ll; const ll MOD = 1000000007; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;}; #define print(x) cout << (x) << endl; #define pb push_back #define mp make_pair #define sz(x) int(x.size()) #define fs first #define sc second template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;} const int INF = 1e9; const ll LLINF = 1e16; template<typename T> vector<T> make_v(size_t a){return vector<T>(a);} template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){ return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); } template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);} template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...); } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1}; template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } // 割り算の切り上げ処理 template<typename T> T round_up(T a, T b) { return (a + b - 1) / b; } using pint = pair<int, int>; using pll = pair<ll, ll>; int main(void) { cout.tie(0); cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); //auto dp=make_v<int>(4,h,w); //fill_v(dp,0); string s; cin >> s; bool sflag = false; bool nflag = false; bool eflag = false; bool wflag = false; rep(i,n){ if(sflag && s[i] != 'S' && s[i] != 'N'){ print("No"); return 0; } if(nflag && s[i] != 'S' && s[i] != 'N'){ print("No"); return 0; } if(eflag && s[i] != 'E' && s[i] != 'W'){ print("No"); return 0; } if(wflag && s[i] != 'E' && s[i] != 'W'){ print("No"); return 0; } if(s[i] == 'S') sflag = true; if(s[i] == 'N') nflag = true; if(s[i] == 'E') eflag = true; if(s[i] == 'W') wflag = true; } print("Yes"); }
a.cc: In function 'int main()': a.cc:78:11: error: 'n' was not declared in this scope 78 | rep(i,n){ | ^ a.cc:9:39: note: in definition of macro 'rep' 9 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^
s740576335
p04019
C++
#include<bits/stdc++.h> #include<cmath> #pragma GCC optimize("Ofast") using namespace std; #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() typedef long long ll; const ll MOD = 1000000007; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;}; #define print(x) cout << (x) << endl; #define pb push_back #define mp make_pair #define sz(x) int(x.size()) #define fs first #define sc second template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;} const int INF = 1e9; const ll LLINF = 1e16; template<typename T> vector<T> make_v(size_t a){return vector<T>(a);} template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){ return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); } template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);} template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...); } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1}; template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } // 割り算の切り上げ処理 template<typename T> T round_up(T a, T b) { return (a + b - 1) / b; } using pint = pair<int, int>; using pll = pair<ll, ll>; int main(void) { cout.tie(0); cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); //auto dp=make_v<int>(4,h,w); //fill_v(dp,0); string s; cin >> s; bool sflag = false; bool nflag = false; bool eflag = false; bool wflag = false; rep(i,n){ if(sflag && s[i] != 'S' && s[i] != N){ print("No"); return 0; } if(nflag && s[i] != 'S' && s[i] != N){ print("No"); return 0; } if(eflag && s[i] != 'E' && s[i] != W){ print("No"); return 0; } if(wflag && s[i] != 'E' && s[i] != W){ print("No"); return 0; } if(s[i] == 'S') sflag = true; if(s[i] == 'N') nflag = true; if(s[i] == 'E') eflag = true; if(s[i] == 'W') wflag = true; } print("Yes"); }
a.cc: In function 'int main()': a.cc:78:11: error: 'n' was not declared in this scope 78 | rep(i,n){ | ^ a.cc:9:39: note: in definition of macro 'rep' 9 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^ a.cc:79:44: error: 'N' was not declared in this scope 79 | if(sflag && s[i] != 'S' && s[i] != N){ | ^ a.cc:83:44: error: 'N' was not declared in this scope 83 | if(nflag && s[i] != 'S' && s[i] != N){ | ^ a.cc:87:44: error: 'W' was not declared in this scope 87 | if(eflag && s[i] != 'E' && s[i] != W){ | ^ a.cc:91:44: error: 'W' was not declared in this scope 91 | if(wflag && s[i] != 'E' && s[i] != W){ | ^
s643678803
p04019
C++
#include<iostream> #include<cstdio> using namespace std; string str; int w,n,e,s; bool check() { if(w==1 && e==1 && n==1 && s==1) return 1; if(w==1 && e==1 && n==0 && s==0) return 1; if(w==0 && e==0 && n==1 && s==1) return 1; if(w==0 && e==0 && n==0 && s==0) return 1; return 0; } int nain() { getline(cin,str); for(int i=0;i<str.length();i++) { if(str[i]=='W') w++; else if(str[i]=='N') n++; else if(str[i]=='E') e++; else s++; } if(check()) printf("Yes"); else printf("No"); printf("\n"); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s788485160
p04019
C++
#include<bits/stdc++.h> using namespace std; string s; int w,n,e,s; inline bool check() { if(w==1&&e==1&&n==1&&s==1) return 1; if(w==1&&e==1&&n==0&&s==0) return 1; if(w==0&&e==0&&n==1&&s==1) return 1; if(w==0&&e==0&&n==0&&s==0) return 1; return 0; } int main() { cin>>s; for(int i=0;i<s.length();i++) if(s[i]=='W') w++; else if(s[i]=='N') n++; else if(s[i]=='E') e++; else if(s[i]=='S') s++; printf("%s",check()?"Yes":"No"); return 0; }
a.cc:4:11: error: conflicting declaration 'int s' 4 | int w,n,e,s; | ^ a.cc:3:8: note: previous declaration as 'std::string s' 3 | string s; | ^ a.cc: In function 'bool check()': a.cc:7:27: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 7 | if(w==1&&e==1&&n==1&&s==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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:7:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:7:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:7:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 7 | if(w==1&&e==1&&n==1&&s==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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(w==1&&e==1&&n==1&&s==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:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:7:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | if(w==1&&e==1&&n==1&&s==1) | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:
s915797889
p04019
C++
#include <bits/stdc++.h> using namespace std; int main () { string T; cin >> T; iny N = 0, E = 0, S = 0, W = 0; for(int i = 0; i < T.size() ;i++){ if(T.at(i) == 'N')N++; else if(T.at(i) == 'E')E++; else if(T.at(i) == 'S')S++; else if(T.at(i) == 'W')W++; } int flag = 1; if(N == 0 && S != 0)flag = 0; if(N != 0 && S == 0)flag = 0; if(W == 0 && E != 0)flag = 0; if(W != 0 && E != 0)flag = 0; cout << (flag?"Yes":"No") << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'iny' was not declared in this scope; did you mean 'int'? 6 | iny N = 0, E = 0, S = 0, W = 0; | ^~~ | int a.cc:8:23: error: 'N' was not declared in this scope 8 | if(T.at(i) == 'N')N++; | ^ a.cc:9:28: error: 'E' was not declared in this scope 9 | else if(T.at(i) == 'E')E++; | ^ a.cc:10:28: error: 'S' was not declared in this scope 10 | else if(T.at(i) == 'S')S++; | ^ a.cc:11:28: error: 'W' was not declared in this scope 11 | else if(T.at(i) == 'W')W++; | ^ a.cc:14:6: error: 'N' was not declared in this scope 14 | if(N == 0 && S != 0)flag = 0; | ^ a.cc:14:16: error: 'S' was not declared in this scope 14 | if(N == 0 && S != 0)flag = 0; | ^ a.cc:15:6: error: 'N' was not declared in this scope 15 | if(N != 0 && S == 0)flag = 0; | ^ a.cc:15:16: error: 'S' was not declared in this scope 15 | if(N != 0 && S == 0)flag = 0; | ^ a.cc:16:6: error: 'W' was not declared in this scope 16 | if(W == 0 && E != 0)flag = 0; | ^ a.cc:16:16: error: 'E' was not declared in this scope 16 | if(W == 0 && E != 0)flag = 0; | ^ a.cc:17:6: error: 'W' was not declared in this scope 17 | if(W != 0 && E != 0)flag = 0; | ^ a.cc:17:16: error: 'E' was not declared in this scope 17 | if(W != 0 && E != 0)flag = 0; | ^
s589634150
p04019
C++
#include<iostream> #include<vector> #include<string> #include<math.h> using namespace std; int main() { int n=0,w=0,s=0,e=0; int ns = 0, we = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 'N')n = 1; else if (s[i] == 'S')y = 1; else if (s[i] == 'W')z = 1; else if (s[i] == 'E')t = 1; } ns = s + n; we = w + e; if (ns == 1 || we == 1)cout << "No" << endl; else cout << "Yes" << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: conflicting declaration 'std::string s' 10 | string s; | ^ a.cc:8:21: note: previous declaration as 'int s' 8 | int n=0,w=0,s=0,e=0; | ^ a.cc:13:31: error: request for member 'length' in 's', which is of non-class type 'int' 13 | for (int i = 0; i < s.length(); i++) | ^~~~~~ a.cc:15:22: error: invalid types 'int[int]' for array subscript 15 | if (s[i] == 'N')n = 1; | ^ a.cc:16:27: error: invalid types 'int[int]' for array subscript 16 | else if (s[i] == 'S')y = 1; | ^ a.cc:16:38: error: 'y' was not declared in this scope 16 | else if (s[i] == 'S')y = 1; | ^ a.cc:17:27: error: invalid types 'int[int]' for array subscript 17 | else if (s[i] == 'W')z = 1; | ^ a.cc:17:38: error: 'z' was not declared in this scope 17 | else if (s[i] == 'W')z = 1; | ^ a.cc:18:27: error: invalid types 'int[int]' for array subscript 18 | else if (s[i] == 'E')t = 1; | ^ a.cc:18:38: error: 't' was not declared in this scope 18 | else if (s[i] == 'E')t = 1; | ^
s799340660
p04019
C
#include<stdio.h> #include<string.h> int main() { char in; int N,S,W,E; scanf("%c",&in); N = strchr(in, (int)'N'); S = strchr(in, (int)'S'); W = strchr(in, (int)'W'); E = strchr(in, (int)'E'); if (N != (null) && S != (null)){ printf("Yes\n"); } else if (W != (null) && E != (null)){ printf("Yes\n"); } else { printf("No\n"); } return 0 ; }
main.c: In function 'main': main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 7 | N = strchr(in, (int)'N'); | ^~ | | | char In file included from main.c:2: /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:7:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 7 | N = strchr(in, (int)'N'); | ^ main.c:8:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 8 | S = strchr(in, (int)'S'); | ^~ | | | char /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:8:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 8 | S = strchr(in, (int)'S'); | ^ main.c:9:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 9 | W = strchr(in, (int)'W'); | ^~ | | | char /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:9:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 9 | W = strchr(in, (int)'W'); | ^ main.c:10:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 10 | E = strchr(in, (int)'E'); | ^~ | | | char /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:10:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 10 | E = strchr(in, (int)'E'); | ^ main.c:11:13: error: 'null' undeclared (first use in this function) 11 | if (N != (null) && S != (null)){ | ^~~~ main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
s125570878
p04019
C
#include<stdio.h> #include<string.h> int main() { char S; int N,S,W,E; scanf("%c",&S); N = strchr(S, (int)'N'); S = strchr(S, (int)'S'); W = strchr(S, (int)'W'); E = strchr(S, (int)'E'); if (N != (null) && S != (null)){ printf("Yes\n"); } else if (W != (null) && E != (null)){ printf("Yes\n"); } else { printf("No\n"); } return 0 ; }
main.c: In function 'main': main.c:5:9: error: conflicting types for 'S'; have 'int' 5 | int N,S,W,E; | ^ main.c:4:8: note: previous declaration of 'S' with type 'char' 4 | char S; | ^ main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 7 | N = strchr(S, (int)'N'); | ^ | | | int In file included from main.c:2: /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:7:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 7 | N = strchr(S, (int)'N'); | ^ main.c:8:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 8 | S = strchr(S, (int)'S'); | ^ | | | int /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:8:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 8 | S = strchr(S, (int)'S'); | ^ main.c:9:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 9 | W = strchr(S, (int)'W'); | ^ | | | int /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:9:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 9 | W = strchr(S, (int)'W'); | ^ main.c:10:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 10 | E = strchr(S, (int)'E'); | ^ | | | int /usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int' 246 | extern char *strchr (const char *__s, int __c) | ~~~~~~~~~~~~^~~ main.c:10:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 10 | E = strchr(S, (int)'E'); | ^ main.c:11:13: error: 'null' undeclared (first use in this function) 11 | if (N != (null) && S != (null)){ | ^~~~ main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
s216291617
p04019
Java
import java.util*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String S = br.readLine(); br.close(); int N = S.length(); boolean[] direction = new boolean[4]; Map<Character, Integer> chr_code = new HashMap<>(); chr_code.put('N', 0); chr_code.put('S', 1); chr_code.put('E', 2); chr_code.put('W', 3); for(int i = 0; i < N; i++){ char now_chr = S.charAt(i); direction[chr_code.get(now_chr)] = true; } if( !(direction[0] ^ direction[1]) && !(direction[2] ^ direction[3]) ){ System.out.println("Yes"); }else{ System.out.println("No"); } } }
Main.java:1: error: ';' expected import java.util*; ^ 1 error
s466670917
p04019
C++
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { string T; cin >> T; bool N = false, W = false, S = false, E = false; for (int i = 0; i < S.size(); i++){ if (T.at(i) == 'N'){ N = true; } if (T.at(i) == 'E'){ E = true; } if (T.at(i) == 'W'){ W = true; } if (T.at(i) == 'S'){ S = true; } } if ((N && S) && (E && W)){ cout << "Yes" << endl; } else { cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool' 13 | for (int i = 0; i < S.size(); i++){ | ^~~~
s517096021
p04019
C++
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { string T; cin >> T; bool N = false, W = false, S = false, E = false; for (int i = 0; i < S.size(); i++){ if (S.at(i) == 'N'){ N = true; } if (S.at(i) == 'E'){ E = true; } if (S.at(i) == 'W'){ W = true; } if (S.at(i) == 'S'){ S = true; } } if ((N && S) && (E && W)){ cout << "Yes" << endl; } else { cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool' 13 | for (int i = 0; i < S.size(); i++){ | ^~~~ a.cc:14:15: error: request for member 'at' in 'S', which is of non-class type 'bool' 14 | if (S.at(i) == 'N'){ | ^~ a.cc:17:15: error: request for member 'at' in 'S', which is of non-class type 'bool' 17 | if (S.at(i) == 'E'){ | ^~ a.cc:20:15: error: request for member 'at' in 'S', which is of non-class type 'bool' 20 | if (S.at(i) == 'W'){ | ^~ a.cc:23:15: error: request for member 'at' in 'S', which is of non-class type 'bool' 23 | if (S.at(i) == 'S'){ | ^~
s034239065
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,k; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charAt(i)=='S') k++; if(s.charAt(i)=='N') n++; } if(w==0 && e!=0) System.out.println("No"); else if(e==0 && w!=0) System.out.println("No"); else if(k==0 && n!=0) System.out.println("No"); else if(n==0 && k!=0) System.out.println("No"); else System.out.println("Yes"); } }
Main.java:9: error: variable w might not have been initialized if(s.charAt(i)=='W') w++; ^ Main.java:10: error: variable e might not have been initialized if(s.charAt(i)=='E') e++; ^ Main.java:11: error: variable k might not have been initialized if(s.charAt(i)=='S') k++; ^ Main.java:12: error: variable n might not have been initialized if(s.charAt(i)=='N') n++; ^ Main.java:14: error: variable w might not have been initialized if(w==0 && e!=0) System.out.println("No"); ^ Main.java:14: error: variable e might not have been initialized if(w==0 && e!=0) System.out.println("No"); ^ Main.java:15: error: variable e might not have been initialized else if(e==0 && w!=0) System.out.println("No"); ^ Main.java:17: error: variable k might not have been initialized else if(k==0 && n!=0) System.out.println("No"); ^ Main.java:17: error: variable n might not have been initialized else if(k==0 && n!=0) System.out.println("No"); ^ Main.java:19: error: variable n might not have been initialized else if(n==0 && k!=0) System.out.println("No"); ^ 10 errors
s316030395
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charAt(i)=='S') s++; if(s.charAt(i)=='N') n++; } if(w==0 && e!=0) System.out.println("No"); else if(e==0 && w!=0) System.out.println("No"); else if(s==0 && n!=0) System.out.println("No"); else if(n==0 && s!=0) System.out.println("No"); else System.out.println("Yes"); } }
Main.java:7: error: variable s is already defined in method main(String[]) int w,e,n,s; ^ Main.java:8: error: int cannot be dereferenced for(int i=0;i<s.length();i++){ ^ Main.java:9: error: int cannot be dereferenced if(s.charAt(i)=='W') w++; ^ Main.java:10: error: int cannot be dereferenced if(s.charAt(i)=='E') e++; ^ Main.java:11: error: int cannot be dereferenced if(s.charAt(i)=='S') s++; ^ Main.java:12: error: int cannot be dereferenced if(s.charAt(i)=='N') n++; ^ 6 errors
s211698836
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charAt(i)=='S') s++; if(s.charAt(i)=='N') n++; } if(w==0 && e!=0) System.out.println("No"); else if(e==0 && w!=0) System.out.println("No"); else if(s==0 && n!=0) System.out.println("No"); else if(n==0 && s!=0) System.out.println("No"); else System.out.println(“Yes”); } }
Main.java:21: error: illegal character: '\u201c' else System.out.println(?Yes?); ^ Main.java:21: error: illegal character: '\u201d' else System.out.println(?Yes?); ^ Main.java:21: error: not a statement else System.out.println(?Yes?); ^ 3 errors
s576648921
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)==`W`) w++; if(s.charAt(i)==`E`) e++; if(s.charAt(i)==`S`) s++; if(s.charAt(i)==`N`) n++; } if(w==0 && e!=0) System.out.println( “No”); else if(e==0 && w!=0) System.out.println( “No”); else if(s==0 && n!=0) System.out.println( “No”); else if(n==0 && s!=0) System.out.println( “No”); else System.out.println(“Yes”); } }
Main.java:9: error: illegal character: '`' if(s.charAt(i)==`W`) w++; ^ Main.java:9: error: illegal character: '`' if(s.charAt(i)==`W`) w++; ^ Main.java:9: error: not a statement if(s.charAt(i)==`W`) w++; ^ Main.java:10: error: illegal character: '`' if(s.charAt(i)==`E`) e++; ^ Main.java:10: error: illegal character: '`' if(s.charAt(i)==`E`) e++; ^ Main.java:10: error: not a statement if(s.charAt(i)==`E`) e++; ^ Main.java:11: error: illegal character: '`' if(s.charAt(i)==`S`) s++; ^ Main.java:11: error: illegal character: '`' if(s.charAt(i)==`S`) s++; ^ Main.java:11: error: not a statement if(s.charAt(i)==`S`) s++; ^ Main.java:12: error: illegal character: '`' if(s.charAt(i)==`N`) n++; ^ Main.java:12: error: illegal character: '`' if(s.charAt(i)==`N`) n++; ^ Main.java:12: error: not a statement if(s.charAt(i)==`N`) n++; ^ Main.java:14: error: illegal character: '\u201c' if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:14: error: illegal character: '\u201d' if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:14: error: not a statement if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:15: error: illegal character: '\u201c' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: 'else' without 'if' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: illegal character: '\u201d' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: not a statement else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:17: error: illegal character: '\u201c' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: 'else' without 'if' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: illegal character: '\u201d' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: not a statement else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:19: error: illegal character: '\u201c' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: 'else' without 'if' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: illegal character: '\u201d' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: not a statement else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:21: error: illegal character: '\u201c' else System.out.println(?Yes?); ^ Main.java:21: error: 'else' without 'if' else System.out.println(?Yes?); ^ Main.java:21: error: illegal character: '\u201d' else System.out.println(?Yes?); ^ Main.java:21: error: not a statement else System.out.println(?Yes?); ^ 31 errors
s639978032
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)==‘W’) w++; if(s.charAt(i)==‘E’) e++; if(s.charAt(i)==‘S’) s++; if(s.charAt(i)==‘’N) n++; } if(w==0 && e!=0) System.out.println( “No”); else if(e==0 && w!=0) System.out.println( “No”); else if(s==0 && n!=0) System.out.println( “No”); else if(n==0 && s!=0) System.out.println( “No”); else System.out.println(“Yes”); } }
Main.java:9: error: illegal character: '\u2018' if(s.charAt(i)==?W?) w++; ^ Main.java:9: error: illegal character: '\u2019' if(s.charAt(i)==?W?) w++; ^ Main.java:9: error: not a statement if(s.charAt(i)==?W?) w++; ^ Main.java:10: error: illegal character: '\u2018' if(s.charAt(i)==?E?) e++; ^ Main.java:10: error: illegal character: '\u2019' if(s.charAt(i)==?E?) e++; ^ Main.java:10: error: not a statement if(s.charAt(i)==?E?) e++; ^ Main.java:11: error: illegal character: '\u2018' if(s.charAt(i)==?S?) s++; ^ Main.java:11: error: illegal character: '\u2019' if(s.charAt(i)==?S?) s++; ^ Main.java:11: error: not a statement if(s.charAt(i)==?S?) s++; ^ Main.java:12: error: illegal character: '\u2018' if(s.charAt(i)==??N) n++; ^ Main.java:12: error: illegal character: '\u2019' if(s.charAt(i)==??N) n++; ^ Main.java:12: error: not a statement if(s.charAt(i)==??N) n++; ^ Main.java:12: error: ';' expected if(s.charAt(i)==??N) n++; ^ Main.java:14: error: illegal character: '\u201c' if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:14: error: illegal character: '\u201d' if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:14: error: not a statement if(w==0 && e!=0) System.out.println( ?No?); ^ Main.java:15: error: illegal character: '\u201c' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: 'else' without 'if' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: illegal character: '\u201d' else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:15: error: not a statement else if(e==0 && w!=0) System.out.println( ?No?); ^ Main.java:17: error: illegal character: '\u201c' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: 'else' without 'if' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: illegal character: '\u201d' else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:17: error: not a statement else if(s==0 && n!=0) System.out.println( ?No?); ^ Main.java:19: error: illegal character: '\u201c' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: 'else' without 'if' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: illegal character: '\u201d' else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:19: error: not a statement else if(n==0 && s!=0) System.out.println( ?No?); ^ Main.java:21: error: illegal character: '\u201c' else System.out.println(?Yes?); ^ Main.java:21: error: 'else' without 'if' else System.out.println(?Yes?); ^ Main.java:21: error: illegal character: '\u201d' else System.out.println(?Yes?); ^ Main.java:21: error: not a statement else System.out.println(?Yes?); ^ 32 errors
s567092564
p04019
C++
#include <iostream> using namespace std; int main(void) { bool ok = true; string s; cin >> s; vector<int> news(4, 0); for (int i = 0; i < s.size(); ++i) { if (s[i] == 'N') ++news[0]; else if (s[i] == 'E') ++news[1]; else if (s[i] == 'W') ++news[2]; else if (s[i] == 'S') ++news[3]; } if (news[0] > 0 && news[3] == 0) ok = false; if (news[3] > 0 && news[0] == 0) ok = false; if (news[1] > 0 && news[2] == 0) ok = false; if (news[2] > 0 && news[1] == 0) ok = false; cout << (ok ? "Yes" : "No") << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'vector' was not declared in this scope 7 | vector<int> news(4, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:7:16: error: expected primary-expression before 'int' 7 | vector<int> news(4, 0); | ^~~ a.cc:9:41: error: 'news' was not declared in this scope 9 | if (s[i] == 'N') ++news[0]; | ^~~~ a.cc:10:41: error: 'news' was not declared in this scope 10 | else if (s[i] == 'E') ++news[1]; | ^~~~ a.cc:11:41: error: 'news' was not declared in this scope 11 | else if (s[i] == 'W') ++news[2]; | ^~~~ a.cc:12:41: error: 'news' was not declared in this scope 12 | else if (s[i] == 'S') ++news[3]; | ^~~~ a.cc:14:13: error: 'news' was not declared in this scope 14 | if (news[0] > 0 && news[3] == 0) ok = false; | ^~~~ a.cc:15:13: error: 'news' was not declared in this scope 15 | if (news[3] > 0 && news[0] == 0) ok = false; | ^~~~ a.cc:16:13: error: 'news' was not declared in this scope 16 | if (news[1] > 0 && news[2] == 0) ok = false; | ^~~~ a.cc:17:13: error: 'news' was not declared in this scope 17 | if (news[2] > 0 && news[1] == 0) ok = false; | ^~~~
s297537451
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; int n,w,s,e; n=0; w=0; s=0; e=0; for(int i=0;i<s.size();i++){ if(s.at(i)=='N'){ n++; }else if(s.at(i)=='W'){ w++; }else if(s.at(i)=='S'){ s++; }else if(s.at(i)=='E'){ e++; } } if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:6:11: error: conflicting declaration 'int s' 6 | int n,w,s,e; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:9:5: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | s=0; | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 817 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 828 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 840 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 858 | operator=(basic_string&& __str) | ^~~~~~~~ a.cc:17:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 17 | s++; | ~^~ a.cc:22:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ~^~~ | | | | | 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: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 22 | if(((n==0&&s==0)||(n>0&&s>0))&&((w==0&&e==0)||(w>0&&e>0))){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 22 | if(((n==0&&s==0)||(n>0&
s803233848
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string st; cin >> st; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n*e*w*s > 0){ out = "Yes"; break; } } if(n == 0 & s == 0){ out = "Yes"; } if(w == o & e == 0){ out = "Yes"; } cout << out; }
a.cc: In function 'int main()': a.cc:9:16: error: 'begin' was not declared in this scope 9 | for(char c : s){ | ^ a.cc:9:16: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/valarray:1238:5: note: 'std::begin' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ In file included from /usr/include/c++/14/filesystem:53, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200: /usr/include/c++/14/bits/fs_dir.h:608:3: note: 'std::filesystem::__cxx11::begin' 608 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ a.cc:9:16: error: 'end' was not declared in this scope 9 | for(char c : s){ | ^ a.cc:9:16: note: suggested alternatives: /usr/include/c++/14/valarray:1265:5: note: 'std::end' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/bits/fs_dir.h:613:3: note: 'std::filesystem::__cxx11::end' 613 | end(recursive_directory_iterator) noexcept | ^~~ a.cc:27:13: error: 'o' was not declared in this scope 27 | if(w == o & e == 0){ | ^
s636033384
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n*e*w*s > 0){ out = "Yes"; break; } } if(n == 0 & s == 0){ out = "Yes"; } if(w == o & e == 0){ out = "Yes"; } cout << out; }
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 15 | s++; | ~^~ a.cc:19:13: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 19 | if(n*e*w*s > 0){ | ~~~~~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::complex<_Tp>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::complex<_Tp>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed: a.cc:19:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 19 | if(n*e*w*s > 0){ | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:19:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:19:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::valarray<_Tp>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:19:14: note: mismatched types 'const std::valarray<_Tp>' and 'int' 19 | if(n*e*w*s > 0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:19:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 19 | if(n*e*w*s > 0){ | ^ a.cc:24:18: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 24 | if(n == 0 & s == 0){ | ~ ^~ ~ | | | | | 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: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:24:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 24 | if(n == 0 & s == 0){ | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:24:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 24 | if(n == 0 & s == 0){ | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:24:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::su
s595689772
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n > 0 & w > 0 & s > 0 & e > 0){ out = "Yes"; break; } } if(n == 0 & s == 0){ out = "Yes"; } if(w == o & e == 0){ out = "Yes"; } cout << out; }
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 15 | s++; | ~^~ a.cc:19:26: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ~ ^ ~ | | | | | 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:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1236: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>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1329: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>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ 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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ 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:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' an
s270810915
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n > 0 & w > 0 & s > 0 & e > 0){ out = "Yes"; break; } } cout << out; }
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 15 | s++; | ~^~ a.cc:19:26: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ~ ^ ~ | | | | | 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:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1236: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>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1329: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>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ 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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ 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:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:19:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | if(n > 0 & w > 0 & s > 0 & e > 0){ | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:19:28: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' an
s658736803
p04019
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean n; boolean w; boolean s; boolean e; for (int i = 0; i < S.length(); i++) { char c = S.charAt(i); if (c == 'N') { n = true; } else if (c == 'W') { w = true; } else if (c == 'S') { s = true; } else if (c == 'E') { e = true; } } System.out.println((n^s)&&(w^e) ? "Yes" : "No"); } }
Main.java:23: error: variable n might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ Main.java:23: error: variable s might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ Main.java:23: error: variable w might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ Main.java:23: error: variable e might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ 4 errors
s843297711
p04019
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean n; boolean w; boolean s; boolean e; for (int i = 0; i < N; i++) { char c = S.charAt(i); if (c == 'N') { n = true; } else if (c == 'W') { w = true; } else if (c == 'S') { s = true; } else if (c == 'E') { e = true; } } System.out.println((n^s)&&(w^e) ? "Yes" : "No"); } }
Main.java:11: error: cannot find symbol for (int i = 0; i < N; i++) { ^ symbol: variable N location: class Main 1 error
s987367232
p04019
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s;cin>>s; int n=s.size(); vector<int>a(4); for(int i=0;i<n;i++){ char p=s.at(i) if(p=='N')a.at(0)++; else if(p=='S')a.at(1)++; else if(p=='W')a.at(2)++; else a.at(3)++; } int x=0; if(a.at(0)>0){ if(a.at(1)>0){ if(a.at(2)*a.at(3)>0)x++; else if(a.at(2)==0&&a.at(3)==0)x++; } } else{ if(a.at(1)==0){ if(a.at(2)*a.at(3)>0)x++; else if(a.at(2)==0&&a.at(3)==0)x++; } } if(x>0)cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:9:5: error: expected ',' or ';' before 'if' 9 | if(p=='N')a.at(0)++; | ^~ a.cc:10:5: error: 'else' without a previous 'if' 10 | else if(p=='S')a.at(1)++; | ^~~~
s175119804
p04019
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main(void){ int i,n,e,w,s; bool ans; string s; cin >> s; n=e=w=s=0; for (i=0;i<s.size();i++){ if (s[i]=='N') n++; else if (s[i]=='E') e++; else if (s[i]=='W') w++; else s++; } ans=((n==0 && s==0) || (n!=0 && s!=0) || (e==0 && w==0) || (e!=0 && w!=0)); if (ans) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: conflicting declaration 'std::string s' 8 | string s; | ^ a.cc:6:15: note: previous declaration as 'int s' 6 | int i,n,e,w,s; | ^ a.cc:11:16: error: request for member 'size' in 's', which is of non-class type 'int' 11 | for (i=0;i<s.size();i++){ | ^~~~ a.cc:12:10: error: invalid types 'int[int]' for array subscript 12 | if (s[i]=='N') n++; | ^ a.cc:13:15: error: invalid types 'int[int]' for array subscript 13 | else if (s[i]=='E') e++; | ^ a.cc:14:15: error: invalid types 'int[int]' for array subscript 14 | else if (s[i]=='W') w++; | ^
s874929298
p04019
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 1000000007 #define FI first #define SE second #define MP make_pair #define PB push_back #define SZ(x) (int)x.size() #define SP(x) setprecision((int)x) using namespace std ; typedef long long ll; typedef vector<int> vint; typedef vector<vint> vvint; typedef vector<string> vstr; typedef pair<int, int> pii; const int INF = 1e9; const ll LINF = 1e18; const double EPS = 1e-9; ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数 ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数 int main() { string s ; cin >> s ; int n = SZ(s) ; vector<int> vec(4,0) ; REP(i,n){ if(s.at(i)=='N'){ vec.at(0)++ ; } else if(s.at(i)=='S'){ vec.at(1)++ ; } else if(s.at(i)=='W'){ vec.at(2)++ ; } else if(s.at(i)=='E'){ vec.at(3)++ ; } } if(vec.at(0)==0 && vec.at(1)!=0){ cout << "No"<<endl ; return 0 ; } if(vec.at(1)==0 && vec.at(0)!=0){ cout << "No"<<endl ; return 0 ; } if(vec.at(2)==0 && vec.at(3)!=0){ cout << "No"<<endl ; return 0 ; } if(vec.at(3)==0 && vec.at(2)!=0){ cout << "No"<<endl ; return 0 ; } cout <<"Yes"<<<endl ; return 0 ; }
a.cc: In function 'int main()': a.cc:65:17: error: expected primary-expression before '<' token 65 | cout <<"Yes"<<<endl ; | ^
s826135516
p04019
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { string s; cin >> s; int b =0 ,c=0,d=0,e =0; for(int i=;i<s.size();i++){ if(s[i] =='N'){ b++; } if(s[i] =='W'){ c++; } if(s[i]=='S'){ d++; } if(s[i] =='E'){ e++; } } if(((b!=0)&&(d!=0))||((c!=0)&&(e!=0))){ cout <<"Yes" << endl; } else { cout <<"No" << endl; } }
a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before ';' token 11 | for(int i=;i<s.size();i++){ | ^
s561354151
p04019
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { string a; cin >> a; int b =0 ,c=0,d=0,e =0; for(int i=;i<a.size();i++){ if(s[i] =='N'){ b++; } if(s[i] =='W'){ c++; } if(s[i]=='S'){ d++; } if(s[i] =='E'){ e++; } } if(((b!=0)&&(d!=0))||((c!=0)&&(e!=0))){ cout <<"Yes" << endl; } else { cout <<"No" << endl; } }
a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before ';' token 11 | for(int i=;i<a.size();i++){ | ^ a.cc:12:8: error: 's' was not declared in this scope 12 | if(s[i] =='N'){ | ^ a.cc:15:8: error: 's' was not declared in this scope 15 | if(s[i] =='W'){ | ^ a.cc:18:8: error: 's' was not declared in this scope 18 | if(s[i]=='S'){ | ^ a.cc:21:11: error: 's' was not declared in this scope 21 | if(s[i] =='E'){ | ^
s620955038
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { bool x=1 , y=1 , a=0 , b=0 , c=0 , d = 0; string s; cin >> s; for (int i = 0 ; i < (int)s.size() ; i++){ if(s[i] == 'n'){ a=1; } else if(s[i] == 'S'){ b=1; } else if(s[i] == 'W'){ c=1; } else if(s[i] == 'E'){ d=1; } if((a==0 && b==1)||(a==1 && b==0)){ x=0; } else if((a==1 && b==1)|| (a==0 && b==0)){ x=1; } if((c==0 && d==1) || (c==1 && d==0)){ y=1; } else if((c==1 && d==1)|| (c==0 && d==0)){ y=1; } } if(x==1 && y==1){ cout << "Yes" << endl; } else{ cout << "No"; << endl; } }
a.cc: In function 'int main()': a.cc:40:31: error: expected primary-expression before '<<' token 40 | cout << "No"; << endl; | ^~
s529067049
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { bool x=1 , y=1 , a=0 , b=0 , c=0 , d = 0; string s; cin >> s; for (int i = 0 ; i <s.size ; i++){ if(s[i] == 'n'){ a=1; } else if(s[i] == 'S'){ b=1; } else if(s[i] == 'W'){ c=1; } else if(s[i] == 'E'){ d=1; } if((a==0 && b==1)||(a==1 && b==0)){ x=0; } else if((a==1 && b==1)|| (a==0 && b==0)){ x=1; } if((c==0 && d==1) || (c==1 && d==0)){ y=1; } else if((c==1 && d==1)|| (c==0 && d==0)){ y=1; } } if(x==1 && y==1){ cout << "Yes" << endl; } else{ cout << "No"; << endl; } }
a.cc: In function 'int main()': a.cc:10:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 10 | for (int i = 0 ; i <s.size ; i++){ | ~~^~~~ | () a.cc:40:31: error: expected primary-expression before '<<' token 40 | cout << "No"; << endl; | ^~
s005057287
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++; } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ; i++){ if(s[i] == 'W' && s[i+1] == 'E' || s[i] == 'E' && s[i+1] == 'W' || s[i] == 'N' && s[i +1] == 'S' || s[i] == 'S' && s[i+1] == 'N'){ cout << "No"; return 0; } } cout << "Yes"; }
a.cc: In function 'int main()': a.cc:19:35: error: expected primary-expression before ')' token 19 | for(int i = 0 ; i < n ; ++){ | ^
s598009409
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++ } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ; i++){ if(s[i] == 'W' && s[i+1] == 'E' || s[i] == 'E' && s[i+1] == 'W' || s[i] == 'N' && s[i +1] == 'S' || s[i] == 'S' && s[i+1] == 'N'){ cout << "No"; return 0; } } cout << "Yes"; }
a.cc: In function 'int main()': a.cc:18:35: error: expected primary-expression before ')' token 18 | for(int i = 0 ; i < n ; ++){ | ^ a.cc:20:20: error: expected ';' before '}' token 20 | w++ | ^ | ; 21 | } | ~
s025065276
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; return 0; } int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++ } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ; i++){ if(s[i] == 'W' && s[i+1] == 'E' || s[i] == 'E' && s[i+1] == 'W' || s[i] == 'N' && s[i +1] == 'S' || s[i] == 'S' && s[i+1] == 'N'){ cout << "No"; return 0; } } cout << "Yes"; }
a.cc:15:17: error: 's' was not declared in this scope 15 | int n = s.size(); | ^ a.cc:16:9: error: expected unqualified-id before 'if' 16 | if(n == 1){ | ^~ a.cc:20:9: error: expected unqualified-id before 'for' 20 | for(int i = 0 ; i < n ; ++){ | ^~~ a.cc:20:25: error: 'i' does not name a type 20 | for(int i = 0 ; i < n ; ++){ | ^ a.cc:20:33: error: expected unqualified-id before '++' token 20 | for(int i = 0 ; i < n ; ++){ | ^~ a.cc:24:9: error: expected unqualified-id before 'if' 24 | if(w == 1 && s[0] == s[n-1]){ | ^~ a.cc:28:9: error: expected unqualified-id before 'for' 28 | for(int i = 0 ; i < n ; i++){ | ^~~ a.cc:28:25: error: 'i' does not name a type 28 | for(int i = 0 ; i < n ; i++){ | ^ a.cc:28:33: error: 'i' does not name a type 28 | for(int i = 0 ; i < n ; i++){ | ^ a.cc:34:9: error: 'cout' does not name a type 34 | cout << "Yes"; | ^~~~ a.cc:35:1: error: expected declaration before '}' token 35 | } | ^
s000983397
p04019
C++
#include<bits/stdc++.h> using namespace std; #define foorp(i , a , n) for (int (i) = (a); (i) < (n); (i)++) #define foorm(i , a , n) for (int (i) = (a); (i) > (n); (i)--) #define ll long long int string s; bool n , w , sb , e; int main() { cin >> s; for (int i = 0; i < (int)s.size(); i++) { if (s[i] == 'N') n = true; if (s[i] == 'W') w = true; if (s[i] == 'S') sb = true;i if (s[i] == 'E') e = true; } if (!(n == sb) || !(w == e)) cout << "No" << endl; else cout << "Yes" << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:24: error: expected ';' before 'if' 22 | sb = true;i | ^ | ; 23 | if (s[i] == 'E') | ~~
s480466026
p04019
C++
#include <iostream> #include <map> #include <set> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <fstream> #include <bitset> #include <queue> #include <stack> #include <deque> #include <complex> #include <iomanip> #include <stdio.h> #include <string.h> using std::cin; using std::cout; using std::cerr; using std::endl; using std::map; using std::set; using std::bitset; using std::vector; using std::string; using std::multimap; using std::multiset; using std::deque; using std::queue; using std::stack; using std::pair; using std::iterator; using std::sort; using std::stable_sort; using std::reverse; using std::max_element; using std::min_element; using std::unique; using std::ios_base; using std::swap; using std::fill; using std::setprecision; using std::fixed; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<long long> vl; typedef string S; namespace MySpace{ }; #define F(i, n) for (int (i) = 0; (i) != (n); (i)++) #define fi first #define se second #define re return #define all(x) (x).begin(), (x).end() int nextInt() { int y = 0; char c = getchar(); while ('0' <= c && c <= '9') { y = 10 * y + c - '0'; c = getchar(); } return y; } long long max(long long a, long long b) { if (a > b) return a; return b; } long long min(long long a, long long b) { if (a < b) return a; return b; } S s; signed main() { //freopen("", "r", stdin); //freopen("", "w", stdout); //ios_base::sync_with_stdio(false); //cin.tie(0); //cout.tie(0); cin >> s; for (int i = 0; i < s.size(); i++) cnt[s[i]]++; if (cnt['N'] && !cnt['S']) {cout << "No"; return 0;} if (!cnt['N'] && cnt['S']) {cout << "No"; return 0;} if (cnt['E'] && !cnt['W']) {cout << "No"; return 0;} if (!cnt['E'] && cnt['W']) {cout << "No"; return 0;} cout << "Yes"; }
a.cc: In function 'int main()': a.cc:100:40: error: 'cnt' was not declared in this scope; did you mean 'int'? 100 | for (int i = 0; i < s.size(); i++) cnt[s[i]]++; | ^~~ | int a.cc:101:9: error: 'cnt' was not declared in this scope; did you mean 'int'? 101 | if (cnt['N'] && !cnt['S']) {cout << "No"; return 0;} | ^~~ | int a.cc:102:10: error: 'cnt' was not declared in this scope; did you mean 'int'? 102 | if (!cnt['N'] && cnt['S']) {cout << "No"; return 0;} | ^~~ | int a.cc:103:9: error: 'cnt' was not declared in this scope; did you mean 'int'? 103 | if (cnt['E'] && !cnt['W']) {cout << "No"; return 0;} | ^~~ | int a.cc:104:10: error: 'cnt' was not declared in this scope; did you mean 'int'? 104 | if (!cnt['E'] && cnt['W']) {cout << "No"; return 0;} | ^~~ | int
s448729532
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool n=false,s=false,w=false,e=false; for(int i=0;i<s.size();i++){ if(s.at(i)=='N') n=true; else if(s.at(i)=='S') s=true; else if(s.at(i)=='W') w=true; else e=true; } if(n&&s&&e&&w) cout<<"Yes"; else if(n&&s&&!e&&!w) cout<<"Yes"; else if(!n&&!s&&e&&w) cout<<"Yes"; else cout<<"No"; cout<<endl; }
a.cc: In function 'int main()': a.cc:7:16: error: conflicting declaration 'bool s' 7 | bool n=false,s=false,w=false,e=false; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:14:7: error: no match for 'operator&&' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 14 | if(n&&s&&e&&w) cout<<"Yes"; | ~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | bool a.cc:14:7: note: candidate: 'operator&&(bool, bool)' (built-in) 14 | if(n&&s&&e&&w) cout<<"Yes"; | ~^~~ a.cc:14:7: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:14:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:14:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:14:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:14:9: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:14:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:14:9: note: mismatched types 'const std::valarray<_Tp>' and 'bool' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:14:9: note: mismatched types 'const std::valarray<_Tp>' and 'bool' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:14:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 14 | if(n&&s&&e&&w) cout<<"Yes"; | ^ a.cc:15:12: error: no match for 'operator&&' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 15 | else if(n&&s&&!e&&!w) cout<<"Yes"; | ~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | bool a.cc:15:12: note: candidate: 'operator&&(bool, bool)' (built-in) 15 | else if(n&&s&&!e&&!w) cout<<"Yes"; | ~^~~ a.cc:15:12: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:15:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 15 | else if(n&&s&&!e&&!w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:15:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 15 | else if(n&&s&&!e&&!w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:15:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 15 | else if(n&&s&&!e&&!w) cout<<"Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /u
s508616287
p04019
C++
#include <iostream> #include <cstring> #include <stdlib.h> #include <vector> #include <algorithm> #include <cmath> #include <stack> #include <queue> #include <math.h> #include <string> #include <map> #include <iomanip> using namespace std; typedef long long ll; ll mod=1000000007; typedef pair<int, int> P; int main() { string s; cin >> s; vector<int> f(4, 0); for(int i=0; i<s.size(); i++){ if(s[i]=='W')f[0]=1; else if(s[i]=='N')f[1]=1; else if(s[i]=='S')f[2]=1; else f[3]=1; } if(f[0]==f[3] && f[1]==f[2]) cout << "Yes"; else cout <<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:33:17: error: expected primary-expression before '<' token 33 | else cout <<<"No"; | ^
s536839475
p04019
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<bitset> #include<queue> #define ll long long #define itn int #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FFOR(i,a,b) for(int i=(a);i<=(b);++i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) FFOR(i,1,n) #define SORT(V) sort((V).begin(),(V).end()) #define REVERSE(V) reverse((V).begin(),(V).end()) #define INF ((1LL<<62)-(1LL<<31)) #define MOD 1000000007 using namespace std; int N,M,K,A,B,C,ans=0,cnt=0; string S,T; vector<int> P,Q; vector<pair<int,int>> PP; bool CAN=true; int main(){ cin>>S; int A[5]; REP(i,S.size()){ if(S.at(i)=='N') A[1]++; else if(S.at(i)=='S') A[2]++; else if(S.at(i)=='W') A[3]++; else if(S.at(i)=='E') A[4]++; } if(A[1]*A[2]=0 && A[1]+A[2]>0) CAN=false; if(A[3]*A[4]=0 && A[3]+A[4]>0) CAN=false; if(CAN) cout<<"Yes"<<endl; else cout<<"no"<<endl; }
a.cc: In function 'int main()': a.cc:38:10: error: lvalue required as left operand of assignment 38 | if(A[1]*A[2]=0 && A[1]+A[2]>0) CAN=false; | ~~~~^~~~~ a.cc:39:10: error: lvalue required as left operand of assignment 39 | if(A[3]*A[4]=0 && A[3]+A[4]>0) CAN=false; | ~~~~^~~~~
s514240775
p04019
C++
#include <bits/stdc++.h> int main(void) { std::string s; std::cin >> s; std::bool c[4] = {false, false, false, false}; for (int i = 0; i < s.length; i++) { if (s[i] == 'N') c[0] = true; if (s[i] == 'W') c[1] = true; if (s[i] == 'S') c[2] = true; if (s[i] == 'E') c[3] = true; } if (!c[0] && !c[2]) c[0] = c[1] = true; if (!c[1] && !c[3]) c[1] = c[3] = true; if (c[0] && c[1] && c[2] && c[3]) std::cout << "Yes\n"; else std::cout << "No\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:8: error: expected unqualified-id before 'bool' 6 | std::bool c[4] = {false, false, false, false}; | ^~~~ a.cc:7:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | for (int i = 0; i < s.length; i++) { | ~~^~~~~~ | () a.cc:8:22: error: 'c' was not declared in this scope 8 | if (s[i] == 'N') c[0] = true; | ^ a.cc:9:22: error: 'c' was not declared in this scope 9 | if (s[i] == 'W') c[1] = true; | ^ a.cc:10:22: error: 'c' was not declared in this scope 10 | if (s[i] == 'S') c[2] = true; | ^ a.cc:11:22: error: 'c' was not declared in this scope 11 | if (s[i] == 'E') c[3] = true; | ^ a.cc:13:8: error: 'c' was not declared in this scope 13 | if (!c[0] && !c[2]) c[0] = c[1] = true; | ^ a.cc:14:8: error: 'c' was not declared in this scope 14 | if (!c[1] && !c[3]) c[1] = c[3] = true; | ^ a.cc:16:7: error: 'c' was not declared in this scope 16 | if (c[0] && c[1] && c[2] && c[3]) std::cout << "Yes\n"; | ^
s540303968
p04019
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int main() { int w=0,e=0,n=0,s=0,ans=0; string s; cin>>s; rep(i,s.size()){ if(s[i]=='W'){ w=1; } if(s[i]=='E'){ e=1; } if(s[i]=='N'){ n=1; } if(s[i]=='S'){ s=1; } } if((n+s)%2==0){ ans++; } if((w+e)%2==0){ ans++; } if(ans==2){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } }
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:19: note: previous declaration as 'int s' 5 | int w=0,e=0,n=0,s=0,ans=0; | ^ a.cc:8:11: error: request for member 'size' in 's', which is of non-class type 'int' 8 | rep(i,s.size()){ | ^~~~ a.cc:3:39: note: in definition of macro 'rep' 3 | #define rep(i, n) for(int i = 0; i < (n); i++) | ^ a.cc:9:9: error: invalid types 'int[int]' for array subscript 9 | if(s[i]=='W'){ | ^ a.cc:12:9: error: invalid types 'int[int]' for array subscript 12 | if(s[i]=='E'){ | ^ a.cc:15:9: error: invalid types 'int[int]' for array subscript 15 | if(s[i]=='N'){ | ^ a.cc:18:9: error: invalid types 'int[int]' for array subscript 18 | if(s[i]=='S'){ | ^
s182984213
p04019
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int main() { int w=0,e=0,n=0,s=0,ans=0; string s; cin>>s; rep(i,s.size()){ if(s[i]=='W'){ w=1; } if(s[i]=='E'){ e=1; } if(s[i]=='N'){ n=1; } if(s[i]=='S'){ s=1; } } if(n+s%2==0){ ans++; } if(w+e%2==0){ ans++; } if(ans==2){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } }
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:19: note: previous declaration as 'int s' 5 | int w=0,e=0,n=0,s=0,ans=0; | ^ a.cc:8:11: error: request for member 'size' in 's', which is of non-class type 'int' 8 | rep(i,s.size()){ | ^~~~ a.cc:3:39: note: in definition of macro 'rep' 3 | #define rep(i, n) for(int i = 0; i < (n); i++) | ^ a.cc:9:9: error: invalid types 'int[int]' for array subscript 9 | if(s[i]=='W'){ | ^ a.cc:12:9: error: invalid types 'int[int]' for array subscript 12 | if(s[i]=='E'){ | ^ a.cc:15:9: error: invalid types 'int[int]' for array subscript 15 | if(s[i]=='N'){ | ^ a.cc:18:9: error: invalid types 'int[int]' for array subscript 18 | if(s[i]=='S'){ | ^
s658057554
p04019
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{ public: ll x, y; XY() {x = y = 0;} XY(ll u, ll v) {x = u; y = v;} }; template<typename T1, typename T2> void chmin(T1 &a, T2 b) {if(a > b) a = b;} template<typename T1, typename T2> void chmax(T1 &a, T2 b) {if(a < b) a = b;} template<typename T1, typename T2> ll mypow(T1 a, T2 n){ if(n == 0) return 1; if(n == 1) return a; if(n % 2) return a * mypow(a, n - 1); ll tmp = mypow(a, n / 2); return tmp * tmp; } template<typename T> int BS(vector<T> V, int left, int right, T key){ int mid = (left + right) / 2; if(V[mid] <= key) left = mid; else right = mid; if(right - mid == 1) return left; else return BS(V, left, right, key); } ll comb(ll n, ll r){ ll res = 1; rep(i, 0, r){ res *= n - i; res /= i + 1; } return res; } ///////////////////////////////////////////////////////// void Main() { string S; cin >> S; int N, S, W, E; N = S = W = E = 0; rep(i, 0, S.size()){ if(S[i] == 'N') N++; if(S[i] == 'S') S++; if(S[i] == 'E') E++; if(S[i] == 'W') W++; } string res; if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; else res = "No"; cout << res << endl; } ///////////////////////////////////////////////////////// int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << std::fixed << std::setprecision(15); Main(); }
a.cc: In function 'void Main()': a.cc:56:10: error: conflicting declaration 'int S' 56 | int N, S, W, E; | ^ a.cc:55:10: note: previous declaration as 'std::string S' 55 | string S; cin >> S; | ^ a.cc:57:9: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assignment 57 | N = S = W = E = 0; | ~~^~~~~~~~~~~ | | | std::__cxx11::basic_string<char> a.cc:60:22: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 60 | if(S[i] == 'S') S++; | ~^~ a.cc:65:8: error: no match for 'operator&&' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ~ ^~ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} a.cc:65:8: note: candidate: 'operator&&(bool, bool)' (built-in) 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ~~^~~~ a.cc:65:8: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:65:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:65:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:65:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ a.cc:65:28: error: no match for 'operator&&' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ~ ^~ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} a.cc:65:28: note: candidate: 'operator&&(bool, bool)' (built-in) 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ~~^~~~ a.cc:65:28: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:31: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:65:31: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 65 | if(N && S && E && W || N && S && !E && !W || !N && !S && E && W) res = "Yes"; | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__lo
s923451596
p04019
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0,w=0,s=0,e=0; for(int i=0;i<s.size();i++){ if(s[i]=='N'){ n++; } if(s[i]=='W'){ w++; } if(s[i]=='S'){ s++; } if(s[i]=='E'){ e++; } } bool c=true; if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ c=false; } if(c){ cout << "Yes" << endl; } else{ cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:6:15: error: conflicting declaration 'int s' 6 | int n=0,w=0,s=0,e=0; | ^ a.cc:4:10: note: previous declaration as 'std::string s' 4 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 15 | s++; | ~^~ a.cc:22:26: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const _CharT*' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:27: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:27: note: mismatched types 'const _CharT*' and 'int' 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:27: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 22 | if((n+w!=0&&n*w==0)||(s+e!=0&&s*e==0)){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.
s582210784
p04019
C++
#include<bits/stdc++.h>//万能头文件 using namespace std; int w=0,n=0,e=0,s=0; string str; inline bool check()//判断是否符合条件 { if(w==n&&n==e&&e==s&&s==w)return 1; if((w+e)=>2&&(n+s)==0)return 1; if((n+s)=>2&&(w+e)==0)return 1; if((n+s)=>2&&(w+e)=>2)return 1; return 0; /* if(w==1&&e==1&&n==1&&s==1)return 1; if(w==1&&e==1&&n==0&&s==0)return 1; if(w==0&&e==0&&n==1&&s==1)return 1; if(w==0&&e==0&&n==0&&s==0)return 1; return 0; */ } int main() { getline(cin,str); for(int i=0;str[i]!='\0';i++) { if(str[i]=='W')w++; else if(str[i]=='N')n++; else if(str[i]=='E')e++;//累加 else if(str[i]=='S')s++;//if_else是连续结构,不用加大括号 } puts(check()?"Yes":"No");//如果check的返回值为1输出Yes,否则输出No return 0;//圆满的结束 }
a.cc: In function 'bool check()': a.cc:8:18: error: expected primary-expression before '>' token 8 | if((w+e)=>2&&(n+s)==0)return 1; | ^ a.cc:9:18: error: expected primary-expression before '>' token 9 | if((n+s)=>2&&(w+e)==0)return 1; | ^ a.cc:10:18: error: expected primary-expression before '>' token 10 | if((n+s)=>2&&(w+e)=>2)return 1; | ^ a.cc:10:28: error: expected primary-expression before '>' token 10 | if((n+s)=>2&&(w+e)=>2)return 1; | ^
s520806371
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin>>S; int Ncount=0; int Wcount=0; int Scount=0; int Ecount=0; bool Z=true; for(int i=0;i<S.size();i+;){ if(S.at(i)=='N'){ Ncount++; } if(S.at(i)=='W'){ Wcount++; } if(S.at(i)=='S'){ Scount++; } if(S.at(i)=='E'){ Ecount++; } } if(Ncount>0){ if(Scount==0){ Z=false; } }if(Wcount>0){ if(Ecount==0){ Z=false; } } if(Scount>0){ if(Ncount==0){ Z=false; } } if(Ecount>0){ if(Wcount==0){ Z=false; } } if(Z){ cout<<"Yes"; } else{ cout<<"No"; } }
a.cc: In function 'int main()': a.cc:11:28: error: expected primary-expression before ';' token 11 | for(int i=0;i<S.size();i+;){ | ^ a.cc:11:28: error: expected ')' before ';' token 11 | for(int i=0;i<S.size();i+;){ | ~ ^ | ) a.cc:11:29: error: expected primary-expression before ')' token 11 | for(int i=0;i<S.size();i+;){ | ^
s417571170
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<s.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:11:9: error: invalid types 'int[int]' for array subscript 11 | if(S[i]=='N') N=1; | ^ a.cc:12:9: error: invalid types 'int[int]' for array subscript 12 | if(S[i]=='E') E=1; | ^ a.cc:13:9: error: invalid types 'int[int]' for array subscript 13 | if(S[i]=='W') W=1; | ^ a.cc:14:9: error: invalid types 'int[int]' for array subscript 14 | if(S[i]=='S') S=1; | ^
s894718560
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<S.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:9:7: error: conflicting declaration 'int S' 9 | int S=-1; | ^ a.cc:5:10: note: previous declaration as 'std::string S' 5 | string S; cin >> S; | ^ a.cc:16:7: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 16 | if(N*S<0 || E*W<0){ | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::complex<_Tp>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::complex<_Tp>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed: a.cc:16:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | if(N*S<0 || E*W<0){ | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::valarray<_Tp>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:8: note: mismatched types 'const std::valarray<_Tp>' and 'int' 16 | if(N*S<0 || E*W<0){ | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 16 | if(N*S<0 || E*W<0){ | ^
s612945456
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ srting S; cin >> S; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<S.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout << "YES" << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'srting' was not declared in this scope 5 | srting S; cin >> S; | ^~~~~~ a.cc:5:20: error: 'S' was not declared in this scope 5 | srting S; cin >> S; | ^
s199660059
p04019
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) int main(){ string s; cin >> s; set<int> s; rep(i,n){ if(s[i]=='N') s.insert(0); if(s[i]=='W') s.insert(1); if(s[i]=='S') s.insert(2); if(s[i]=='E') s.insert(3); } if(s.count(0)!=s.count(2) || s.count(1)!=s.count(3)){ cout << "Yes" << endl; } else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:12: error: conflicting declaration 'std::set<int> s' 12 | set<int> s; | ^ a.cc:10:10: note: previous declaration as 'std::string s' 10 | string s; | ^ a.cc:13:9: error: 'n' was not declared in this scope 13 | rep(i,n){ | ^ a.cc:6:32: note: in definition of macro 'rep' 6 | #define rep(i,n) for(int i=0;i<n;i++) | ^ a.cc:14:27: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int)' 14 | if(s[i]=='N') s.insert(0); | ~~~~~~~~^~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2086 | insert(size_type __pos1, const _Tp& __svt, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [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; size_type = long unsigned int]' 1831 | insert(const_iterator __p, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [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]' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1939 | insert(size_type __pos1, const basic_string& __str) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1963 | insert(size_type __pos1, const basic_string& __str, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1987 | insert(size_type __pos, const _CharT* __s, size_type __n) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2007 | insert(size_type __pos, const _CharT* __s) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2032 | insert(size_type __pos, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [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]' 2051 | insert(__const_iterator __p, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate expects 2 arguments, 1 provided a.cc:15:27: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int)' 15 | if(s[i]=='W') s.insert(1); | ~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2086 | insert(size_type __pos1, const _Tp& __svt, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [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; size_type = long unsigned int]' 1831 | insert(const_iterator __p, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [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]' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ^~~~~~ /usr/
s750409338
p04019
C++
#include<iostream> #include<vector> using namespace std; string s; int main(){ cin>>s; bool okn = (count(s.begin(),s.end(),'N')!=0)?true:false; bool oks = (count(s.begin(),s.end(),'S')!=0)?true:false; bool okw = (count(s.begin(),s.end(),'W')!=0)?true:false; bool oke = (count(s.begin(),s.end(),'E')!=0)?true:false; cout<<((okn==oks)&&(okw==oke)?"Yes":"No")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'count' was not declared in this scope 9 | bool okn = (count(s.begin(),s.end(),'N')!=0)?true:false; | ^~~~~
s107259336
p04019
C++
#include<bits/stdc++.h> using namespace std; const int N=1e5+10; int e,Pri[N>>1],n,f; long long prc[N],a[N],w[N],c[N]; bool pri[N],flag; map <long long,int> cot; inline int Read() { int x=0,f=1; char ch=getchar(); while (ch<'0'||ch>'9') {if (ch=='-') f=-f; ch=getchar();} while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar(); return x*f; } void P(){ pri[0]=pri[1]=1; for(long long i=2;i<=1e5;i++){ if(!pri[i]){ pri[i]=1; Pri[++e]=i; prc[i]=i*i; } for(int j=1;j<=e&&i*Pri[j]<=1e5;j++){ pri[i*Pri[j]]=1; if(!(i%Pri[j])) break; } } } int main(){ cin>>n; for(int i=1;i<=n;i++) a[i]=read();//scanf("%lld",&a[i]); P(); for(int i=1;i<=n;i++){ w[i]=1; long long W=1; for(int j=1;j<=e&&Pri[j]<=a[i];j++) if(!(a[i]%Pri[j])) { long long v=prc[Pri[j]]*Pri[j]; while(!(a[i]%v)) a[i]/=v; if(!(a[i]%prc[Pri[j]])) W*=Pri[j]; else if(!(a[i]%Pri[j])) W*=prc[Pri[j]]; } if(!cot[a[i]]&&a[i]!=1){ c[++f]=a[i]; w[f]=W; } if(a[i]==1) flag=1; cot[a[i]]++; } long long ans=0; for(int i=1;i<=f;i++) if(cot[c[i]]){ ans+=max(cot[c[i]],cot[w[i]]); cot[c[i]]=cot[w[i]]=0; } if(flag) ans++; cout<<ans; }
a.cc: In function 'int main()': a.cc:30:40: error: too few arguments to function 'ssize_t read(int, void*, size_t)' 30 | for(int i=1;i<=n;i++) a[i]=read();//scanf("%lld",&a[i]); | ~~~~^~ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/14/csignal:42, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116, from a.cc:1: /usr/include/unistd.h:371:16: note: declared here 371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur | ^~~~
s060256478
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; int n, s, w, e; n = s = w = e = 0; cin >> s; for(int i = 0; i < s.length(); i++){ if(s[i] == 'N') n++; else if(s[i] == 'E') e++; else if(s[i] == 'S') s++; else w++; } if(n == 0 && s == 0) { if(w != 0 && e != 0) cout << "Yes" << endl; else cout << "No" << endl; } else if(n != 0 && s != 0) { if((w != 0 && e != 0)||(w == 0 && e == 0)) cout << "Yes" << endl; else cout << "No" << endl; } else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'int s' 6 | int n, s, w, e; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:7:9: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assignment 7 | n = s = w = e = 0; | ~~^~~~~~~~~~~ | | | std::__cxx11::basic_string<char> a.cc:12:27: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 12 | else if(s[i] == 'S') s++; | ~^~ a.cc:15:18: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 15 | if(n == 0 && s == 0) { | ~ ^~ ~ | | | | | 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:15:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:15:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:15:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 15 | if(n == 0 && s == 0) { | ^ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 15 | if(n == 0 && s == 0) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | if(n == 0 && s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | if(n == 0 && s == 0) { | ^ 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:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 15 | if(n == 0 && s == 0) { | ^ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:15:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 15 | if(n == 0 && s == 0) {
s780535332
p04019
C
#include<stdio.h> int main(void){ int Go[1000],i,N=0,S=0,E=0,W=0; scanf("%s",S); for(i = 0;Go[i] != '\0';i++){ if(Go[i] == 'N'){ N = 1; }else if(Go[i] == 'S'){ S = 1; }else if(Go[i] == 'E'){ E = 1; }else if(Go[i] == 'W'){ W = 1; } } if((N = 1 && S = 0)||(N = 0 && S = 1)){ printf("No"); }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ printf("No"); }else{ printf("Yes"); } return 0; }
main.c: In function 'main': main.c:20:18: error: lvalue required as left operand of assignment 20 | if((N = 1 && S = 0)||(N = 0 && S = 1)){ | ^ main.c:20:36: error: lvalue required as left operand of assignment 20 | if((N = 1 && S = 0)||(N = 0 && S = 1)){ | ^ main.c:22:24: error: lvalue required as left operand of assignment 22 | }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ | ^ main.c:22:42: error: lvalue required as left operand of assignment 22 | }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ | ^
s283966890
p04019
C
#include<stdio.h> int main(void){ int S[1000],i,N=0,S=0,E=0,W=0; scanf("%s",S); for(i = 0;S[i] != '\0';i++){ if(S[i] == 'N'){ N = 1; }else if(S[i] == 'S'){ S = 1; }else if(S[i] == 'E'){ E = 1; }else if(S[i] == 'W'){ W = 1; } } if((N = 1 && S = 0)||(N = 0 && S = 1)){ printf("No"); }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ printf("No"); }else{ printf("Yes"); } return 0; }
main.c: In function 'main': main.c:5:21: error: conflicting types for 'S'; have 'int' 5 | int S[1000],i,N=0,S=0,E=0,W=0; | ^ main.c:5:7: note: previous declaration of 'S' with type 'int[1000]' 5 | int S[1000],i,N=0,S=0,E=0,W=0; | ^ main.c:22:24: error: lvalue required as left operand of assignment 22 | }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ | ^ main.c:22:42: error: lvalue required as left operand of assignment 22 | }else if((E = 1 && W = 0)||(E = 0 && W = 1)){ | ^
s088706137
p04019
C++
#include<bist/stdc++.h> using namespace std; int main(){ string S;cin >> S; int N = S.size(); bitset<4>bs; for(int i = 0; i < N; ++i){ switch(S[i]){ case 'S':bs[0]=1;break; case 'N':bs[1]=1;break; case 'W':bs[2]=1;break; case 'E':bs[3]=1;break; } } bool f = bs[0] == bs[1]; f |= bs[2] == bs[3]; cout << (f?"Yes\n":"No\n"); return 0; }
a.cc:1:9: fatal error: bist/stdc++.h: No such file or directory 1 | #include<bist/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s909033537
p04019
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; int main() { int a[4]={0}; string s; cin >> s; for(int i=0; i<s.size(); i++) { if(s[i]=='S') { a[0]=1; } if(s[i]=='N') { a[1]=1; } if(s[i]=='W') { f[2]=1; } if(s[i]=='E') { f[3]=1; } } if(a[0]==a[1]&&a[2]==a[3]) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:17:7: error: 'f' was not declared in this scope 17 | f[2]=1; | ^ a.cc:20:7: error: 'f' was not declared in this scope 20 | f[3]=1; | ^
s552179085
p04019
C++
#include<bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; int n=S.size(),a=0,b=0,c=0,d=0; for(int i=0;i<N;i++){ if(S.at(i)=='N')a++; if(S.at(i)=='S')b++; if(S.at(i)=='E')c++; if(S.at(i)=='W')d++; } int check1=0,check2=0; if((a==0 && b==0) or (a>0 && b>0))check1=1; if((c==0 && d==0) or (c>0 && d>0))check2=1; if(check1*check2==0)cout<<"No"<<endl; else cout<<"Yes"<<endl; }
a.cc: In function 'int main()': a.cc:6:17: error: 'N' was not declared in this scope 6 | for(int i=0;i<N;i++){ | ^
s448114892
p04019
C++
#include <iostream> #include <stack> using namespace std; int main(int argc, const char *argv[]) { string s; cin >> s; bool n, s, e, w; for (int i = 0; i < s.length(); i++) { switch (s[i]) { case 'N': n = true; break; case 'W': w = true; break; case 'S': s = true; break; case 'E': e = true; break; } } if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) { cout << "No" << endl; } else { cout << "Yes" << endl; } }
a.cc: In function 'int main(int, const char**)': a.cc:9:13: error: conflicting declaration 'bool s' 9 | bool n, s, e, w; | ^ a.cc:7:12: note: previous declaration as 'std::string s' 7 | string s; | ^ a.cc:29:21: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ~ ^~ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:29:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:29:24: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:29:24: note: mismatched types 'const _CharT*' and 'int' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:29:24: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 29 | if ((n > 0 && s == 0) || (n == 0 && s > 0) || (e > 0 && w == 0) || (w > 0 && e == 0)) | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:29:24: note: 'std::string' {aka
s067805729
p04019
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdlib> #include <cmath> #include <queue> #include <vector> #include <set> #include <map> #include <numeric> #include <iomanip> #include <tuple> using namespace std; int main(){ string S; cin>>S; int n=0,s=0,e=0,w=0; for(int i=0;i<S.size();i++){ if(S[i]=='N')n++; else if(S[i]=='S')s++; else if(S[i]=='E')e++; else w++; } bool ns=false,ew=false; if(n>0 && s>0)ns=true; if(n==0 && s==0)ns=true; if(e>0 && w>0)ew=true; if(e==0 && w==0)ew=true; if((ns && ew)cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:32:17: error: expected ';' before 'cout' 32 | if((ns && ew)cout<<"Yes"<<endl; | ^~~~ | ; a.cc:33:4: error: expected primary-expression before 'else' 33 | else cout<<"No"<<endl; | ^~~~ a.cc:32:35: error: expected ')' before 'else' 32 | if((ns && ew)cout<<"Yes"<<endl; | ~ ^ | ) 33 | else cout<<"No"<<endl; | ~~~~
s590959979
p04019
C++
#include <iostream> #include <string> #include <iomanip> #include <ios> using namespace std; int main(void){ string word; cin >> word; int n = 0; int s = 0; int e = 0; int w = 0; int n = word.length(); for(int i=0;i<n;i++){ if(word[i] == 'n') n++; if(word[i] == 's') s++; if(word[i] == 'e') e++; if(word[i] == 'w') w++; } if(n == 0 && s == 0 ||n * s != 0){ if(e == 0 && w == 0 ||e * w != 0){ cout << "Yes" << endl; } else cout << "No" << endl; } else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:7: error: redeclaration of 'int n' 15 | int n = word.length(); | ^ a.cc:10:7: note: 'int n' previously declared here 10 | int n = 0; | ^
s654823094
p04019
C++
#include <stdc++.h> using namespace std; int main(){ string N; cin >> N; int n=0,s=0,e=0,w=0; for(int i = 0; i < N.size(); i++){ if(N[i] == 'N'){ n++; } else if(N[i] == 'S'){ s++; } else if(N[i] == 'E'){ e++; } else{ w++; } } bool can = true; if(n > 0 ){ if(s == 0){ can = false; } } if(s>0 ){ if(n == 0){ can = false; } } if(e > 0){ if(w==0){ can = false; } } if(w >0){ if(e==0){ can = false; } } if(can){ cout << "Yes" << endl; } else{ cout << "No" << endl; } return 0; }
a.cc:1:10: fatal error: stdc++.h: No such file or directory 1 | #include <stdc++.h> | ^~~~~~~~~~ compilation terminated.
s428982184
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string dir; cin >> dir; int east = 0, west = 0, north = 0, south = 0,size = dir.size(); for (int i = 0; i < size; i++) { if (dir.at(i) == "N") north++; else if ("S" == dir.at(i)) south++; else if ("E" == dir.at(i)) east++; else if ("W" == dir.at(i)) west++; } if ((north>0&&south==0)||(north==0&&south>0)||(east>0&&west==0)||(west==0&&east>0)) cout << "No" << endl; else cout << "Yes" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if (dir.at(i) == "N") | ~~~~~~~~~~^~~~~~ a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | else if ("S" == dir.at(i)) | ~~~~^~~~~~~~~~~~ a.cc:13:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | else if ("E" == dir.at(i)) | ~~~~^~~~~~~~~~~~ a.cc:15:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | else if ("W" == dir.at(i)) | ~~~~^~~~~~~~~~~~
s004544535
p04019
C++
include <bits/stdc++.h> using namespace std; int main() { string s; int i, cntn = 0, cnts = 0, cnte = 0, cntw = 0; cin >> s; for(i = 0; i < s.size(); i++) { if(s.at(i) == 'N') { cntn++; } else if(s.at(i) == 'S') { cnts++; } else if(s.at(i) == 'E') { cnte++; } else cntw++; } if ((cntn == 0 && cnts != 0) || (cntn != 0 && cnts == 0) || (cnte == 0 && cntw != 0) || (cnte != 0 && cntw == 0)) { cout << "No" << endl; } else { cout << "Yes" << endl; } }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> s; | ^~~ a.cc:8:10: error: 's' was not declared in this scope 8 | cin >> s; | ^ a.cc:30:5: error: 'cout' was not declared in this scope 30 | cout << "No" << endl; | ^~~~ a.cc:30:21: error: 'endl' was not declared in this scope 30 | cout << "No" << endl; | ^~~~ a.cc:34:5: error: 'cout' was not declared in this scope 34 | cout << "Yes" << endl; | ^~~~ a.cc:34:22: error: 'endl' was not declared in this scope 34 | cout << "Yes" << endl; | ^~~~
s662866743
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; int i, cntn = 0, cnts = 0, cnte = 0, cntw = 0; cin >> s; for(i = 0; i < s.size(); i++){ if(s.at(i) == 'N') cntn++; else if(s.at(i) == 'S') cnts++; else if(s.at(i) == 'E') cnte++; else cntw+; } if((cntn == 0 && cnts != 0) || (cntn != 0 && cnts == 0) || (cnte == 0 && cntw != 0) || (cnte != 0 && cntw == 0)){ cout << "No" << endl; } else{ cout << "Yes" << endl; } }
a.cc: In function 'int main()': a.cc:13:15: error: expected primary-expression before ';' token 13 | else cntw+; | ^
s221903453
p04019
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String text = in.next(); in.close(); boolean u = text.contains("N"); boolean d = text.contains("S"); boolean r = text.contains("E"); boolean l = text.contains("W"); String dis = (u && d && r && l) || ((u && d) ^ (r && l)) ? "Yes" : "No"; System.out.println(dis); } }
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s800675192
p04019
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String text = in.next(); in.close(); String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ? "Yes" : "No"; System.out.println(dis); } }
Main.java:8: error: cannot find symbol String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ^ symbol: method contains(String) location: class Main Main.java:8: error: cannot find symbol String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ^ symbol: method contains(String) location: class Main Main.java:8: error: cannot find symbol String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ^ symbol: method contains(String) location: class Main 3 errors
s522531105
p04019
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;} int divCeil(int A, int B) {return (A + (B - 1)) / B;} long long divCeil(long long A, int B) {return (A + (B - 1)) / B;} long long divCeil(int A, long long B) {return (A + (B - 1)) / B;} long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;} int main() { string St; cin >> St; int N = St.size(); string ans = "Yes"; int N = 0, W = 0, S = 0, E = 0; for (int i = 0; i < N; i++) { if (St.at(i) == 'N') N++; else if (St.at(i) == 'W') W++; else if (St.at(i) == 'S') S++; else if (St.at(i) == 'E') E++; } if (N * S == 0 && N + S > 0) ans = "No"; else if (W * E == 0 && W + E > 0) ans = "No"; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:21:7: error: redeclaration of 'int N' 21 | int N = 0, W = 0, S = 0, E = 0; | ^ a.cc:18:7: note: 'int N' previously declared here 18 | int N = St.size(); | ^
s041257519
p04019
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;} int divCeil(int A, int B) {return (A + (B - 1)) / B;} long long divCeil(long long A, int B) {return (A + (B - 1)) / B;} long long divCeil(int A, long long B) {return (A + (B - 1)) / B;} long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;} int main() { string S; cin >> S; int N = S.size(); string ans = "Yes"; int N = 0, W = 0, S = 0, E = 0; for (int i = 0; i < N; i++) { if (S.at(i) == 'N') N++; else if (S.at(i) == 'W') W++; else if (S.at(i) == 'S') S++; else if (S.at(i) == 'E') E++; } if (N * S == 0 && N + S > 0) ans = "No"; else if (W * E == 0 && W + E > 0) ans = "No"; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:21:7: error: redeclaration of 'int N' 21 | int N = 0, W = 0, S = 0, E = 0; | ^ a.cc:18:7: note: 'int N' previously declared here 18 | int N = S.size(); | ^ a.cc:21:21: error: conflicting declaration 'int S' 21 | int N = 0, W = 0, S = 0, E = 0; | ^ a.cc:16:10: note: previous declaration as 'std::string S' 16 | string S; | ^ a.cc:26:31: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 26 | else if (S.at(i) == 'S') S++; | ~^~ a.cc:30:9: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ~ ^ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::complex<_Tp>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::complex<_Tp>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed: a.cc:30:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:30:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:30:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:30:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:30:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ a.cc:30:23: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ~ ^ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:30:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 30 | if (N * S == 0 && N + S > 0) ans = "No"; | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:30:25: note: 'std::string' {aka 'std::__cxx11::
s488062380
p04019
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdalign> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif #define y0 qvya13579 #define y1 qvyb24680 #define j0 qvja13579 #define j1 qvjb24680 #define next qvne13579xt #define prev qvpr13579ev #define INF 1000000007 #define MOD 1000000007 #define PI acos(-1.0) #define endl "\n" #define IOS cin.tie(0);ios::sync_with_stdio(false) #define M_P make_pair #define PU_B push_back #define PU_F push_front #define PO_B pop_back #define PO_F pop_front #define U_B upper_bound #define L_B lower_bound #define B_S binary_search #define PR_Q priority_queue #define FIR first #define SEC second #if __cplusplus < 201103L #define stoi(argument_string) atoi((argument_string).c_str()) #endif #define REP(i,n) for(int i=0;i<(int)(n);++i) #define REP_R(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=((int)(m));i<(int)(n);++i) #define FOR_R(i,m,n) for(int i=((int)(m)-1);i>=(int)(n);--i) #define ALL(v) (v).begin(),(v).end() #define RALL(v) (v).rbegin(),(v).rend() #define SIZ(x) ((int)(x).size()) #define COUT(x) cout<<(x)<<endl #define CIN(x) cin>>(x) #define CIN2(x,y) cin>>(x)>>(y) #define CIN3(x,y,z) cin>>(x)>>(y)>>(z) #define CIN4(x,y,z,w) cin>>(x)>>(y)>>(z)>>(w) #define SCAND(x) scanf("%d",&(x)) #define SCAND2(x,y) scanf("%d%d",&(x),&(y)) #define SCAND3(x,y,z) scanf("%d%d%d",&(x),&(y),&(z)) #define SCAND4(x,y,z,w) scanf("%d%d%d%d",&(x),&(y),&(z),&(w)) #define SCANLLD(x) scanf("%lld",&(x)) #define SCANLLD2(x,y) scanf("%lld%lld",&(x),&(y)) #define SCANLLD3(x,y,z) scanf("%lld%lld%lld",&(x),&(y),&(z)) #define SCANLLD4(x,y,z,w) scanf("%lld%lld%lld%lld",&(x),&(y),&(z),&(w)) #define PRINTD(x) printf("%d\n",(x)) #define PRINTLLD(x) printf("%lld\n",(x)) typedef long long int lli; using namespace std; bool compare_by_2nd(pair<int,int> a, pair<int,int> b) { if( a.second != b.second ) { return a.second < b.second; } else { return a.first < b.first; } } int ctoi(char c) { if( c >= '0' and c <= '9' ) { return (int)(c-'0'); } return -1; } int alphabet_pos(char c) { if( c >= 'a' and c <= 'z' ) { return (int)(c-'a'); } return -1; } int alphabet_pos_capital(char c) { if( c >= 'A' and c <= 'Z' ) { return (int)(c-'A'); } return -1; } vector<string> split(string str, char ch) { int first = 0; int last = str.find_first_of(ch); if(last == string::npos) { last = SIZ(str); } vector<string> result; while( first < SIZ(str) ) { string Ssubstr(str, first, last - first); result.push_back(Ssubstr); first = last + 1; last = str.find_first_of(ch, first); if(last == string::npos) { last = SIZ(str); } } return result; } int gcd( int a , int b ) // assuming a,b >= 1 { if( a < b ) { return gcd( b , a ); } if( a % b == 0 ) { return b; } return gcd( b , a % b ); } int lcm( int a , int b ) // assuming a,b >= 1 { return a * b / gcd( a , b ); } lli pow_fast( lli x, lli n_power , lli modulus ) { if( n_power == 0 ) { return 1; } if( n_power % 2 == 0) { return pow_fast( x * x % modulus , n_power / 2 , modulus ); } return x * pow_fast( x , n_power - 1 , modulus ) % modulus; } struct UnionFind //size-based { vector<int> parent, treesize; UnionFind( int size ) : parent( size ) , treesize( size , 1 ) //constructor { for( int i = 0 ; i < size ; ++ i ) { parent[i] = i; } } int root( int x ) { if( parent[x] == x ) { return x; } return parent[x] = root(parent[x]); } void unite( int x, int y ) { x = root(x); y = root(y); if( x == y ) { return; } if( treesize[x] < treesize[y] ) { parent[x] = y; treesize[y] += treesize[x]; } else { parent[y] = x; treesize[x] += treesize[y]; } } bool sametree( int x, int y ) { return root(x) == root(y); } int gettreesize( int x ) { return treesize[root(x)]; } }; /*------------------ the end of the template -----------------------*/ int dir(char c) { switch(c) { case 'N': return 0; break; case 'E': return 1; break; case 'S': return 2; break; case 'W': return 3; break; } } int main() { IOS; /* making cin faster */ string S; CIN(S); vector<bool> flag(4,false); REP(i,N) { if( flag[(dir(S[i])+2)%4] ) { flag[(dir(S[i])+2)%4] = false; } else { flag[dir(S[i])] = true; } } if( flag[0] or flag[1] or flag[2] or flag[3] ) { COUT("Yes"); } else { COUT("No"); } }
a.cc: In function 'int main()': a.cc:349:9: error: 'N' was not declared in this scope 349 | REP(i,N) | ^ a.cc:108:38: note: in definition of macro 'REP' 108 | #define REP(i,n) for(int i=0;i<(int)(n);++i) | ^ a.cc: In function 'int dir(char)': a.cc:334:1: warning: control reaches end of non-void function [-Wreturn-type] 334 | } | ^
s384792563
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool s = 0, n = 0, w = 0, e = 0; for(int i = 0; i < s.size(); i++) { if(s[i] == 'S') { s = 1; } if(s[i] == 'E') { e = 1; } if(s[i] == 'W') { w = 1; } if(s[i] == 'N') { n = 1; } } bool f = 1; if(s == 0) { if(n) f = 0; } if(n == 0) { if(s) f = 0; } if(w == 0) { if(e) f = 0; } if(e == 0) { if(w) f = 0; } if(f) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: conflicting declaration 'bool s' 7 | bool s = 0, n = 0, w = 0, e = 0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:23:8: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 23 | if(s == 0) { | ~ ^~ ~ | | | | | 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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:23:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:23:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:23:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 23 | if(s == 0) { | ^ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 23 | if(s == 0) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 23 | if(s == 0) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 23 | if(s == 0) { | ^ 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:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 23 | if(s == 0) { | ^ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 23 | if(s == 0) { | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:23:11: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 23 | if(s == 0) { | ^
s329704733
p04019
C++
#include<iostream> using namespace std; int main() { string S; cin >> S; bool A = false; bool B = false; bool C = false; bool D = false; for(int i = 0;i < S.size;i++) { if(S.at(i) == 'N') { A = true; } if(S.at(i) == 'W') { B = true; } if(S.at(i) == 'S') { C = true; } if(S.at(i) == 'E') { D = true; } } if(A == true && B == true && C == true && D == true) { cout << "Yes" << endl; } else { cour << "No" << endl; } }
a.cc: In function 'int main()': a.cc:11:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 11 | for(int i = 0;i < S.size;i++) { | ~~^~~~ | () a.cc:29:5: error: 'cour' was not declared in this scope 29 | cour << "No" << endl; | ^~~~
s406966080
p04019
C++
bool fl = false;
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s792390823
p04019
C++
#include <bits/stdc++.h> #define F first #define S second #define all(a) a.begin(),a.end() #define setDP(arr) memset(arr,-1,sizeof arr) #define Clear(arr) memset(arr,0,sizeof arr) #define oo 2000000000 #define inf 1000000000000000000 #define P1 31 #define P2 37 #define M 1000000007 #define M2 1000000009 #define pii pair<ll,ll> typedef long long ll; using namespace std; const int N = 255001; const int SQRTN = 320; const int LOGN = 20; const long double PI = acos(-1); const long double TAU = 2*PI; string s; signed main(){ cin >> s; int x=0,y=0; for(int i = 0 ; i < n ; i++){ if(s[i]=='E')x|=1; if(s[i]=='W')x|=2; if(s[i]=='N')y|=1; if(s[i]=='S')y|=2; } if(x==1||x==2||y==1||y==2)return puts("No"),0; puts("Yes"); }
a.cc: In function 'int main()': a.cc:27:25: error: 'n' was not declared in this scope 27 | for(int i = 0 ; i < n ; i++){ | ^
s856693812
p04019
C++
#include <bits/stdc++.h> #define F first #define S second #define all(a) a.begin(),a.end() #define setDP(arr) memset(arr,-1,sizeof arr) #define Clear(arr) memset(arr,0,sizeof arr) #define oo 2000000000 #define inf 1000000000000000000 #define P1 31 #define P2 37 #define M 1000000007 #define M2 1000000009 #define pii pair<ll,ll> typedef long long ll; using namespace std; const int N = 255001; const int SQRTN = 320; const int LOGN = 20; const long double PI = acos(-1); const long double TAU = 2*PI; string s; signed main(){ cin >> s; int x=0,y; for(int i = 0 ; i < n ; i++){ if(s[i]=='E')x|=1; if(s[i]=='W')x|=2; if(s[i]=='N')y|=1; if(s[i]=='S')y|=2; } if(x==1||x==2||y==1||y==2)return puts("No"),0; puts("Yes"); }
a.cc: In function 'int main()': a.cc:27:25: error: 'n' was not declared in this scope 27 | for(int i = 0 ; i < n ; i++){ | ^
s855322461
p04019
C++
#include<iostream> using namespace std; int main() { string s; cin>>s; int e=0,w=0,S=0,n=0; for(int i=0;i<s.size();i++) { if(s[i]=='E') e=1; else if(s[i]=='W') { w=1; } else if(s[i]=='S') S=1; else if(s[i]=='N') n=1; } if(e!=w||S!=n)) { cout<<"No"; } else { cout<<"Yes"; } return 0; }
a.cc: In function 'int main()': a.cc:21:23: error: expected primary-expression before ')' token 21 | if(e!=w||S!=n)) | ^
s987231649
p04019
C++
#include<iostream using namespace std; int main() { cout<<"Yes"; return 0; }
a.cc:1:18: error: missing terminating > character 1 | #include<iostream | ^
s781257770
p04019
C++
#include<bits/stdc++.h> #define reg register using namespace std; string ss; int w,n,e,s; inline bool check() { if(w==1&&e==1&&n==1&&s==1)return 1; if(w==1&&e==1&&n==0&&s==0)return 1; if(w==0&&e==0&&n==1&&s==1)return 1; if(w==0&&e==0&&n==0&&s==0)return 1; return 0; } int nain() { getline(cin,ss); for(reg int i=0;i<ss.length();i++) if(ss[i]=='W')w++; else if(ss[i]=='N')n++; else if(ss[i]=='E')e++; else if(ss[i]=='S')s++; puts(check()?"Yes":"No"); return 0; }
a.cc: In function 'int nain()': a.cc:17:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | for(reg int i=0;i<ss.length();i++) | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s934515913
p04019
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.rend()) #define ll long long #define pb(a) push_back(a) #define INF 1000000000 #define MOD 1000000007 using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; typedef vector<unsigned int>vec; typedef vector<vec> mat; //typedef tuple<ll, ll, ll> T; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } void add(ll& a, ll b){a = (a+b) % MOD;} int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N=0,S=0,W=0,E=0; string s;cin>>s; REP(i,s.size()){ if(s[i]=='N') N++; if(s[i]=='S') S++; if(s[i]=='W') W++; if(s[i]=='E') E++; } if(H>0&&S>0){ if(W>0&&S>0){ cout<<"Yes"; } else if(W==0&&S==0) cout<<"Yes"; else cout<<"No"; } else if(W>0&&E>0){ if(N>0&&S>0){ cout<<"Yes"; } else if(N==0&&S==0) cout<<"Yes"; else cout<<"No"; } }
a.cc: In function 'int main()': a.cc:39:8: error: 'H' was not declared in this scope 39 | if(H>0&&S>0){ | ^
s373424664
p04019
C++
#include <bits/stdc++.h> #define il inline #define ri register int #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l+r)>>1) #define MAXN 1050 #define MAXM #define mod #define inf (1<<30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for(ri i = x; i <= y; ++i) #define repd(i, x, y) for(ri i = x; i >= y; --i) #define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair <int, int> pii; typedef pair <ll, int> pli; typedef pair <int, ll> pil; typedef pair <ll, ll> pll; template <typename T> il bool chkmin(T &x, T y) {return x > y ? x = y, 1 : 0;} template <typename T> il bool chkmax(T &x, T y) {return x < y ? x = y, 1 : 0;} template <typename T> il void read(T &x) { char ch = getchar(); int f = 1; x = 0; while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();} while(ch >= '0' && ch <= '9') x = x*10+ch-'0', ch = getchar(); x *= f; } template <typename T, typename... Args> il void read(T &x, Args &...args) { read(x), read(args...); } int x1, x2, y1, y2; char s[MAXN]; int main() { scanf("%s", s+1); rep(i, 1, strlen(s+1)) if(s[i] == 'N') y1 = 1; else if(s[i] == 'S') y2 = 1; else if(s[i] == 'E') x1 = 1; else if(s[i] == 'W') x2 = 1; puts(((y1^y2) || (x1^x2)) ? "No" : "Yes"); return 0; }
a.cc:37:13: error: 'int y1' redeclared as different kind of entity 37 | int x1, x2, y1, y2; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:41:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 41 | rep(i, 1, strlen(s+1)) | ^ a.cc:15:29: note: in definition of macro 'rep' 15 | #define rep(i, x, y) for(ri i = x; i <= y; ++i) | ^ a.cc:42:36: error: assignment of function 'double y1(double)' 42 | if(s[i] == 'N') y1 = 1; | ~~~^~~ a.cc:46:18: error: invalid operands of types 'double(double) noexcept' and 'int' to binary 'operator^' 46 | puts(((y1^y2) || (x1^x2)) ? "No" : "Yes"); | ~~^~~ | | | | | int | double(double) noexcept
s456517688
p04019
C++
#include<bits/stdc++.h> using namespace std; char s[1005]; int main() { scanf("%s",s+1); int n=strlen(s+1); for(int i=1;i<=n;i++) cnt[s[i]-'A']++; if((cnt['S'-'A']&&!cnt['N'-'A'])||(cnt['N'-'A']&&!cnt['S'-'A'])|| (cnt['W'-'A']&&!cnt['E'-'A'])||(cnt['E'-'A']&&!cnt['W'-'A'])) puts("No"); else puts("Yes"); return 0; }
a.cc: In function 'int main()': a.cc:8:25: error: 'cnt' was not declared in this scope; did you mean 'int'? 8 | for(int i=1;i<=n;i++) cnt[s[i]-'A']++; | ^~~ | int a.cc:9:7: error: 'cnt' was not declared in this scope; did you mean 'int'? 9 | if((cnt['S'-'A']&&!cnt['N'-'A'])||(cnt['N'-'A']&&!cnt['S'-'A'])|| | ^~~ | int
s161965702
p04019
C++
#include <cstdio> char a[1005];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1);int n=strlen(a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc: In function 'int main()': a.cc:4:32: error: 'strlen' was not declared in this scope 4 | scanf ("%s",a+1);int n=strlen(a+1); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <cstdio> +++ |+#include <cstring> 2 | char a[1005];bool N=0,S=0,W=0,E=0;
s179268373
p04019
C++
#include <cstdio> char a[1005];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc: In function 'int main()': a.cc:5:21: error: 'n' was not declared in this scope 5 | for (int i=1;i<=n;i++) | ^
s741863001
p04019
C++
#include <cstdio> const int N=1005; char a[N];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc:3:16: error: conflicting declaration 'bool N' 3 | char a[N];bool N=0,S=0,W=0,E=0; | ^ a.cc:2:11: note: previous declaration as 'const int N' 2 | const int N=1005; | ^ a.cc: In function 'int main()': a.cc:6:21: error: 'n' was not declared in this scope 6 | for (int i=1;i<=n;i++) | ^ a.cc:7:25: error: assignment of read-only variable 'N' 7 | if (a[i]=='N') N=1; | ~^~
s531836427
p04019
C++
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> #include <fstream> #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { string s; cin>>s; int n=0, s=0, w=0, e=0; for(auto c:s){ if(c=='N') n++; else if(c=='S') s++; else if(c=='W') w++; else e++; } if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; else cout<<"Yes"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:26:12: error: conflicting declaration 'int s' 26 | int n=0, s=0, w=0, e=0; | ^ a.cc:25:12: note: previous declaration as 'std::string s' 25 | string s; cin>>s; | ^ a.cc:29:22: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 29 | else if(c=='S') s++; | ~^~ a.cc:33:16: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, 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:3: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:33:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed: a.cc:33:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed: a.cc:33:17: note: mismatched types 'const _CharT*' and 'int' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3942 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed: a.cc:33:17: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2619 | operator>(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:7: /usr/include/c++/14/bits/stl_vector.h:2102:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)' 2102 | operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:2102:5: note: template argument deduction/substitution failed: a.cc:33:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::vector<_Tp, _Alloc>' 33 | if((n==0 && s>0) || (n>0 && s==0) || (w==0 && e>0) || (w>0 && e==0)) cout<<"No"<<endl; | ^ In file included from /usr/include/c++/14/map:63, from a.cc:8: /usr/include/c++/14/bits/stl_map.h:1564:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator>(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)' 1564 | operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h
s367229314
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int N=0,W=0,S=0,E=0; for(int i=0;i<s.size(),i++){ if(s[i]=='N')N=1; if(s[i]=='W')W=10; if(s[i]=='S')S=-1; if(s[i]=='E')E=-10; } if(N+W+S+E==0)cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:35: error: expected ';' before ')' token 8 | for(int i=0;i<s.size(),i++){ | ^ | ;
s561282901
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; int N=0,W=0,S=0,E=0; for(int i=0;i<S.size(),i++){ if(S[i]=='N')N=1; if(S[i]=='W')W=10; if(S[i]=='S')S=-1; if(S[i]=='E')E=-10; } if(N+W+S+E==0)cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:21: error: conflicting declaration 'int S' 7 | int N=0,W=0,S=0,E=0; | ^ a.cc:5:16: note: previous declaration as 'std::string S' 5 | string S; | ^ a.cc:8:35: error: expected ';' before ')' token 8 | for(int i=0;i<S.size(),i++){ | ^ | ; a.cc:14:15: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ~~~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const _CharT*' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:14:16: note: deduced conflicting types for parameter '_CharT' ('int' and 'char') 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'const _CharT*' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:14:16: note: deduced conflicting types for parameter '_CharT' ('int' and 'char') 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:14:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | if(N+W+S+E==0)cout << "Yes" << endl; | ^ In file included from /usr/include/c++/14/ccomplex:39,
s310202274
p04019
C++
#include<bits/stdc++.h>//万能头文件 #define reg register//听说能提速,只能定义为局部变量 using namespace std; string ss; int w,n,e,s; inline bool check()//判断是否符合条件 { if(w==1&&e==1&&n==1&&s==1)return 1; if(w==1&&e==1&&n==0&&s==0)return 1; if(w==0&&e==0&&n==1&&s==1)return 1; if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合 return 0; } int nain()//仔细看,有没有问题 { getline(cin,ss);//getline可直接读入一整行,将空格一并读入,遇到回车截至,速度比cin快 for(reg int i=0;i<ss.length();i++)//string从0开始存到ss.length()-1 if(ss[i]=='W')w++; else if(ss[i]=='N')n++; else if(ss[i]=='E')e++;//累加 else if(ss[i]=='S')s++;//if_else是连续结构,不用加大括号 puts(check()?"Yes":"No");//如果check的返回值为1输出Yes,否则输出No return 0;//圆满的结束 }
a.cc: In function 'bool check()': a.cc:11:40: error: '\U00008fd9\U00004e9b\U000090fd\U00007b26\U00005408' was not declared in this scope 11 | if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合 | ^~~~~~~~~~ a.cc: In function 'int nain()': a.cc:17:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | for(reg int i=0;i<ss.length();i++)//string从0开始存到ss.length()-1 | ^ a.cc: In function 'bool check()': a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type] 13 | } | ^
s118228048
p04019
C++
#include<iostream> #include<vector> using namespace std; #define P pair<int, int>; pair<int, int> temp; int N; int main(){ cin >> N; vector<pair<int, int>> A; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); } sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) }
a.cc: In function 'int main()': a.cc:6:25: error: expected ')' before ';' token 6 | #define P pair<int, int>; | ^ a.cc:23:38: note: in expansion of macro 'P' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc:23:31: note: to match this '(' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc: In lambda function: a.cc:6:25: error: expected '{' before ';' token 6 | #define P pair<int, int>; | ^ a.cc:23:38: note: in expansion of macro 'P' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc: In function 'int main()': a.cc:6:25: error: expected ')' before ';' token 6 | #define P pair<int, int>; | ^ a.cc:23:38: note: in expansion of macro 'P' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc:23:7: note: to match this '(' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc:23:41: error: 'x' was not declared in this scope 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc:23:44: error: expected primary-expression before 'const' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^~~~~ a.cc:23:53: error: 'y' was not declared in this scope 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^ a.cc:23:86: error: expected primary-expression before ')' token 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ^
s203275119
p04019
C++
#include<iostream> #include<vector> using namespace std; pair<int, int> temp; int N; int main(){ cin >> N; vector<pair<int, int>> A[N]; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); }
a.cc: In function 'int main()': a.cc:19:7: error: request for member 'push_back' in 'A', which is of non-class type 'std::vector<std::pair<int, int> > [N]' 19 | A.push_back(temp); | ^~~~~~~~~ a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s989895044
p04019
C++
#include<iostream> #include<vector> using namespace std; pair<int, int> temp; int main(){ cin >> N; vector<pair<int, int>> A[N]; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); }
a.cc: In function 'int main()': a.cc:9:10: error: 'N' was not declared in this scope 9 | cin >> N; | ^ a.cc:18:5: error: 'A' was not declared in this scope 18 | A.push_back(temp); | ^ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s548107338
p04019
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++) #define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--) #define sz(v) (int)(v).size() #define pb push_back #define sc second #define fr first #define sor(v) sort(v.begin(),v.end()) #define rev(s) reverse(s.begin(),s.end()) #define lb(vec,a) lower_bound(vec.begin(),vec.end(),a) #define ub(vec,a) upper_bound(vec.begin(),vec.end(),a) #define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end()) using namespace std; typedef long long int ll; typedef pair <int, int> P; const ll MOD=1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin>>S; int N=S.length(); int n=0,w=0,s=0,e=0; rep(i,0,N){ if(S[i]=='N') n++; if(S[i]=='W') w++; if(S[i]=='S') s++; if(S[i]=='E') e++; } if(((n==0&&s==0)||(n&&s))&&((w==0&&e==0)||(w&&e))) cout <<"Yes"<<"\n"; else cout << "No"<<"\n"; }#include <bits/stdc++.h> #define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++) #define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--) #define sz(v) (int)(v).size() #define pb push_back #define sc second #define fr first #define sor(v) sort(v.begin(),v.end()) #define rev(s) reverse(s.begin(),s.end()) #define lb(vec,a) lower_bound(vec.begin(),vec.end(),a) #define ub(vec,a) upper_bound(vec.begin(),vec.end(),a) #define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end()) using namespace std; typedef long long int ll; typedef pair <int, int> P; const ll MOD=1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin>>S; int N=S.length(); int n=0,w=0,s=0,e=0; rep(i,0,N){ if(S[i]=='N') n++; if(S[i]=='W') w++; if(S[i]=='S') s++; if(S[i]=='E') e++; } if(((n==0&&s==0)||(n&&s))&&((w==0&&e==0)||(w&&e))) cout <<"Yes"<<"\n"; else cout << "No"<<"\n"; }
a.cc:34:2: error: stray '#' in program 34 | }#include <bits/stdc++.h> | ^ a.cc:34:3: error: 'include' does not name a type 34 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:50:10: error: redefinition of 'const ll MOD' 50 | const ll MOD=1000000007; | ^~~ a.cc:17:10: note: 'const ll MOD' previously defined here 17 | const ll MOD=1000000007; | ^~~ a.cc:52:5: error: redefinition of 'int main()' 52 | int main() { | ^~~~ a.cc:19:5: note: 'int main()' previously defined here 19 | int main() { | ^~~~
s586255241
p04019
Java
import java.util.*; public class Wanna_go_back_home{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); String S_s[] = s.split(""); String N = "N"; String W = "W"; String S = "S"; String E = "E"; int x = 0; int y = 0; for(int i = 0;i < s.length();i++){ if(S_s[i].equals(N)) x++; else if(S_s[i].equals(W)) y--; else if(S_s[i].equals(S)) x--; else if(S_s[i].equals(E)) y++; } if(x == 0 && y == 0){ System.out.println("Yes"); } else{ System.out.println("No"); } } }
Main.java:3: error: class Wanna_go_back_home is public, should be declared in a file named Wanna_go_back_home.java public class Wanna_go_back_home{ ^ 1 error
s265183293
p04019
C++
#include<bits/stdc++.h>//万能头文件 #define reg register//听说能提速,只能定义为局部变量 using namespace std; string ss; int w,n,e,s; inline bool check()//判断是否符合条件 { if(w==1&&e==1&&n==1&&s==1)return 1; if(w==1&&e==1&&n==0&&s==0)return 1; if(w==0&&e==0&&n==1&&s==1)return 1; if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合 return 0; } int nain()//仔细看,有没有问题 { getline(cin,ss);//getline可直接读入一整行,将空格一并读入,遇到回车截至,速度比cin快 for(reg int i=0;i<ss.length();i++)//string从0开始存到ss.length()-1 if(ss[i]=='W')w++; else if(ss[i]=='N')n++; else if(ss[i]=='E')e++;//累加 else if(ss[i]=='S')s++;//if_else是连续结构,不用加大括号 puts(check()?"Yes":"No");//如果check的返回值为1输出Yes,否则输出No return 0;//圆满的结束 }
a.cc: In function 'bool check()': a.cc:11:40: error: '\U00008fd9\U00004e9b\U000090fd\U00007b26\U00005408' was not declared in this scope 11 | if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合 | ^~~~~~~~~~ a.cc: In function 'int nain()': a.cc:17:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | for(reg int i=0;i<ss.length();i++)//string从0开始存到ss.length()-1 | ^ a.cc: In function 'bool check()': a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type] 13 | } | ^
s142815304
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<int> vec(4); string S; cin >> S; int n = S.size(); for (int i = 0; i < N; i++) { if (S.at(i) == 'N') vec.at(0) += 1; else if (S.at(i) == 'E') vec.at(1) += 1; else if (S.at(i) == 'W') vec.at(2) += 1; else if (S.at(i) == 'S') vec.at(3) += 1; } int p = vec.at(0) * vec.at(1) * vec.at(2) * vec.at(3); if (p != 0) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:10:23: error: 'N' was not declared in this scope 10 | for (int i = 0; i < N; i++) { | ^
s668322026
p04019
C++
#include<stdio.h> #include<stdlib.h> int main() { int n=0, w=0, s=0, e=0; char* c = malloc(1000 * sizeof(char)); scanf("%s", c); int N = 0; int i=0; while (*(c+i)) { N++; i++; } for (int i=0; i<N; i++) { if (*(c+i) == 'N') {n++;} if (*(c+i) == 'W') {w++;} if (*(c+i) == 'S') {s++;} if (*(c+i) == 'E') {e++;} } if (n) {n = 1;} if (w) {w = 1;} if (s) {s = 1;} if (e) {e = 1;} int f = (n == s); int g = (e == w); f = f & g; if (f) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
a.cc: In function 'int main()': a.cc:6:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 6 | char* c = malloc(1000 * sizeof(char)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void*
s499991497
p04019
C++
#include<iostream> #include<cstring> using namespace std; int main(){ string a; int sumn=0,sume=0; cin>>a; for(int i=0;i<strlen(a);i++){ if(a[i]=='N') sumn++; if(a[i]=='S') sumn--; if(a[i]=='E') sume++; if(a[i]=='W') sume--; } if(sumn==0&&sume==0) cout<<"Yes"<<endl; if(sumn!=0||sume!=0) cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 8 | for(int i=0;i<strlen(a);i++){ | ^ | | | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/cstring:43, from a.cc:2: /usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)' 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~
s200510205
p04019
C++
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10; char c[N]; int main() { scanf("%s", c + 1); int n = strlen(c + 1), a, b, c, d; a = b = c = d = 0; for (int i = 1; i <= n; i++) { if (c[i] == 'N') a = 1; if (c[i] == 'S') b = 1; if (c[i] == 'W') c = 1; if (c[i] == 'E') d = 1; } if ((a ^ b) || (c ^ d)) { puts("No"); } else { puts("Yes"); } return 0; }
a.cc: In function 'int main()': a.cc:14:10: error: invalid types 'int[int]' for array subscript 14 | if (c[i] == 'N') a = 1; | ^ a.cc:15:10: error: invalid types 'int[int]' for array subscript 15 | if (c[i] == 'S') b = 1; | ^ a.cc:16:10: error: invalid types 'int[int]' for array subscript 16 | if (c[i] == 'W') c = 1; | ^ a.cc:17:10: error: invalid types 'int[int]' for array subscript 17 | if (c[i] == 'E') d = 1; | ^