submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s900425684
|
p04019
|
C++
|
#include <iostream>
#include<iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない
int main() {
int ns = 0, we = 0;
string s;
cin >> s;
rep(i, s.size()) {
if (s[i] == 'S') {
ns++;
}
else if (s[i] == 'N') {
ns--;
}
else if (s[i] == 'W') {
we++;
}
else {
we--;
}
}
if (we == 0 && ns == 0) Yes;
else No;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:45:9: error: 'else' without a previous 'if'
45 | else No;
| ^~~~
|
s461473879
|
p04019
|
C++
|
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
int main() {
string X;
cin >> X;
bool sflag = false;
bool nflag = false;
bool eflag = false;
bool wflag = false;
rep(i,X.size()){
if(X[i] = "S") sflag = true;
if(X[i] = "N") nflag = true;
if(X[i] = "E") eflag = true;
if(X[i] = "W") wflag = true;
}
if(sflag && !nflag) cout << "No" << endl;
else if (!sflag && nflag) cout << "No" << endl;
else if (!wflag && eflag) cout << "No" << endl;
else if (wflag && !eflag) cout << "No" << endl;
else cout << "Yes" << endl;
}
|
a.cc: In function 'int main()':
a.cc:29:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
29 | if(X[i] = "S") sflag = true;
| ^~~
| |
| const char*
a.cc:30:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
30 | if(X[i] = "N") nflag = true;
| ^~~
| |
| const char*
a.cc:31:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
31 | if(X[i] = "E") eflag = true;
| ^~~
| |
| const char*
a.cc:32:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
32 | if(X[i] = "W") wflag = true;
| ^~~
| |
| const char*
|
s909016594
|
p04019
|
C++
|
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
int main() {
string X;
cin >> X;
sflag = false;
nflag = false;
eflag = false;
wflag = false;
rep(i,X.size()){
if(X[i] = 'S') sflag = true;
if(X[i] = 'N') nflag = true;
if(X[i] = 'E') eflag = true;
if(X[i] = 'W') wflag = true;
}
if(sflag){
if(nflag && !eflag && !wflag){
cout << "Yes" << endl;
return 0;
}
else if (nflag && eflag && !wflag || nflag && !eflag && wflag){
cout << "No" << endl;
return 0;
}
else{
cout << "Yes" << endl;
return 0;
}
}
if(nflag){
if(sflag && !eflag && !wflag){
cout << "Yes" << endl;
return 0;
}
else if (sflag && eflag && !wflag || nflag && !eflag && wflag){
cout << "No" << endl;
return 0;
}
else{
cout << "Yes" << endl;
return 0;
}
}
if(eflag){
if(wflag && !sflag && !nflag){
cout << "Yes" << endl;
return 0;
}
else if (wflag && sflag && !nflag || wflag && !sflag && nflag){
cout << "No" << endl;
return 0;
}
else{
cout << "Yes" << endl;
return 0;
}
}
if(wflag){
if(eflag && !sflag && !nflag){
cout << "Yes" << endl;
return 0;
}
else if (eflag && sflag && !nflag || eflag && !sflag && nflag){
cout << "No" << endl;
return 0;
}
else{
cout << "Yes" << endl;
return 0;
}
}
}
|
a.cc:29:14: error: extended character is not valid in an identifier
29 | if(X[i] = 'S') sflag = true;
| ^
a.cc:30:14: error: extended character is not valid in an identifier
30 | if(X[i] = 'N') nflag = true;
| ^
a.cc:31:14: error: extended character is not valid in an identifier
31 | if(X[i] = 'E') eflag = true;
| ^
a.cc:32:14: error: extended character is not valid in an identifier
32 | if(X[i] = 'W') wflag = true;
| ^
a.cc: In function 'int main()':
a.cc:24:9: error: 'sflag' was not declared in this scope
24 | sflag = false;
| ^~~~~
a.cc:25:9: error: 'nflag' was not declared in this scope
25 | nflag = false;
| ^~~~~
a.cc:26:9: error: 'eflag' was not declared in this scope
26 | eflag = false;
| ^~~~~
a.cc:27:9: error: 'wflag' was not declared in this scope
27 | wflag = false;
| ^~~~~
a.cc:29:14: error: expected ')' before '\U00003000'
29 | if(X[i] = 'S') sflag = true;
| ~ ^~
| )
a.cc:30:14: error: expected ')' before '\U00003000'
30 | if(X[i] = 'N') nflag = true;
| ~ ^~
| )
a.cc:31:14: error: expected ')' before '\U00003000'
31 | if(X[i] = 'E') eflag = true;
| ~ ^~
| )
a.cc:32:14: error: expected ')' before '\U00003000'
32 | if(X[i] = 'W') wflag = true;
| ~ ^~
| )
|
s586011010
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int i, n = 1, w = 1, e = 1, s = 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else{
e = 0;
}
}
if(n^s || w^e){
cout << "No";
}else{
cout << "Yes";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:12: error: conflicting declaration 'std::string s'
6 | string s;
| ^
a.cc:5:33: note: previous declaration as 'int s'
5 | int i, n = 1, w = 1, e = 1, s = 1;
| ^
a.cc:8:18: error: request for member 'length' in 's', which is of non-class type 'int'
8 | for(i=0; i<s.length(); i++){
| ^~~~~~
a.cc:9:13: error: invalid types 'int[int]' for array subscript
9 | if(s[i] == 'N'){
| ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
11 | }else if(s[i] == 'W'){
| ^
a.cc:13:19: error: invalid types 'int[int]' for array subscript
13 | }else if(s[i] == 'S'){
| ^
|
s220783270
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int i, n == 1, w == 1, e == 1, s == 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else{
e = 0;
}
}
if(n^s || w^e){
cout << "No";
}else{
cout << "Yes";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before '==' token
5 | int i, n == 1, w == 1, e == 1, s == 1;
| ^~
a.cc:10:13: error: 'n' was not declared in this scope
10 | n = 0;
| ^
a.cc:12:13: error: 'w' was not declared in this scope
12 | w = 0;
| ^
a.cc:14:17: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
14 | 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:16:13: error: 'e' was not declared in this scope
16 | e = 0;
| ^
a.cc:19:8: error: 'n' was not declared in this scope
19 | if(n^s || w^e){
| ^
a.cc:19:15: error: 'w' was not declared in this scope
19 | if(n^s || w^e){
| ^
a.cc:19:17: error: 'e' was not declared in this scope
19 | if(n^s || w^e){
| ^
|
s776350296
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int n == 1, w == 1, e == 1, s == 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else{
e = 0;
}
}
if(n^s || w^e){
cout << "No";
}else{
cout << "Yes";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:11: error: expected initializer before '==' token
5 | int n == 1, w == 1, e == 1, s == 1;
| ^~
a.cc:8:9: error: 'i' was not declared in this scope
8 | for(i=0; i<s.length(); i++){
| ^
a.cc:10:13: error: 'n' was not declared in this scope
10 | n = 0;
| ^
a.cc:12:13: error: 'w' was not declared in this scope
12 | w = 0;
| ^
a.cc:14:17: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
14 | 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:16:13: error: 'e' was not declared in this scope
16 | e = 0;
| ^
a.cc:19:8: error: 'n' was not declared in this scope
19 | if(n^s || w^e){
| ^
a.cc:19:15: error: 'w' was not declared in this scope
19 | if(n^s || w^e){
| ^
a.cc:19:17: error: 'e' was not declared in this scope
19 | if(n^s || w^e){
| ^
|
s379942849
|
p04019
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int n=0;
int s=0;
int w=0;
int e=0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='N')n++;
else if(s.at(i)=='S')s++;
else if(s.at(i)=='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;
}
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: conflicting declaration 'int s'
8 | int s=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:13:27: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
13 | else if(s.at(i)=='S')s++;
| ~^~
a.cc:17:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
17 | 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/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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
17 | 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/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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
17 | 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/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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | 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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | 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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | 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: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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | 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/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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
17 | 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/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:17:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:17:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:17:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
17 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:17:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
17 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:17:16: note: mismatched types 'const _CharT*' and 'int'
17 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:17:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
17 | 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/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:17:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
17 | 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/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:
|
s450652138
|
p04019
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int n=0,s=0,w=0,e=0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='N')n++;
else if(s.at(i)=='S')s++;
else if(s.at(i)=='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;
}
}
|
a.cc: In function 'int main()':
a.cc:7:11: error: conflicting declaration 'int s'
7 | int n=0,s=0,w=0,e=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:10:27: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
10 | else if(s.at(i)=='S')s++;
| ~^~
a.cc:14:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
14 | 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/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
14 | 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/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
14 | 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/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | 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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | 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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | 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: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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | 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/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
14 | 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/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:14:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
14 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:14:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
14 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:14:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
14 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:14:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
14 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:14:16: note: mismatched types 'const _CharT*' and 'int'
14 | if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==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:14:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
14 | 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/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
14 | 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/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/stre
|
s261347902
|
p04019
|
C++
|
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#define REP(i, N) for(int i = 0; i < N; ++i)
#define FOR(i, M, N) for(int i = M; i < N; ++i)
using namespace std;
int main() {
string trip;
cin >> trip;
bool N = 0, W = 0, S = 0, E = 0;
N = bool(min(count(trip.begin(), trip.end(), 'N'), 1));
W = bool(min(count(trip.begin(), trip.end(), 'W'), 1));
S = bool(min(count(trip.begin(), trip.end(), 'S'), 1));
E = bool(min(count(trip.begin(), trip.end(), 'E'), 1));
if (!N && S)cout << "No" << endl;
else if (N && !S) cout << "No" << endl;
else if (!W && E) cout << "No" << endl;
else if (W && !E) cout << "No" << endl;
else cout << "Yes" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:21: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, int)'
17 | N = bool(min(count(trip.begin(), trip.end(), 'N'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
17 | N = bool(min(count(trip.begin(), trip.end(), 'N'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
17 | N = bool(min(count(trip.begin(), trip.end(), 'N'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:18:21: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, int)'
18 | W = bool(min(count(trip.begin(), trip.end(), 'W'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:18:21: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
18 | W = bool(min(count(trip.begin(), trip.end(), 'W'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:18:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
18 | W = bool(min(count(trip.begin(), trip.end(), 'W'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:21: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, int)'
19 | S = bool(min(count(trip.begin(), trip.end(), 'S'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:19:21: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
19 | S = bool(min(count(trip.begin(), trip.end(), 'S'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:19:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
19 | S = bool(min(count(trip.begin(), trip.end(), 'S'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:21: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, int)'
20 | E = bool(min(count(trip.begin(), trip.end(), 'E'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:20:21: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
20 | E = bool(min(count(trip.begin(), trip.end(), 'E'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:20:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
20 | E = bool(min(count(trip.begin(), trip.end(), 'E'), 1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s315697643
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main() {
char s[5] = "NSEW";
char str[1001] = {};
cin >> str;
int N = strlen(str);
bool f[4] = { false,false,false,false };
for (int i = 0; i < N; i++) {
for (int k = 0; k < 4; k++) {
if (str[i] == s[k]) {
f[k] = true;
break;
}
}
}
if (f[0] == f[1] && f[2] == f[3]) {
cout << "Yes";
}
else {
cout << "No";
}
return 0;
}#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main() {
char s[5] = "NSEW";
char str[1001] = {};
cin >> str;
int N = strlen(str);
bool f[4] = { false,false,false,false };
for (int i = 0; i < N; i++) {
for (int k = 0; k < 4; k++) {
if (str[i] == s[k]) {
f[k] = true;
break;
}
}
}
if (f[0] == f[1] && f[2] == f[3]) {
cout << "Yes";
}
else {
cout << "No";
}
return 0;
}
|
a.cc:31:2: error: stray '#' in program
31 | }#include <iostream>
| ^
a.cc:31:3: error: 'include' does not name a type
31 | }#include <iostream>
| ^~~~~~~
a.cc:40:5: error: redefinition of 'int main()'
40 | int main() {
| ^~~~
a.cc:10:5: note: 'int main()' previously defined here
10 | int main() {
| ^~~~
|
s085792695
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
string s;
cin >> s;
int N = 0, int W = 0;
int S = 0; int E = 0;
bool NS = false; bool WE = false;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'N') {
N++;
}
else if (s[i] == 'W') {
W++;
}
else if (s[i] == 'S') {
S++;
}
else if (s[i] == 'E') {
E++;
}
}
if ((W == 0 && E == 0) || (W != 0 && E != 0)) {
WE = true;
}
if ((N == 0 && S == 0) || (N != 0 && S != 0)) {
NS = true;
}
if (NS && WE) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:13:20: error: expected unqualified-id before 'int'
13 | int N = 0, int W = 0;
| ^~~
a.cc:21:25: error: 'W' was not declared in this scope
21 | W++;
| ^
a.cc:30:14: error: 'W' was not declared in this scope; did you mean 'WE'?
30 | if ((W == 0 && E == 0) || (W != 0 && E != 0)) {
| ^
| WE
|
s269205363
|
p04019
|
C++
|
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include <array>
#include <map>
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
struct point{
int x;
int y;
};
int gcd(int a, int b)
{
return a == 0 ? b : gcd(b % a, a);
}
int lcm( int m, int n )
{
// 引数に0がある場合は0を返す
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
int x;
cin>>x;
return x;
}
int moji(char in)
{
int ans = (int)in-(int)'a';
if((ans < 0) || (ans > 25)){
ans = 26;
}
return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
fill(d,d+VV,100000);
fill(used,used+VV,false);
d[s]=0;
while(true){
int v=-1;
for(int u=0;u<VV;u++){
if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
}
if(v==-1)break;
used[v]=true;
for(int u=0;u<VV;u++){
d[u]=min(d[u],d[v]+cost[v][u]);
}
}
}
int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
return *(int*)a - *(int*)b;
}
int binary_searchh(long long x,long long k[],int n){
int l=0;
int r=n;
while(r-l>=1){
int i=(l+r)/2;
if(k[i]==x)return i;
else if(k[i]<x)l=i+1;
else r=i;
}
return -1;
}
struct File {
int aa;
int bb;
File(const int& aa, const int& bb)
: aa(aa), bb(bb) {}
};
bool operator<(const File& a, const File& b)
{
// ファイル種別、ファイル名の順番で優先順位を付けて比較
return std::tie(a.aa, a.bb) < std::tie(b.aa, b.bb);
}
long long kaijo(long long x){
long long l=10*10*10*10*10*10*10*10*10+7;
long long sum=1;
for(int i=x;i>0;i--){
sum*=i;
if(sum>l){
sum%=l;
}
}
return sum;
}
int main(){
int a[4];
for(int i=0;i<4;i++){
a[i]=0;
}
string s;
cin>>s;
int ue=0;
int migi=0;
for(int i=0;i<s.size();i++){
if(s[i]=='N'){
if(ue<0){
ue=0;
}else{
ue++;
}
}
if(s[i]=='S'){
if(ue>0){
ue=0;
}else{
ue--;
}
}
if(s[i]=='E'){
if(migi<0){
migi=0;
}else{
migi++;
}
}
if(s[i]=='W'){
if(migi>0){
migi=0;
}else{
migi--;
}
}
}
if(ue==0&&migi==0){
cout<<"Yes"<<endl:
}else{
cout<<"No"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:161:22: error: expected ';' before ':' token
161 | cout<<"Yes"<<endl:
| ^
| ;
|
s236126510
|
p04019
|
C++
|
=begin
, \ / ,
/ \ )\__/( / \
/ \ (_\ /_) / \
____/_____\__\@ @/___/_____\____
| |\../| |
| \VV/ |
| ------hoi------- |
|_________________________________|
| /\ / \\ \ /\ |
| / V )) V \ |
|/ ` // ' \|
` V '
=end
a, b, c, d = 0, 0, 0, 0
s = gets.chomp
s.each_char { |x| a += 1 if x == 'N'; b += 1 if x == 'S'; c += 1 if x == 'W'; d += 1 if x == 'E'}
if((a > 0 && b == 0) || (b > 0 && a == 0) || (c > 0 && d == 0) || (c == 0 && d > 0))
puts("No")
else
puts("Yes")
end
|
a.cc:2:17: error: stray '\' in program
2 | , \ / ,
| ^
a.cc:3:12: error: stray '\' in program
3 | / \ )\__/( / \
| ^
a.cc:3:18: error: stray '\' in program
3 | / \ )\__/( / \
| ^
a.cc:4:13: error: stray '\' in program
4 | / \ (_\ /_) / \
| ^
a.cc:4:18: error: stray '\' in program
4 | / \ (_\ /_) / \
| ^
a.cc:5:14: error: stray '\' in program
5 | ____/_____\__\@ @/___/_____\____
| ^
a.cc:5:17: error: stray '\' in program
5 | ____/_____\__\@ @/___/_____\____
| ^
a.cc:5:18: error: stray '@' in program
5 | ____/_____\__\@ @/___/_____\____
| ^
a.cc:5:21: error: stray '@' in program
5 | ____/_____\__\@ @/___/_____\____
| ^
a.cc:5:32: error: stray '\' in program
5 | ____/_____\__\@ @/___/_____\____
| ^
a.cc:6:18: error: stray '\' in program
6 | | |\../| |
| ^
a.cc:7:18: error: stray '\' in program
7 | | \VV/ |
| ^
a.cc:10:10: error: stray '\' in program
10 | | /\ / \\ \ /\ |
| ^
a.cc:10:19: error: stray '\' in program
10 | | /\ / \\ \ /\ |
| ^
a.cc:10:20: error: stray '\' in program
10 | | /\ / \\ \ /\ |
| ^
a.cc:10:28: error: stray '\' in program
10 | | /\ / \\ \ /\ |
| ^
a.cc:10:31: error: stray '\' in program
10 | | /\ / \\ \ /\ |
| ^
a.cc:11:33: error: stray '\' in program
11 | | / V )) V \ |
| ^
a.cc:12:11: error: stray '`' in program
12 | |/ ` // ' \|
| ^
a.cc:13:4: error: stray '`' in program
13 | ` V '
| ^
a.cc:13:36: warning: missing terminating ' character
13 | ` V '
| ^
a.cc:13:36: error: missing terminating ' character
a.cc:1:1: error: expected unqualified-id before '=' token
1 | =begin
| ^
a.cc:18:1: error: expected unqualified-id before 'if'
18 | if((a > 0 && b == 0) || (b > 0 && a == 0) || (c > 0 && d == 0) || (c == 0 && d > 0))
| ^~
|
s554039202
|
p04019
|
C++
|
#include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
string x;
char y;
int ns=0,ew=0,n=0,e=0,w=0,s=0;
cin>>x;
for(int i=0;i<x.size();i++){
y=x[i];
if(y=='N')
n++;
else if(y=='E')
e++;
else if(y=='S')
s++;
else
w++;
}
if(n!=0 and s!=0)
ns++;
else if(e!=0 and w!=0)
ew++;
if(ns=1 and ew=1)
cout<<"Yes"<<endl;
else if(ns=0 and ew=0)
cout<<"No"<<endl;
else if(ns=1 and e==0 and w==0)
cout<<"Yes"<<endl;
else if(ew=1 and n==0 and s==0)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:27:11: error: lvalue required as left operand of assignment
27 | if(ns=1 and ew=1)
| ~~^~~~~~
a.cc:29:16: error: lvalue required as left operand of assignment
29 | else if(ns=0 and ew=0)
| ~~^~~~~~
|
s658772669
|
p04019
|
C++
|
#include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
string x;
char y;
int ns=0,ew=0,n=0,e=0,w=0,s=0;
cin>>x;
for(int i=0;i<x.size();i++){
y=x[i];
if(y==N)
n++;
else if(y==E)
e++;
else if(y==S)
s++;
else
w++;
}
if(n!=0 and s!=0)
ns++;
else if(e!=0 and w!=0)
ew++;
if(ns=1 and ew=1)
cout<<"Yes"<<endl;
else if(ns=0 and ew=0)
cout<<"No"<<endl;
else if(ns=1 and e==0 and w==0)
cout<<"Yes"<<endl;
else if(ew=1 and n==0 and s==0)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:14:11: error: 'N' was not declared in this scope
14 | if(y==N)
| ^
a.cc:16:16: error: 'E' was not declared in this scope
16 | else if(y==E)
| ^
a.cc:18:16: error: 'S' was not declared in this scope
18 | else if(y==S)
| ^
a.cc:27:11: error: lvalue required as left operand of assignment
27 | if(ns=1 and ew=1)
| ~~^~~~~~
a.cc:29:16: error: lvalue required as left operand of assignment
29 | else if(ns=0 and ew=0)
| ~~^~~~~~
|
s902138500
|
p04019
|
C++
|
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main() {
int S=0,N=0,E=0,W=0;
bool ans=false;
string A;
cin >> A;
for(int i=0; i<A.size(); i++){
if(A[i]=='S') S+=1;
if(A[i]=='N') N+=1;
if(A[i]=='E') E+=1;
if(A[i]=='W') W+=1;
}
if(N==1){
if(S=1){
ans=true;
}else{
ans=false;
}
}if(E==1){
if(W==1){
ans=true;
}else{
ans=false;
}
if(W==1){
if(E==1){
ans=true;
}else{
ans=false;
}
if(S==1){
if(N==1){
ans=true;
}else{
ans=false;
}
}if(ans) cout << "Yes" << endl;
else cout << "No" << endl;
}
|
a.cc: In function 'int main()':
a.cc:46:2: error: expected '}' at end of input
46 | }
| ^
a.cc:26:12: note: to match this '{'
26 | }if(E==1){
| ^
a.cc:46:2: error: expected '}' at end of input
46 | }
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s865586854
|
p04019
|
C++
|
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;
int main(void){
string input;
cin >> input;
int len_input = input.size();
int counter_n = 0;
int counter_s = 0;
int counter_w = 0;
int counter_e = 0;
for(int i = 0; i < len_input; i++){
if(string[i] == 'N' && counter_n == 0){
counter_n = 1;
} else if(string[i] == 'E' && counter_e == 0){
counter_e = 1;
} else if(string[i] == 'S' && counter_s == 0){
counter_s = 1;
} else if(string[i] == 'W' && counter_w == 0){
counter_w = 1;
} else {
}
}
if(counter_e * counter_w == 0 || counter_n * counter_s == 0){
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:33:14: error: expected unqualified-id before '[' token
33 | if(string[i] == 'N' && counter_n == 0){
| ^
a.cc:35:21: error: expected unqualified-id before '[' token
35 | } else if(string[i] == 'E' && counter_e == 0){
| ^
a.cc:37:21: error: expected unqualified-id before '[' token
37 | } else if(string[i] == 'S' && counter_s == 0){
| ^
a.cc:39:21: error: expected unqualified-id before '[' token
39 | } else if(string[i] == 'W' && counter_w == 0){
| ^
|
s977139268
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size();i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
else cout << " No" << endl;
}
|
a.cc:6:5: error: cannot declare '::main' to be a global variable
6 | int main{
| ^~~~
a.cc:7:10: error: expected primary-expression before 's'
7 | string s;
| ^
a.cc:7:10: error: expected '}' before 's'
a.cc:6:9: note: to match this '{'
6 | int main{
| ^
a.cc:8:3: error: 'cin' does not name a type
8 | cin >> s;
| ^~~
a.cc:10:3: error: expected unqualified-id before 'for'
10 | for(int i = 0; i < s.size();i++){
| ^~~
a.cc:10:18: error: 'i' does not name a type
10 | for(int i = 0; i < s.size();i++){
| ^
a.cc:10:31: error: 'i' does not name a type
10 | for(int i = 0; i < s.size();i++){
| ^
a.cc:17:3: error: expected unqualified-id before 'if'
17 | if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
| ^~
a.cc:18:3: error: expected unqualified-id before 'else'
18 | else cout << " No" << endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s071842726
|
p04019
|
C++
|
#include<iostream>
#include<string>
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size();i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
else cout << " No" << endl;
}
|
a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:5:10: error: expected '}' before 's'
5 | string s;
| ^
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin >> s;
| ^~~
a.cc:8:3: error: expected unqualified-id before 'for'
8 | for(int i = 0; i < s.size();i++){
| ^~~
a.cc:8:18: error: 'i' does not name a type
8 | for(int i = 0; i < s.size();i++){
| ^
a.cc:8:31: error: 'i' does not name a type
8 | for(int i = 0; i < s.size();i++){
| ^
a.cc:15:3: error: expected unqualified-id before 'if'
15 | if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
| ^~
a.cc:16:3: error: expected unqualified-id before 'else'
16 | else cout << " No" << endl;
| ^~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s366799517
|
p04019
|
C++
|
#include<iostream>
#include<string>
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size;i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
else cout << " No" << endl;
}
|
a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:5:10: error: expected '}' before 's'
5 | string s;
| ^
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin >> s;
| ^~~
a.cc:8:3: error: expected unqualified-id before 'for'
8 | for(int i = 0; i < s.size;i++){
| ^~~
a.cc:8:18: error: 'i' does not name a type
8 | for(int i = 0; i < s.size;i++){
| ^
a.cc:8:29: error: 'i' does not name a type
8 | for(int i = 0; i < s.size;i++){
| ^
a.cc:15:3: error: expected unqualified-id before 'if'
15 | if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
| ^~
a.cc:16:3: error: expected unqualified-id before 'else'
16 | else cout << " No" << endl;
| ^~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s732657449
|
p04019
|
C++
|
#include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
int N, H, E, W;
N = 0;
H = 0;
E = 0;
W = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 'N') {
N++;
}
else if (S[i] == 'S') {
H++;
}
else if (S[i] == 'E') {
E++;
}
else {
W++;
}
}
if ((max(N, H) > 0 && min(N, H) == 0) || (max(E, W) > 0 && min(E, W) == 0) {
cout << "No" << endl;
}
else {
cout << "Yes" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:28:79: error: expected ')' before '{' token
28 | if ((max(N, H) > 0 && min(N, H) == 0) || (max(E, W) > 0 && min(E, W) == 0) {
| ~ ^~
| )
a.cc:34:1: error: expected primary-expression before '}' token
34 | }
| ^
|
s649270016
|
p04019
|
C++
|
#include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
int N, S, E, W;
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++;
}
}
if (N == S && E == W) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: conflicting declaration 'int S'
8 | int N, S, E, W;
| ^
a.cc:5:12: note: previous declaration as 'std::string S'
5 | string S;
| ^
a.cc:10:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | 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:18:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
18 | S++;
| ~^~
a.cc:28:11: error: no match for 'operator==' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
28 | if (N == S && E == W) {
| ~ ^~ ~
| | |
| 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:28:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::__cxx11::match_results<_BiIter, _Alloc>' and 'int'
28 | if (N == S && E == W) {
| ^
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:28:14: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
28 | if (N == S && E == W) {
| ^
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:28:14: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
28 | if (N == S && E == W) {
| ^
/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:28:14: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
28 | if (N == S && E == W) {
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT>
|
s588401886
|
p04019
|
C++
|
#include <cstdio>
#include <algorithm>
using namespace std;
const int N = 1005;
char s[N];
int main(){
scanf("%s",s);
int n = strlen(s);
int x = 0, y = 0;
for(int i=0;i<n;i++){
if(s[i]=='N') {
++y;
}
if(s[i]=='S'){
--y;
}
if(s[i]=='E'){
++x;
}
if(s[i]=='W'){
--x;
}
}
if(x==0 && y==0){
puts("Yes");
}
else{
puts("No");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: 'strlen' was not declared in this scope
12 | int n = strlen(s);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include <cstring>
3 |
|
s527255109
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int w=0, s=0, n=0, e=0;
for (int i=0; i<s.size(); i++) {
if (s.at(i)=='W') w++;
else if (s.at(i)=='S') s++;
else if (s.at(i)=='N') n++;
else if (s.at(i)=='E') e++;
}
if (w==0||s==0||n==0||e==0) cout << "No" << endl;
else cout << "Yes" << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'int s'
7 | int w=0, s=0, n=0, e=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:10:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
10 | else if (s.at(i)=='S') s++;
| ~^~
a.cc:14:14: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ~^~~
| | |
| | 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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
/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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
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:14:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
14 | if (w==0||s==0||n==0||e==0) cout << "No" << endl;
| ^
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:14:16: note: 'std::string' {aka 'std:
|
s549863177
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
bool n,w,s,e;
n=s=w=e=false;
for(int i=0;i<s.size();i++){
if(s[i]=='S') s=true;
if(s[i]=='W') w=true;
if(s[i]=='E') e=true;
if(s[i]=='N') n=true;
}
if(w==e&&s==n) cout<<"Yes";
else cout<<"No";
}
|
a.cc: In function 'int main()':
a.cc:6:12: error: conflicting declaration 'bool s'
6 | bool n,w,s,e;
| ^
a.cc:4:10: note: previous declaration as 'std::string s'
4 | string s;
| ^
a.cc:7:6: error: cannot convert 'std::__cxx11::basic_string<char>' to 'bool' in assignment
7 | n=s=w=e=false;
| ~^~~~~~~~~~
| |
| std::__cxx11::basic_string<char>
a.cc:14:13: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'bool')
14 | if(w==e&&s==n) cout<<"Yes";
| ~^~~
| | |
| | bool
| 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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'bool'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'bool'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'bool'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
/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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
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:14:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
14 | if(w==e&&s==n) cout<<"Yes";
| ^
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: can
|
s926299900
|
p04019
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int news[4] = {0};
for ( int i = 0; i < s.size(); i++ ){
if ( s[i] == "N" ) news[0] = 1;
if ( s[i] == "E" ) news[1] = 1;
if ( s[i] == "W" ) news[2] = 1;
if ( s[i] == "S" ) news[3] = 1;
}
if( news[0] == news[2] && news[1] == news[3] )
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if ( s[i] == "N" ) news[0] = 1;
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if ( s[i] == "E" ) news[1] = 1;
a.cc:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if ( s[i] == "W" ) news[2] = 1;
a.cc:14:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if ( s[i] == "S" ) news[3] = 1;
|
s655375527
|
p04019
|
C++
|
/****Author: Barish Namazov****/
#include <bits/stdc++.h>
using namespace std;
/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define endl '\n'
const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000006;
const int lg5 = 17;
const int INF = 2 * 1000000007;
const long long INFLL = 4LL * 1000000000 * 1000000000;
/***************/
int powmod (int a, int b, int mod) {
int res = 1; a %= mod;
for (; b; b >>= 1) {
if (b & 1) {
res = 1LL * res * a % mod;
}
a = 1LL * a * a % mod;
}
return res;
}
#define ll long long
ll gcd (ll a, ll b) {
while (b > 0) {
ll t = a % b;
a = b, b = t;
}
return a;
}
int lcm (int a, int b) {
return (a / gcd (a, b)) * b;
}
int is_prime (int n) {
if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
return 0;
for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
if (n % i == 0)
return 0;
return 1;
}
/******Don't forget to use long long when needed!!******/
int main() {
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
ios_base :: sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string s;
cin >> s;
int n = 0, s = 0, e = 0, w = 0;
for (char c : s) {
if (c == 'N') n = 1;
if (c == 'S') s = 1;
if (c == 'E') e = 1;
if (c == 'W') w = 1;
}
if (n + s == 1 || e + w == 1) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:67:16: error: conflicting declaration 'int s'
67 | int n = 0, s = 0, e = 0, w = 0;
| ^
a.cc:65:12: note: previous declaration as 'std::string s'
65 | string s;
| ^
a.cc:74:11: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
74 | if (n + s == 1 || e + w == 1) {
| ~ ^ ~
| | |
| 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:2:
/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:74:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
74 | if (n + s == 1 || e + w == 1) {
| ^
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:74:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'const _CharT*' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: deduced conflicting types for parameter '_CharT' ('int' and 'char')
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'const _CharT*' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: deduced conflicting types for parameter '_CharT' ('int' and 'char')
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
/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:74:13: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
74 | if (n + s == 1 || e + w == 1) {
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)'
340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:340:5: note: template argument deduction/substitution
|
s417618580
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin,sTR);
bool n, s, w, e;
for(int i = 0; i < str.length(); i++)
if(str[i] == 'E')
e = true;
else if(str[i] == 'W')
w = true;
else if(str[i] == 'N')
n = true;
else if(str[i] == 'S')
s = true;
if((e && w || !e && !w) && (n && s || !n && !s))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:17: error: 'sTR' was not declared in this scope; did you mean 'str'?
6 | getline(cin,sTR);
| ^~~
| str
|
s476639343
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
cin >> str;
int x, y;
for(int i = 0; i < n; i++)
if(str[i] == 'E')
x++;
else if(str[i] == 'W')
x--;
else if(str[i] == 'N')
y++;
else if(str[i] == 'S')
y--;
if(x == 0 && y == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:24: error: 'n' was not declared in this scope
8 | for(int i = 0; i < n; i++)
| ^
|
s290849495
|
p04019
|
C++
|
:
s/\(.\)\(.*\)\1/\2\1/
t
s/[NS]\(.*\)[NS]/\1/
s/[EW][EW]//
/^$/cYes
cNo
|
a.cc:2:3: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:6: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:8: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:12: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:14: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:17: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:19: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:4:7: error: stray '\' in program
4 | s/[NS]\(.*\)[NS]/\1/
| ^
a.cc:4:11: error: stray '\' in program
4 | s/[NS]\(.*\)[NS]/\1/
| ^
a.cc:4:18: error: stray '\' in program
4 | s/[NS]\(.*\)[NS]/\1/
| ^
a.cc:1:1: error: expected unqualified-id before ':' token
1 | :
| ^
|
s711167355
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
int a,u=0;l=0,d=0,r=0;
string s;
cin >> s;
for(int i=0;i<(int)s.size();i++){
if(s[i]=='N')u=1;
if(s[i]=='E')r=1;
if(s[i]=='W')l=1;
if(s[i]=='S')d=1;
}
if(u==d && r==l)cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:11: error: 'l' was not declared in this scope
5 | int a,u=0;l=0,d=0,r=0;
| ^
a.cc:5:15: error: 'd' was not declared in this scope
5 | int a,u=0;l=0,d=0,r=0;
| ^
a.cc:5:19: error: 'r' was not declared in this scope
5 | int a,u=0;l=0,d=0,r=0;
| ^
|
s758733549
|
p04019
|
C++
|
#include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <regex>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pl4 = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpl4 = vector<pl4>;
using vvpl4 = vector<vpl4>;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back()
#define sz size()
#define be begin()
#define en end()
#define asn assign
#define emp empty()
#define ft front()
#define bk back()
#define clr clear()
#define ins insert
#define ers erase
#define res resize
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rFOR(i,a,b) for(int i=(b);i>=(a);i--)
#define REP(i,a) for(int i=0;i<(a);i++)
#define REP1(i,a) for(int i=1;i<=(a);i++)
#define rREP(i,a) for(int i=(a-1);i>=0;i--)
#define rREP1(i,a) for(int i=(a);i>0;i--)
#define SORT(a) sort((a).be,(a).en)
#define rSORT(a) sort((a).rbegin(),(a).rend())
#define UNIQUE(a) (a).erase(unique((a).be,(a).en),(a).en)
#define PREVP(a) prev_permutation((a).be,(a).en)
#define NEXTP(a) next_permutation((a).be,(a).en)
#define BINS(a,b) binary_search((a).be,(a).en,(b))
#define LOWB(a,b) (lower_bound((a).be,(a).en,(b))-(a).be)
#define UPB(a,b) (upper_bound((a).be,(a).en,(b))-(a).be)
#define CNT(a,b) count((a).be,(a).en,b)
#define SUM(a) accumulate((a).be,(a).en,0)
#define REV(a) reverse((a).be,(a).en)
#define REGS(a,b) regex_search((a),regex(b))
#define REGM(a,b) regex_match((a),regex(b))
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define say(a) cout <<(a);
#define sal(a) cout <<(a)<<endl;
#define sak cout <<endl;
#define dbg(a) cout <<(#a)<<": "<<(a)<<endl;
#define a2l(a) ((ll)(a-97))
#define A2l(a) ((ll)(a-65))
#define l2a(a) ((char)(a+97))
#define l2A(a) ((char)(a+65))
#define DigN2(a) ((llabs(a)==0)?(1):((ll)(log2(double(llabs(a))))+1))
#define DigN10(a) ((llabs(a)==0)?(1):((ll)(log10(double(llabs(a))))+1))
#define Dig2(a,b) (((a)>>(b))&1)
#define Dig10(a,b) (ll)(((a)/((ll)(pow(10.0,(double)(b)))))%10)
#define Pow2(a) (1<<(a))
#define llin(a) ll (a);cin >>(a);
#define stin(a) string (a);cin >>(a);
#define rdn(a,b) ((a)/(b))
#define rou(a,b) ((((double(a)/double(b))-((a)/(b)))<0.5)?((a)/(b)):(((a)/(b))+1))
#define rup(a,b) ((((a)%(b))==0)?((a)/(b)):(((a)/(b))+1))
#define min(a,b) ((a<b)?(a):(b))
#define max(a,b) ((a>b)?(a):(b))
#define int ll
const ll MOD = 1e9+7;
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll sgn(ll n){
if(n==0) return 0;
else return n/abs(n);
}
ll salv(vll v){
say("{");
FOR(i,0,v.sz-1){
say(v[i]);
if(i!=v.sz-1) say(",");
}
sal("}")
}
ll DigS10(ll n){
ll m=0;
FOR(i,0,DigN10(n)-1){
m+=(ll)((llabs(n)%(ll)(pow(10.0,(double)(i+1))))/(ll)(pow(10.0,(double)i)));
}
return m;
}
ll isP(ll n){
if(n<=1) return 0;
FOR(i,2,(ll)sqrt(n)){
if(n%i==0) return 0;
}
return 1;
}
vll FactM(1,1);
vll FactMI(1,1);
ll PowM(ll a,ll b){
ll ans=1,x=(a%MOD);
FOR(i,0,DigN2(b)-1){
if(Dig2(b,i)==1) ans=(ans*x)%MOD;
if(i!=(DigN2(b)-1)) x=(x*x)%MOD;
}
return ans;
}
void CFactM(ll n){
FOR(i,FactM.sz,n){
FactM.pb((FactM[i-1]*(i%MOD))%MOD);
}
return;
}
void CFactMI(ll n){
CFactM(n);
if(FactMI.sz<(n+1)) FactMI.res(n+1,-1);
if(FactMI[n]==-1) FactMI[n]=PowM(FactM[n],MOD-2);
rFOR(i,1,n-1){
if(FactMI[i]!=-1) break;
FactMI[i]=((FactMI[i+1]*((i+1)%MOD))%MOD);
}
return;
}
ll CombM(ll n,ll k){
if((n<0)||(k<0)) return 0;
if(n<k) return 0;
if(n+1>FactMI.sz) CFactMI(n);
return ((((FactMI[k]*FactMI[n-k])%MOD)*FactM[n])%MOD);
}
signed main() {
string s,t="SENW";
bool c[4]={};
cin >> s;
REP(i,s.length()){
REP(j,4){
if(s[i]==t[j]){
c[j]=true;
}
}
}
Yn(!((c[0]^c[1])&&(c[2]^c[3]))));
return 0;
}
|
a.cc: In function 'll salv(vll)':
a.cc:109:1: warning: no return statement in function returning non-void [-Wreturn-type]
109 | }
| ^
a.cc: In function 'int main()':
a.cc:175:34: error: expected primary-expression before ')' token
175 | Yn(!((c[0]^c[1])&&(c[2]^c[3]))));
| ^
|
s218015582
|
p04019
|
C++
|
#include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <regex>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pl4 = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpl4 = vector<pl4>;
using vvpl4 = vector<vpl4>;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back()
#define sz size()
#define be begin()
#define en end()
#define asn assign
#define emp empty()
#define ft front()
#define bk back()
#define clr clear()
#define ins insert
#define ers erase
#define res resize
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rFOR(i,a,b) for(int i=(b);i>=(a);i--)
#define REP(i,a) for(int i=0;i<(a);i++)
#define REP1(i,a) for(int i=1;i<=(a);i++)
#define rREP(i,a) for(int i=(a-1);i>=0;i--)
#define rREP1(i,a) for(int i=(a);i>0;i--)
#define SORT(a) sort((a).be,(a).en)
#define rSORT(a) sort((a).rbegin(),(a).rend())
#define UNIQUE(a) (a).erase(unique((a).be,(a).en),(a).en)
#define PREVP(a) prev_permutation((a).be,(a).en)
#define NEXTP(a) next_permutation((a).be,(a).en)
#define BINS(a,b) binary_search((a).be,(a).en,(b))
#define LOWB(a,b) (lower_bound((a).be,(a).en,(b))-(a).be)
#define UPB(a,b) (upper_bound((a).be,(a).en,(b))-(a).be)
#define CNT(a,b) count((a).be,(a).en,b)
#define SUM(a) accumulate((a).be,(a).en,0)
#define REV(a) reverse((a).be,(a).en)
#define REGS(a,b) regex_search((a),regex(b))
#define REGM(a,b) regex_match((a),regex(b))
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define say(a) cout <<(a);
#define sal(a) cout <<(a)<<endl;
#define sak cout <<endl;
#define dbg(a) cout <<(#a)<<": "<<(a)<<endl;
#define a2l(a) ((ll)(a-97))
#define A2l(a) ((ll)(a-65))
#define l2a(a) ((char)(a+97))
#define l2A(a) ((char)(a+65))
#define DigN2(a) ((llabs(a)==0)?(1):((ll)(log2(double(llabs(a))))+1))
#define DigN10(a) ((llabs(a)==0)?(1):((ll)(log10(double(llabs(a))))+1))
#define Dig2(a,b) (((a)>>(b))&1)
#define Dig10(a,b) (ll)(((a)/((ll)(pow(10.0,(double)(b)))))%10)
#define Pow2(a) (1<<(a))
#define llin(a) ll (a);cin >>(a);
#define stin(a) string (a);cin >>(a);
#define rdn(a,b) ((a)/(b))
#define rou(a,b) ((((double(a)/double(b))-((a)/(b)))<0.5)?((a)/(b)):(((a)/(b))+1))
#define rup(a,b) ((((a)%(b))==0)?((a)/(b)):(((a)/(b))+1))
#define min(a,b) ((a<b)?(a):(b))
#define max(a,b) ((a>b)?(a):(b))
#define int ll
const ll MOD = 1e9+7;
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll sgn(ll n){
if(n==0) return 0;
else return n/abs(n);
}
ll salv(vll v){
say("{");
FOR(i,0,v.sz-1){
say(v[i]);
if(i!=v.sz-1) say(",");
}
sal("}")
}
ll DigS10(ll n){
ll m=0;
FOR(i,0,DigN10(n)-1){
m+=(ll)((llabs(n)%(ll)(pow(10.0,(double)(i+1))))/(ll)(pow(10.0,(double)i)));
}
return m;
}
ll isP(ll n){
if(n<=1) return 0;
FOR(i,2,(ll)sqrt(n)){
if(n%i==0) return 0;
}
return 1;
}
vll FactM(1,1);
vll FactMI(1,1);
ll PowM(ll a,ll b){
ll ans=1,x=(a%MOD);
FOR(i,0,DigN2(b)-1){
if(Dig2(b,i)==1) ans=(ans*x)%MOD;
if(i!=(DigN2(b)-1)) x=(x*x)%MOD;
}
return ans;
}
void CFactM(ll n){
FOR(i,FactM.sz,n){
FactM.pb((FactM[i-1]*(i%MOD))%MOD);
}
return;
}
void CFactMI(ll n){
CFactM(n);
if(FactMI.sz<(n+1)) FactMI.res(n+1,-1);
if(FactMI[n]==-1) FactMI[n]=PowM(FactM[n],MOD-2);
rFOR(i,1,n-1){
if(FactMI[i]!=-1) break;
FactMI[i]=((FactMI[i+1]*((i+1)%MOD))%MOD);
}
return;
}
ll CombM(ll n,ll k){
if((n<0)||(k<0)) return 0;
if(n<k) return 0;
if(n+1>FactMI.sz) CFactMI(n);
return ((((FactMI[k]*FactMI[n-k])%MOD)*FactM[n])%MOD);
}
signed main() {
string s,t="SENW";
bool c[4]={};
cin >> s;
REP(i,s.length()){
REP(j,4){
if(s[i]==t[j]){
c[j]=true;
}
}
}
Yn(!((c[0]^c[1])&&(c[2]^c[3]))))
return 0;
}
|
a.cc: In function 'll salv(vll)':
a.cc:109:1: warning: no return statement in function returning non-void [-Wreturn-type]
109 | }
| ^
a.cc: In function 'int main()':
a.cc:175:34: error: expected primary-expression before ')' token
175 | Yn(!((c[0]^c[1])&&(c[2]^c[3]))))
| ^
|
s668171569
|
p04019
|
C++
|
#include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int main()
{
scanf("%s",a);
for(res i=0;i<=strlen(a)-1;i++)
if(a[i]=='N') n++;
else if(a[i]=='S') s++;
else if(a[i]=='E') e++;
else w++;
puts(check()?"Yes":"No");
return 0;
}
#include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int main()
{
scanf("%s",a);
for(res i=0;i<=strlen(a)-1;i++)
if(a[i]=='N') n++;
else if(a[i]=='S') s++;
else if(a[i]=='E') e++;
else w++;
puts(check()?"Yes":"No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
22 | for(res i=0;i<=strlen(a)-1;i++)
| ^
a.cc: At global scope:
a.cc:36:5: error: redefinition of 'int n'
36 | int n,w,s,e;
| ^
a.cc:7:5: note: 'int n' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:7: error: redefinition of 'int w'
36 | int n,w,s,e;
| ^
a.cc:7:7: note: 'int w' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:9: error: redefinition of 'int s'
36 | int n,w,s,e;
| ^
a.cc:7:9: note: 'int s' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:11: error: redefinition of 'int e'
36 | int n,w,s,e;
| ^
a.cc:7:11: note: 'int e' previously declared here
7 | int n,w,s,e;
| ^
a.cc:37:6: error: redefinition of 'char a [100000]'
37 | char a[N];
| ^
a.cc:8:6: note: 'char a [100000]' previously declared here
8 | char a[N];
| ^
a.cc:39:13: error: redefinition of 'bool check()'
39 | inline bool check()
| ^~~~~
a.cc:10:13: note: 'bool check()' previously defined here
10 | inline bool check()
| ^~~~~
a.cc:48:5: error: redefinition of 'int main()'
48 | int main()
| ^~~~
a.cc:19:5: note: 'int main()' previously defined here
19 | int main()
| ^~~~
a.cc: In function 'int main()':
a.cc:51:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
51 | for(res i=0;i<=strlen(a)-1;i++)
| ^
|
s897644048
|
p04019
|
C++
|
#include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int main()
{
scanf("%s",a);
for(res i=0;i<=strlen(a)-1;i++)
if(a[i]=='N') n++;
else if(a[i]=='S') s++;
else if(a[i]=='E') e++;
else w++;
puts(check()?"Yes":"No");
return 0;
}
#include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int main()
{
scanf("%s",a);
for(res i=0;i<=strlen(a)-1;i++)
if(a[i]=='N') n++;
else if(a[i]=='S') s++;
else if(a[i]=='E') e++;
else w++;
puts(check()?"Yes":"No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
22 | for(res i=0;i<=strlen(a)-1;i++)
| ^
a.cc: At global scope:
a.cc:36:5: error: redefinition of 'int n'
36 | int n,w,s,e;
| ^
a.cc:7:5: note: 'int n' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:7: error: redefinition of 'int w'
36 | int n,w,s,e;
| ^
a.cc:7:7: note: 'int w' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:9: error: redefinition of 'int s'
36 | int n,w,s,e;
| ^
a.cc:7:9: note: 'int s' previously declared here
7 | int n,w,s,e;
| ^
a.cc:36:11: error: redefinition of 'int e'
36 | int n,w,s,e;
| ^
a.cc:7:11: note: 'int e' previously declared here
7 | int n,w,s,e;
| ^
a.cc:37:6: error: redefinition of 'char a [100000]'
37 | char a[N];
| ^
a.cc:8:6: note: 'char a [100000]' previously declared here
8 | char a[N];
| ^
a.cc:39:13: error: redefinition of 'bool check()'
39 | inline bool check()
| ^~~~~
a.cc:10:13: note: 'bool check()' previously defined here
10 | inline bool check()
| ^~~~~
a.cc:48:5: error: redefinition of 'int main()'
48 | int main()
| ^~~~
a.cc:19:5: note: 'int main()' previously defined here
19 | int main()
| ^~~~
a.cc: In function 'int main()':
a.cc:51:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
51 | for(res i=0;i<=strlen(a)-1;i++)
| ^
|
s609074026
|
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 | }
| ^
|
s517368759
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string ss;
bool w,n,e,s;
inline bool check()
{
if(w==e&&n==s)return 1;
return 0;
}
int main()
{
getline(cin,ss);
for(int i=0;i<ss.length();i++){
if(ss[i]=='W')w=1;
else if(ss[i]=='N')n=1;
else if(ss[i]=='E')e=1;
else ss[i]=='S')s=1;
if(check()){
puts("Yes");
return 0;
}
}
puts("No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:28: error: expected ';' before ')' token
17 | else ss[i]=='S')s=1;
| ^
| ;
|
s396554344
|
p04019
|
C++
|
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define reg register
using namespace std;
typedef long long ll;
int sleep(){
int j=0;
for(int i=1;i<=1000001;i++) j++;
return j;
}
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");
sleep();
return 0;
}
|
a.cc: In function 'int nain()':
a.cc:24:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
24 | 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
|
s744231455
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
char s[1000000];
int a[500];
int main()
{
scanf("%s",s+1);
int len=strlen(s+1);
for(int i=1;i<=n;i++)
a[s[i]]++;
if(a['S']==a['N']&&a['E']==a['W'])
printf("Yes");
else
printf("No");
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: 'n' was not declared in this scope
9 | for(int i=1;i<=n;i++)
| ^
|
s223284028
|
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 | }
| ^
|
s721654857
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string s;
int n, s, w, e;
int main(){
cin>>s;
for(int i=0; i<s.size(); i++){
if(s[i] == 'N'){ n++; }
if(s[i] == 'W'){ w++; }
if(s[i] == 'E'){ e++; }
if(s[i] == 'S'){ s++; }
}
if(s > 0 && n == 0){ cout<<"No"; return 0; }
if(n > 0 && s == 0){ cout<<"No"; return 0; }
if(w > 0 && e == 0){ cout<<"No"; return 0; }
if(e > 0 && w == 0){ cout<<"No"; return 0; }
cout<<"Yes";
return 0;
}
|
a.cc:5:8: error: conflicting declaration 'int s'
5 | int n, s, w, e;
| ^
a.cc:4:8: note: previous declaration as 'std::string s'
4 | string s;
| ^
a.cc: In function 'int main()':
a.cc:15:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
15 | if(s[i] == 'S'){ s++; }
| ~^~
a.cc:18:6: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
/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>&, cons
|
s797740548
|
p04019
|
C++
|
#include<iostream>
using namespace std;
string s;
ll n, s, w, e;
int main(){
cin>>s;
for(int i=0; i<s.size(); i++){
if(s[i] == 'N'){ n++; }
if(s[i] == 'W'){ w++; }
if(s[i] == 'E'){ e++; }
if(s[i] == 'S'){ s++; }
}
if(s > 0 && n == 0){ cout<<"No"; return 0; }
if(n > 0 && s == 0){ cout<<"No"; return 0; }
if(w > 0 && e == 0){ cout<<"No"; return 0; }
if(e > 0 && w == 0){ cout<<"No"; return 0; }
cout<<"Yes";
return 0;
}
|
a.cc:5:1: error: 'll' does not name a type
5 | ll n, s, w, e;
| ^~
a.cc: In function 'int main()':
a.cc:12:22: error: 'n' was not declared in this scope
12 | if(s[i] == 'N'){ n++; }
| ^
a.cc:13:22: error: 'w' was not declared in this scope
13 | if(s[i] == 'W'){ w++; }
| ^
a.cc:14:22: error: 'e' was not declared in this scope
14 | if(s[i] == 'E'){ e++; }
| ^
a.cc:15:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
15 | if(s[i] == 'S'){ s++; }
| ~^~
a.cc:18:6: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ~ ^ ~
| | |
| | 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:1:
/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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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: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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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: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:18:8: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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:18:8: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
/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:18:8: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
/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:18:8: note: mismatched types 'const _CharT*' and 'int'
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
/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:18:8: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 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: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:18:8: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
a.cc:18:13: error: 'n' was not declared in this scope
18 | if(s > 0 && n == 0){ cout<<"No"; return 0; }
| ^
a.cc:19:4: error: 'n' was not declared in this scope
19 | if(n > 0 && s == 0){ cout<<"No"; return 0; }
| ^
a.cc:19:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
19 | if(n > 0 && s == 0){ cout<<"No"; return 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:
/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:19:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
19 | if(n > 0 && s == 0){ cout<<"No"; return 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:19:
|
s698070363
|
p04019
|
C++
|
#include <iostream>
using namespace std;
int main()
{
string S;
cin >> S;
int n = 1, w = 1, s = 1, e = 1;
for(int i = 0; i < N; i++){
if(S.at(i) == 'N'){
n++;
}
if(S.at(i) == 'W'){
w++;
}
if(S.at(i) == 'S'){
s++;
}
if(S.at(i) == 'E'){
e++;
}
}
if(n*s == n || n*s == s || w*e == w || w*e == e){
cout << "No";
}else{
cout << "Yes";
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:28: error: 'N' was not declared in this scope
10 | for(int i = 0; i < N; i++){
| ^
|
s386908859
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int x, y, z, t;
x = y = 0;
cin >> s;
for(int i = 0; i < s.length(); i++){
if(s[i] == 'N') x++;
else if(s[i] == 'W') t++;
else if(s[i] == 'S') z++;
else y++;
}
if((x && y || (!x && !y)) && (!z && !t || (z && t) ) cout << "Yes";
else cout << "No";
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:59: error: expected ';' before 'cout'
16 | if((x && y || (!x && !y)) && (!z && !t || (z && t) ) cout << "Yes";
| ^~~~~
| ;
a.cc:17:5: error: expected primary-expression before 'else'
17 | else cout << "No";
| ^~~~
a.cc:16:74: error: expected ')' before 'else'
16 | if((x && y || (!x && !y)) && (!z && !t || (z && t) ) cout << "Yes";
| ~ ^
| )
17 | else cout << "No";
| ~~~~
|
s175680550
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string S;
int a=S.size();
int n,w,s,e;
n=0; w=0; s=0; e=0;
for(int i=0;i<a;i++){
if(S.at(i)=='N')n++;
if(S.at(i)=='W')w++;
if(S.at(i)=='S')s++;
if(S.at(i)=='E')e++;
}
if(n!=0 && s==0 || n==0 && s!=0){
cout << "No" << endl;}
else if(w!=0 && e=0 || w==0 && e!=0){
cout << "No" << endl;}
else{
cout << "Yes" << endl;}
}
|
a.cc: In function 'int main()':
a.cc:17:16: error: lvalue required as left operand of assignment
17 | else if(w!=0 && e=0 || w==0 && e!=0){
| ~~~~~^~~~
|
s346578806
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace sstd;
int main(){
bool C[4]={0,0,0,0};
string S;
cin >> S;
for(int i=0;i<S.length();i++){
if(S[i]=='N'){C[0]=true;}
if(S[i]=='S'){C[1]=true;}
if(S[i]=='E'){C[2]=true;}
if(S[i]=='W'){C[3]=true;}
}
if(C[0]==C[1] && C[2]==C[3]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return 0;
}
|
a.cc:2:17: error: 'sstd' is not a namespace-name
2 | using namespace sstd;
| ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
6 | string S;
| ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
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/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> S;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:10: error: 'S' was not declared in this scope
7 | cin >> S;
| ^
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
15 | cout << "Yes" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:15:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
15 | cout << "Yes" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout << "No" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | cout << "No" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s711501665
|
p04019
|
C++
|
#include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("Yes\n");
else printf("No\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("Yes\n");
| ^~
a.cc:40:17: error: 'else' without a previous 'if'
40 | else printf("No\n");
| ^~~~
|
s370125006
|
p04019
|
C
|
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int MCG(int a, int b)
{
if(a%b ==0)
return b;
else
return MCG(b,a%b);
}
int main()
{
map<char,int>mapa;
mapa['N']=0;
mapa['S']=0;
mapa['W']=0;
mapa['E']=0;
int i,valor=0;
string s;
cin>>s;
vector<int>v;
for(int i=0; i<s.size();i++)
{
mapa[s[i]]++;
}
for(auto e:mapa)
{
if(e.second != 0)
v.push_back(e.second);
}
if(v.size()%2 ==0)
cout<<"Yes"<<endl;
else
cout<<"NO"<<endl;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s593150803
|
p04019
|
C++
|
#include <stdin.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
a.cc:1:10: fatal error: stdin.h: No such file or directory
1 | #include <stdin.h>
| ^~~~~~~~~
compilation terminated.
|
s861829071
|
p04019
|
C++
|
#include <stdint.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:15: error: 'scanf' was not declared in this scope
15 | while(scanf("%s",ruta)!=EOF){
| ^~~~~
a.cc:15:33: error: 'EOF' was not declared in this scope
15 | while(scanf("%s",ruta)!=EOF){
| ^~~
a.cc:2:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <stdint.h>
+++ |+#include <cstdio>
2 |
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
| ^~
a.cc:40:17: error: 'else' without a previous 'if'
40 | else printf("No\n");
| ^~~~
a.cc:40:22: error: 'printf' was not declared in this scope
40 | else printf("No\n");
| ^~~~~~
a.cc:40:22: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s820664613
|
p04019
|
C
|
#include <stdint.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
main.c:3:1: error: unknown type name 'bool'
3 | bool desH(char c, char d){
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdint.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'desH':
main.c:4:84: error: 'true' undeclared (first use in this function)
4 | if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
| ^~~~
main.c:4:84: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:4:84: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:16: error: 'false' undeclared (first use in this function)
5 | return false;
| ^~~~~
main.c:5:16: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: At top level:
main.c:7:1: error: unknown type name 'bool'
7 | bool desV(char c, char d){
| ^~~~
main.c:7:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'desV':
main.c:8:85: error: 'true' undeclared (first use in this function)
8 | if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
| ^~~~
main.c:8:85: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:16: error: 'false' undeclared (first use in this function)
9 | return false;
| ^~~~~
main.c:9:16: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:15:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
15 | while(scanf("%s",ruta)!=EOF){
| ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
1 | #include <stdint.h>
+++ |+#include <stdio.h>
2 |
main.c:15:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
15 | while(scanf("%s",ruta)!=EOF){
| ^~~~~
main.c:15:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:33: error: 'EOF' undeclared (first use in this function)
15 | while(scanf("%s",ruta)!=EOF){
| ^~~
main.c:15:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:17:17: error: unknown type name 'bool'
17 | bool h=true,v=true;
| ^~~~
main.c:17:17: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:17:24: error: 'true' undeclared (first use in this function)
17 | bool h=true,v=true;
| ^~~~
main.c:17:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:24:45: error: 'false' undeclared (first use in this function)
24 | h=h?false:true;
| ^~~~~
main.c:24:45: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:38:1: error: expected expression before '/' token
38 | /
| ^
main.c:40:17: error: 'else' without a previous 'if'
40 | else printf("No\n");
| ^~~~
main.c:40:22: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
40 | else printf("No\n");
| ^~~~~~
main.c:40:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:40:22: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:40:22: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s198122326
|
p04019
|
C
|
#include <stdin.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
main.c:1:10: fatal error: stdin.h: No such file or directory
1 | #include <stdin.h>
| ^~~~~~~~~
compilation terminated.
|
s534726259
|
p04019
|
C
|
#include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s434823653
|
p04019
|
C++
|
#include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
| ^~
a.cc:40:17: error: 'else' without a previous 'if'
40 | else printf("No\n");
| ^~~~
|
s637389206
|
p04019
|
C++
|
#include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(scanf("%s",ruta)!=EOF){
char auxH='o',antH='o',auxV='o',antV='o';
bool h=true,v=true;
i=0;
while(ruta[i]!='\0'){
if( (ruta[i]=='N') || (ruta[i]=='S')){
if(antH!=ruta[i]){
h=h?false:true;
auxH=antH;
antH=ruta[i];
}
}
if( (ruta[i]=='E') || (ruta[i]=='W')){
if(antV!=ruta[i]){
v=v?false:true;
auxV=antV;
antV=ruta[i];
}
}
i++;
}
/
if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
else printf("No\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
| ^~
a.cc:40:17: error: 'else' without a previous 'if'
40 | else printf("No\n");
| ^~~~
|
s270431137
|
p04019
|
C++
|
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
int main() {
register int i; int N = 0, S = 0, W = 0, E = 0;
char str[1010];
gets(str);
for( i = 0; i < (int) strlen(str); ++i )
N |= str[i] == 'N', S |= str[i] == 'S', W |= str[i] == 'W', E |= str[i] == 'E';
puts( N ^ S || W ^ E ? "No" : "Yes" );
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
9 | register int i; int N = 0, S = 0, W = 0, E = 0;
| ^
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(str);
| ^~~~
| getw
|
s328042386
|
p04019
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <string>
#include <cmath>
using namespace std;
int main(void){
string s;
cin >> s;
int n, w, s, e;
for(int i=0;i<s.length();i++){
if(s[i]=='N'){
n++;
}
if(s[i]=='W'){
w++;
}
if(s[i]=='S'){
s++;
}
if(s[i]=='E'){
e++;
}
}
if(n==s && w==e){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:19: error: conflicting declaration 'int s'
12 | int n, w, s, e;
| ^
a.cc:10:16: note: previous declaration as 'std::string s'
10 | string s;
| ^
a.cc:21:26: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
21 | s++;
| ~^~
a.cc:27:13: error: no match for 'operator==' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
27 | if(n==s && w==e){
| ~^~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
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:27:15: note: mismatched types 'const std::fpos<_StateT>' and 'int'
27 | if(n==s && w==e){
| ^
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:27:15: note: mismatched types 'const std::allocator<_CharT>' and 'int'
27 | if(n==s && w==e){
| ^
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:27:15: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
27 | if(n==s && w==e){
| ^
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:27:15: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
27 | if(n==s && w==e){
| ^
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:27:15: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
27 | if(n==s && w==e){
| ^
/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:27:15: note: mismatched types 'const _CharT*' and 'int'
27 | if(n==s && w==e){
| ^
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:27:15: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
27 | if(n==s && w==e){
| ^
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed:
a.cc:27:15: note: mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
27 | if(n==s && w==e){
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:2050:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2050 | operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/
|
s753899835
|
p04019
|
C++
|
#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include <numeric>
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++;}
if(n>0&&w==0)
cout<<"No"<<endl;
if(n==0&&w>0)
cout<<"No"<<endl;
if(s>0&&e==0)
cout<<"No"<<endl;
if(e==0&&s>0)
cout<<"No"<<endl;
else
cout<<"Yes"<<endl;
}
|
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s438877541
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
bool n, e, w, s;
int main()
{
string S; cin >> S;
for (int i = 0; i < s.size(); i++) {
if (S[i] == 'N') n = true;
if (S[i] == 'S') e = true;
if (S[i] == 'E') w = true;
if (S[i] == 'W') s = true;
}
cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:27: error: request for member 'size' in 's', which is of non-class type 'bool'
10 | for (int i = 0; i < s.size(); i++) {
| ^~~~
|
s799551516
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
bool n, e, w, s;
int main()
{
string s; cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'N') n = true;
if (s[i] == 'S') e = true;
if (s[i] == 'E') w = true;
if (s[i] == 'W') s = true;
}
cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:16: error: no match for 'operator^' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ~ ^ ~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| bool
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bitset:1577:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator^(const bitset<_Nb>&, const bitset<_Nb>&)'
1577 | operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/bitset:1577:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::bitset<_Nb>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << 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:410:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const valarray<_Tp>&)'
1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::valarray<_Tp>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed:
a.cc:17:18: note: mismatched types 'const std::valarray<_Tp>' and 'bool'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
/usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
146 | operator^(byte __l, byte __r) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:146:18: note: no known conversion for argument 1 from 'bool' to 'std::byte'
146 | operator^(byte __l, byte __r) noexcept
| ~~~~~^~~
In file included from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)'
94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:94:27: note: no known conversion for argument 1 from 'bool' to 'std::_Ios_Fmtflags'
94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)'
144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:144:27: note: no known conversion for argument 1 from 'bool' to 'std::_Ios_Openmode'
144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)'
191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:191:26: note: no known conversion for argument 1 from 'bool' to 'std::_Ios_Iostate'
191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176:
/usr/include/c++/14/future:170:20: note: candidate: 'constexpr std::launch std::operator^(launch, launch)'
170 | constexpr launch operator^(launch __x, launch __y) noexcept
| ^~~~~~~~
/usr/include/c++/14/future:170:37: note: no known conversion for argument 1 from 'bool' to 'std::launch'
170 | constexpr launch operator^(launch __x, launch __y) noexcept
| ~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:637:3: note: candidate: 'constexpr std::chars_format std::operator^(chars_format, chars_format)'
637 | operator^(chars_format __lhs, chars_format __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/charconv:637:26: note: no known conversion for argument 1 from 'bool' to 'std::chars_format'
637 | operator^(chars_for
|
s658389950
|
p04019
|
C++
|
//#define NDEBUG
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
constexpr double PI = 3.1415926535897932;
using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;
using intl32 = std::int_least32_t;
using intl64 = std::int_least64_t;
using uintl32 = std::uint_least32_t;
using uintl64 = std::uint_least64_t;
void yes(bool c) { puts(c ? "yes" : "no"); }
void Yes(bool c) { puts(c ? "Yes" : "No"); }
void YES(bool c) { puts(c ? "YES" : "NO"); }
void pos(bool c) { puts(c ? "possible" : "impossible"); }
void Pos(bool c) { puts(c ? "Possible" : "Impossible"); }
void POS(bool c) { puts(c ? "POSSIBLE" : "IMPOSSIBLE"); }
template<class T>bool bmaxi(T&a, const T&b) { if (b<a)return 0;a = b;return 1; }
template<class T>bool bmini(T&a, const T&b) { if (a<b)return 0;a = b;return 1; }
template<class T>bool nmaxi(T&a, const T&b) { if (a<b) { a = b;return 1; }return 0; }
template<class T>bool nmini(T&a, const T&b) { if (b<a) { a = b;return 1; }return 0; }
template<typename T>auto scan(T&d)->typename std::enable_if<std::is_signed<T>::value>::type
{
d = 0;int c = fgetc(stdin);bool f = 0;while (c<'0' || '9'<c) { if (c == '-')f = 1;c = fgetc(stdin); }
while (c != ' '&&c != '\n') { d = d * 10 + c - '0';c = fgetc(stdin); }if (f)d = -d;
}
template<typename T>auto scan(T&d)->typename std::enable_if<!std::is_signed<T>::value>::type
{
d = 0;int c = fgetc(stdin);while (c == ' ' || c == '\n')c = fgetc(stdin);
while (c != ' '&&c != '\n') { d = d * 10 + c - '0';c = fgetc(stdin); }
}
void scan(char&d) { d = fgetc(stdin);while (d == ' ' || d == '\n')d = fgetc(stdin); }
void scan(double&d) { scanf("%lf", &d); }void scan(std::string&d) {
d.clear();int c = fgetc(stdin);
while (c == ' ' || c == '\n')c = fgetc(stdin);while (c != ' '&&c != '\n') { d.push_back(c);c = fgetc(stdin); }
}
template<typename F, typename...R>void scan(F&f, R&...r) { scan(f);scan(r...); }
template<typename T>T input() { T d;scan(d);return d; }
template <typename T>auto print(T d)->typename std::enable_if<std::is_signed<T>::value>::type
{
static int c[20];int i = 0;bool f = 0;if (d<0) { f = 1;d = -d; }while (d) { c[i++] = d % 10;d /= 10; }
if (!i)c[i++] = 0;if (f)fputc('-', stdout);while (i--)fputc(c[i] + '0', stdout);
}
template<typename T>auto print(T d)->typename std::enable_if<!std::is_signed<T>::value>::type
{
static int c[20];int i = 0;while (d) { c[i++] = d % 10;d /= 10; }
if (!i)c[i++] = 0;while (i--)fputc(c[i] + '0', stdout);
}
void print(const char d) { fputc(d, stdout); }void print(const double d) { printf("%f", d); }
void print(const char *c) { while (*c != '\0')fputc(*(c++), stdout); }
template<typename F, typename...R>void print(F f, R...r) { print(f);print(r...); }
template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
int main(void) {
std::string s;
scan(s);
bool c[256] = {};
for (char x : s)c[x]=1;
Yes(c['N'] ^ c['S'] || c['W'] ^ c['E']);
return 0;
}
|
a.cc:72:18: error: expected nested-name-specifier before '.' token
72 | template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
| ^
a.cc:72:18: error: expected '>' before '.' token
a.cc:72:27: error: variable or field 'println' declared void
72 | template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
| ^~~~~~~
a.cc:72:35: error: 'R' was not declared in this scope
72 | template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
| ^
a.cc:72:37: error: expected unqualified-id before '.' token
72 | template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
| ^
|
s598351285
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int a = 0, b = 0, N;
char sir[1009];
int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);
gets (sir + 1), N = strlen (sir + 1);
for (int i=1; i<=N; i++)
{
char c = sir[i];
if (c == 'N') a |= 1;
else
if (c == 'S') a |= 2;
if (c == 'E') b |= 1;
else
if (c == 'W') b |= 2;
}
if (a == 1 || a == 2 || b == 1 || b == 2)
printf ("No\n");
else
printf ("Yes\n");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:1: error: 'gets' was not declared in this scope; did you mean 'getw'?
13 | gets (sir + 1), N = strlen (sir + 1);
| ^~~~
| getw
|
s032508031
|
p04019
|
C++
|
lkjklasjlk
|
a.cc:1:1: error: 'lkjklasjlk' does not name a type
1 | lkjklasjlk
| ^~~~~~~~~~
|
s347299091
|
p04019
|
C
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int n;
string s;
bool dp[1010][3][3];
int main()
{
cin >> s;
n = s.size();
for(int i = 0;i < 1010;i++)
{
for(int j = 0;j < 3;j++)
{
for(int k = 0;k < 3;k++)
{
dp[i][j][k] = false;
}
}
}
dp[0][1][1] = true;
for(int i = 1;i <= n;i++)
{
char c = s[i - 1];
if(c == 'N')
{
for(int y = 0;y < 3;y++)
{
dp[i][1][y] = dp[i][1][y] || dp[i - 1][0][y];
dp[i][2][y] = dp[i][2][y] || dp[i - 1][1][y] || dp[i - 1][0][y];
}
}
if(c == 'S')
{
for(int y = 0;y < 3;y++)
{
dp[i][1][y] = dp[i][1][y] || dp[i - 1][2][y];
dp[i][0][y] = dp[i][0][y] || dp[i - 1][1][y] || dp[i - 1][2][y];
}
}
if(c == 'W')
{
for(int x = 0;x < 3;x++)
{
dp[i][x][1] = dp[i][x][1] || dp[i - 1][x][2];
dp[i][x][0] = dp[i][x][0] || dp[i - 1][x][1] || dp[i - 1][x][2];
}
}
if(c == 'E')
{
for(int x = 0;x < 3;x++)
{
dp[i][x][1] = dp[i][x][1] || dp[i - 1][x][0];
dp[i][x][2] = dp[i][x][2] || dp[i - 1][x][1] || dp[i - 1][x][0];
}
}
}
if(dp[n][1][1])
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
return 0;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s875689229
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const int INF=1e7;
const LL LINF=1e18;
int main(){
string s;
cin >> s;
int n=-1,w=-1,s=-1,e=-1;
for(int i=0;i<s.lenght();i++){
if(s[i]=='W') w=1;
if(s[i]=='N') n=1;
if(s[i]=='S') s=1;
if(s[i]=='E') e=1;
}
if(w*e>0&&n*s>0) puts("Yes");
else puts("No");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:19: error: conflicting declaration 'int s'
12 | int n=-1,w=-1,s=-1,e=-1;
| ^
a.cc:10:12: note: previous declaration as 'std::string s'
10 | string s;
| ^
a.cc:13:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
13 | for(int i=0;i<s.lenght();i++){
| ^~~~~~
| length
a.cc:19:16: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
19 | if(w*e>0&&n*s>0) puts("Yes");
| ~^~
| | |
| | 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:17: note: mismatched types 'const std::complex<_Tp>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: mismatched types 'const std::complex<_Tp>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
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:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: mismatched types 'const std::valarray<_Tp>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: mismatched types 'const std::valarray<_Tp>' and 'int'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
/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:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
19 | if(w*e>0&&n*s>0) puts("Yes");
| ^
|
s234263462
|
p04019
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x,kari=0;
bool
int ans=0;
int N=10,S=10, E=10, W=10;
char direction[1005];
cin>>direction;
kari=strlen(direction);
for(int i=0;i<kari;i++){
if(direction[i]=='N')N=0;
if(direction[i]=='S')S=0;
if(direction[i]=='E')E=0;
if(direction[i]=='W')W=0;
}
if(N==S&&E==W){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:5:5: error: two or more data types in declaration of 'ans'
5 | bool
| ^~~~
|
s308049059
|
p04019
|
C++
|
v
|
a.cc:1:1: error: '\U0000ff56' does not name a type
1 | v
| ^~
|
s525151612
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<long long>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
int MOD=1e9+7;
int INF=1e9+7;
//
int main(){
string S;
cin>>S;
int N=0,W=0,E=0,S=0;
FOR(i,0,(int)S.size()){
if(S[i]=='N'){
N++;
}else if(S[i]=='E'){
E++;
}else if(S[i]=='W'){
W++;
}else if(S[i]=='S'){
S++;
}
}
if(N==S&&E==W){
Yes(1);
}else{
Yes(0);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:19: error: conflicting declaration 'int S'
30 | int N=0,W=0,E=0,S=0;
| ^
a.cc:28:10: note: previous declaration as 'std::string S'
28 | string S;
| ^
a.cc:39:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
39 | S++;
| ~^~
a.cc:42:7: error: no match for 'operator==' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
42 | if(N==S&&E==W){
| ~^~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
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:42:9: note: mismatched types 'const std::fpos<_StateT>' and 'int'
42 | if(N==S&&E==W){
| ^
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:42:9: note: mismatched types 'const std::allocator<_CharT>' and 'int'
42 | if(N==S&&E==W){
| ^
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:42:9: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
42 | if(N==S&&E==W){
| ^
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:42:9: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
42 | if(N==S&&E==W){
| ^
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:42:9: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
42 | if(N==S&&E==W){
| ^
/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:42:9: note: mismatched types 'const _CharT*' and 'int'
42 | if(N==S&&E==W){
| ^
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:42:9: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
42 | if(N==S&&E==W){
| ^
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed:
a.cc:42:9: note: mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
42 | if(N==S&&E==W){
| ^
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/queue:62,
from a.cc:3:
/usr/include/c++/14/bits/stl_deque.h:2294:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2294 | operator==(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2294:5: note: template argument deduction/substitution failed:
a.cc:42:9: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
42 | if(N==S&&E==W){
| ^
In file included from /usr/include/c++/14/vector:66
|
s161171563
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<long long>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
int MOD=1e9+7;
int INF=1e9+7;
//
int main(){
string S;
cin>>S;
int L=S.size();
if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
Yes(1);
}else{
Yes(0);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:31:15: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ~^~
| | |
| | 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: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:31:16: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
In file included from /usr/include/c++/14/string:54:
/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:31:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const _CharT*' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: mismatched types 'const _CharT*' and 'int'
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
/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:31:16: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ^
a.cc:31:33: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::_
|
s158517825
|
p04019
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string a;
cin >> a;
bool n = find(a.begin(), a.end(), 'N') != a.end();
bool e = find(a.begin(), a.end(), 'E') != a.end();
bool w = find(a.begin(), a.end(), 'W') != a.end();
bool s = find(a.begin(), a.end(), 'S') != a.end();
cout << (n == s && e == w ? "Yes" : "No") << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
8 | bool n = find(a.begin(), a.end(), 'N') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
8 | bool n = find(a.begin(), a.end(), 'N') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
9 | bool e = find(a.begin(), a.end(), 'E') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:9:16: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
9 | bool e = find(a.begin(), a.end(), 'E') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:10:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
10 | bool w = find(a.begin(), a.end(), 'W') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
10 | bool w = find(a.begin(), a.end(), 'W') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
11 | bool s = find(a.begin(), a.end(), 'S') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
11 | bool s = find(a.begin(), a.end(), 'S') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
|
s583174024
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
int l, n = 0, so = 0, e = 0, w = 0;
gets(s);
l = strlen(s);
for (int i = 0; i < l; i++) {
if (s[i] == 'N')
n++;
if (s[i] == 'S')
so++;
if (s[i] == 'W')
w++;
if (s[i] == 'E')
e++;
if (so == n && e == w) {
printf("Yes");
exit(0); } }
printf("No");
return 0; }
|
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s075741429
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
int l, n = 0, so = 0, e = 0, w = 0;
gets(s);
l = strlen(s);
for (int i = 0; i <= l; i++) {
if (s[i] == 'N')
n++;
if (s[i] == 'S')
so++;
if (s[i] == 'W')
w++;
if (s[i] == 'E')
e++;
if (so == n && e == w) {
printf("Yes");
exit(0); } }
printf("No");
return 0; }
|
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s089524732
|
p04019
|
C++
|
S=raw_input()
print "No" if ("S" in S)+("N" in S)==1 or ("W" in S)+("E" in S)==1 else "Yes"
|
a.cc:1:1: error: 'S' does not name a type
1 | S=raw_input()
| ^
|
s904267826
|
p04019
|
C++
|
s = raw_input()
i=lambda c:c in s
print "No"*((i('N')^i('S'))or(i('W')^i('E')))or"Yes"
|
a.cc:1:1: error: 's' does not name a type
1 | s = raw_input()
| ^
|
s066426568
|
p04019
|
C++
|
// ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <memory>
int main()
{
bool n = false, s = false, w = false, e = false;
while(int c = std::cin.get())
{
if (c == EOF)break;
switch (c)
{
case 'N':
n = true;
break;
case 'S':
s = true;
break;
case 'W':
w = true;
break;
case 'E':
e = true;
break;
}
}
if (n && s && !e && !w || n && s && e && w || !n && !w && e & w)
{
std::cout << "Yes";
}
else
{
std::cout << "No";
}
return 0;
}
|
a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s831260586
|
p04019
|
C++
|
#include <iostream>
#include <vector>
#include <map>
#include <bitset>
#include <cmath>
using namespace std;
const int kMax = 2200;
const int kMaxPr = 500;
bitset < kMax > used;
void Init(vector < int > &prime) {
int index = 0;
for (int pr = 2; pr < kMax; pr ++) {
if (used[pr]) {
continue;
}
prime[++ index] = pr;
for (int j = pr * 2; j < kMax; j += pr) {
used[j] = true;
}
}
prime[0] = index;
}
int main(int argc, char const *argv[]) {
vector < int > prime(kMaxPr);
Init(prime);
int n;
cin >> n;
map < long long, long long > hash;
map < long long, long long > comp;
vector < long long > element(n + 1);
for (int i = 1; i <= n; i ++) {
cin >> element[i];
long long k = element[i];
hash[k] = 1ll;
comp[k] = 1ll;
if (k == 1ll) {
continue;
}
for (int j = 1; j <= prime[0] and k != 1 and prime[j] <= k; j ++) {
if (k % prime[j] != 0) {
continue;
}
int elExp = 0;
while (k % prime[j] == 0) {
elExp ++;
k /= prime[j];
}
elExp %= 3;
if (elExp == 0) {
continue;
}
if (elExp == 1) {
hash[element[i]] *= 1ll * prime[j];
comp[element[i]] *= 1ll * prime[j] * prime[j];
}
else {
hash[element[i]] *= 1ll * prime[j] * prime[j];
comp[element[i]] *= 1ll * prime[j];
}
}
if (k != 1) {
hash[element[i]] *= 1ll * k * k;
comp[element[i]] *= 1ll * k;
}
map < long long, int > frecv;
for (int i = 1; i <= n; i ++) {
frecv[hash[element[i]]] ++;
}
int to_remove = 0;
for (auto x : frecv) {
if (x.second == 0) {
continue;
}
if (x.first == 1) {
to_remove += x.second - 1;
x.second = 0;
continue;
}
int k = x.first;
int c = frecv[comp[k]];
if (c == 0) {
continue;
}
if (x.second >= c) {
to_remove += c;
}
else {
to_remove += x.second;
}
frecv[comp[k]] = 0;
}
cout << n - to_remove << '\n';
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:118:2: error: expected '}' at end of input
118 | }
| ^
a.cc:31:40: note: to match this '{'
31 | int main(int argc, char const *argv[]) {
| ^
|
s346783452
|
p04019
|
C
|
#include<stdio.h>
int main(void)
{
int i;
char S[1001];
scanf("%s",S);
int N = sizeof(S);
for (i = 0; i < N; i++) {
if (S[i] == 'N') n += 1;
if (S[i] == 'S') n -= 1;
if (S[i] == 'E') e += 1;
if (S[i] == 'W') e -= 1;
}
if (n == 0 && e == 0) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:10:24: error: 'n' undeclared (first use in this function)
10 | if (S[i] == 'N') n += 1;
| ^
main.c:10:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:24: error: 'e' undeclared (first use in this function)
12 | if (S[i] == 'E') e += 1;
| ^
|
s908204603
|
p04019
|
C
|
#include<stdio.h>
int main(void)
{
char S[1001];
scanf("%s",S);
int N = sizeof(S);
for (i = 0; i < N; i++) {
if (S[i] == 'N') n += 1;
if (S[i] == 'S') n -= 1;
if (S[i] == 'E') e += 1;
if (S[i] == 'W') e -= 1;
}
if (n == 0 && e == 0) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:8:11: error: 'i' undeclared (first use in this function)
8 | for (i = 0; i < N; i++) {
| ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:24: error: 'n' undeclared (first use in this function)
9 | if (S[i] == 'N') n += 1;
| ^
main.c:11:24: error: 'e' undeclared (first use in this function)
11 | if (S[i] == 'E') e += 1;
| ^
|
s626059658
|
p04019
|
C++
|
include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define inf 0x3fffffff
int main()
{
char a[1500];
int i, t, n,len,flag1,flag2;
while (scanf("%s", a) != EOF)
{
flag1=flag2=0;
len = strlen(a);
for (i = 0; i < len; i++)
{
if (a[i] == 'N'&&flag1 ==0)
flag1 = 1;
if (a[i] == 'S'&&flag1 == 0)
flag1 = -1;
if (a[i] == 'W'&&flag2 == 0)
flag2 = 1;
if (a[i] == 'E'&&flag2 == 0)
flag2 = -1;
if (a[i] == 'N'&&flag1 == -1)
flag1 = 10;
if (a[i] == 'S'&&flag1 == 1)
flag1 = 10;
if (a[i] == 'W'&&flag2 == -1)
flag2 = 10;
if (a[i] == 'E'&&flag2 == 1)
flag2 = 10;
}
if ((flag1 == 10 || flag1 == 0) && (flag2 == 10 || flag2 == 0))
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/stdlib.h:32,
from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
214 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type
225 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_algobase.h:66:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type
112 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
65 | #include <debug/assertions.h>
+++ |+#include <cstddef>
66 | #include <bits/stl_iterator_base_types.h>
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type
118 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_iterator.h:67,
|
s172353554
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int i,n,a,b,c,d;
char s[1000];
gets(s);
a=b=c=d=0;
n=strlen(s);
for(i=0;i<n;i++)
{
if(s[i]=='N') a++;
if(s[i]=='S') b++;
if(s[i]=='W') c++;
if(s[i]=='E') d++;
}
if(a!=0 && b!=0 && c!=0 && d!=0)
{
printf("Yes\n");
return 0;
}
else if(c!=0 && d!=0 && a==0 && b==0)
printf("Yes\n");
else if(a!=0 && b!=0 && c==0 && d==0)
printf("Yes\n");
else printf("No\n");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | gets(s);
| ^~~~
| getw
|
s179304650
|
p04019
|
C++
|
#include <map>
#include <queue>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
char s[2000];
int n, x, y, a, b, i, sum, flag;
std::ios::sync_with_stdio(false);
while (gets(s)!='\0')
{
a = b = sum = flag = 0;
n = strlen(s);
for (i = 0; i < n; i++)
{
sum = 0;
if (s[i] == 'N')
b -= 1;
if (s[i] == 'W')
a -= 1;
if (s[i] == 'S')
b += 1;
if (s[i] == 'E')
a += 1;
sum = a*a + b*b;
if (sum >= n)
{
flag = 1;
break;
}
}
if (flag)
cout << "NO" << endl;
else
cout << "YES" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
23 | while (gets(s)!='\0')
| ^~~~
| getw
|
s519892358
|
p04019
|
C++
|
#include <map>
#include <queue>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
char s[2000];
int n, x, y, a, b, i, sum, flag;
std::ios::sync_with_stdio(false);
while (gets(s))
{
a = b = sum = flag = 0;
n = strlen(s);
for (i = 0; i < n; i++)
{
sum = 0;
if (s[i] == 'N')
b -= 1;
if (s[i] == 'W')
a -= 1;
if (s[i] == 'S')
b += 1;
if (s[i] == 'E')
a += 1;
sum = a*a + b*b;
if (sum >= n)
{
flag = 1;
break;
}
}
if (flag)
cout << "NO" << endl;
else
cout << "YES" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
23 | while (gets(s))
| ^~~~
| getw
|
s752016099
|
p04019
|
C
|
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
int flag1 = 0;
int flag2 = 0;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'N'&&flag1==0)
flag1 = 1;
if (s[i] == 'S'&&flag1 == 0)
flag1 = -1;
if (s[i] == 'E'&&flag2 == 0)
flag2 = 1;
if (s[i] == 'W'&&flag2 == 0)
flag2 = -1;
if (s[i] == 'N'&&flag1 == -1)
flag1 = 100;
if (s[i] == 'S'&&flag1 == 1)
flag1 = 100;
if (s[i] == 'E'&&flag2 == -1)
flag2 = 100;
if (s[i] == 'W'&&flag2 == 1)
flag2 = 100;
}
if ((flag1 == 100 || flag1 == 0) && (flag2 == 100 || flag2 == 0))
puts("Yes");
else
puts("No");
return 0;
}
|
main.c:2:10: fatal error: cstdio: No such file or directory
2 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s094982376
|
p04019
|
C++
|
#include<stdio.h>
#include<string.h>
//using namespace std;
int main()
{
char str[1000];
while (gets(str))
{
int x = 0, y = 0;
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] == 'W')
x++;
else if (str[i] == 'E')
x--;
else if (str[i] == 'N')
y++;
else if (str[i] == 'S')
y--;
}
if (x == 0 && y == 0)
puts("Yes");
else
puts("No");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | while (gets(str))
| ^~~~
| getw
|
s242935697
|
p04019
|
C++
|
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<queue>
using namespace std;
int main()
{
char str[1000];
while (gets(str))
{
int x = 0, y = 0;
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] == 'W')
x++;
else if (str[i] == 'E')
x--;
else if (str[i] == 'N')
y++;
else if (str[i] == 'S')
y--;
}
if (x == 0 && y == 0)
puts("Yes");
else
puts("No");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | while (gets(str))
| ^~~~
| getw
|
s985023097
|
p04019
|
C++
|
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int i,n,a,b,c,d;
char s[1000];
while(gets(s))
{
a=b=c=d=0;
n=strlen(s);
for(i=0;i<n;i++)
{
if(s[i]=='N') a++;
if(s[i]=='S') b++;
if(s[i]=='W') c++;
if(s[i]=='E') d++;
if(a==b && c==d)
{
printf("Yes\n");
break;
}
}
if(i==n)
{
printf("No\n");
}
}
}
|
a.cc: In function 'int main()':
a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | while(gets(s))
| ^~~~
| getw
|
s503249209
|
p04019
|
C++
|
NSNNSNSN
|
a.cc:1:1: error: 'NSNNSNSN' does not name a type
1 | NSNNSNSN
| ^~~~~~~~
|
s007209358
|
p04019
|
C++
|
#include <bits/stdc++.h>
//#include <boost/functional/hash.hpp>
//example: unordered_set< pair<int,int>,boost::hash< std::pair<int, int> > > used;
//priority_queue< pair<int,pair<int,int> >, vector<pair<int,pair<int,int>>>, greater<pair<int,pair<int,int> > > > pqueue; //cost, vertex(行き先)
using namespace std;
#define MODULE 1000000007
#define MP make_pair
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
template<typename A, size_t N, typename T>
inline void Fill(A (&array)[N], const T &val){ //usage: int dp[10][10]; Fill(dp,INF);
std::fill( (T*)array, (T*)(array+N), val );
}
typedef pair<int, int> P;
typedef long long LL;
const int INF = INT_MAX / 2; //int_max->2*e+9 LLの時はLLONG_MAX
/*const int MAXN = 100001;
struct edge {
edge(int to, int cost) : to(to), cost(cost) {}
int to, cost;
};
vector<edge> graph[MAXN];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};*/
//-----Template---------
string s;
int main(){
ios::sync_with_stdio(false); //cout<< fixed << setprecision(10);
cin>>s;
bool n=false;
bool s=false;
bool e=false;
bool w=false;
for(int i=0;i<s.length();i++){
switch(s[i]){
case 'N':
n=true;
break;
case 'S':
s=true;
break;
case 'E':
e=true;
break;
case 'W':
w=true;
break;
}
}
//bool flag = true;
if(n!=s || e!=w){
cout<<"No"<<endl;
}else{
cout<<"Yes"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:44:21: error: request for member 'length' in 's', which is of non-class type 'bool'
44 | for(int i=0;i<s.length();i++){
| ^~~~~~
a.cc:45:17: error: invalid types 'bool[int]' for array subscript
45 | switch(s[i]){
| ^
|
s797755402
|
p04019
|
C++
|
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#define FOR(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
int cnt[] = { 0,0,0,0 };
// east, south, west, north
FOR(i, 0, n) {
int c = s[i];
if (c == 'E')
cnt[0]++;
if (c == 'S')
cnt[1]++;
if (c == 'W')
cnt[2]++;
else
cnt[3]++;
}
if ((cnt[0] && !cnt[2]) || (cnt[2] && !cnt[0]) || (cnt[1] && !cnt[3]) || (cnt[3] && !cnt[1]))
cout << "No" << endl;
else
cout << "Yes" < endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:51:31: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
51 | cout << "Yes" < endl;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
51 | cout << "Yes" < 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:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
51 | cout << "Yes" < 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:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/string_view:680: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> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/string_view:688: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>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: couldn't deduce template parameter '_CharT'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874: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>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
51 | cout << "Yes" < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
51 | cout << "Yes" < 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:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
51 | cout << "Yes" < endl;
| ^~~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/queue:62,
from a.cc:2:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::deque<_Tp, _Alloc>'
51 | cout << "Yes" < endl;
| ^~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/queue:63:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::vector<_Tp, _Alloc>'
51 | cout << "Yes" < endl;
| ^~~~
In file included from /usr/include/c++/14/queue:66:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic_ostream<char>' is not derived from 'const std::queue<_Tp, _Seq>'
51 | cout << "Yes" < endl;
| ^~~~
In file included from /usr/include/c++/14/stack:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:51:33: note: 'std::basic
|
s375163923
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define LL long long
#define ULL unsigned long long
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define IN freopen("in", "r", stdin);
#define OUT freopen("out", "w", stdout);
int n,ss,w,e;
int main()
{
char s[2000];
scanf("%s",s);
int n=strlen(s);
for (int j=0;j<n;++j)
{
if (s[j]=='N') n=1;
if (s[j]=='S') ss=1;
if (s[j]=='W') w=1;
if (s[j]=='E') e=1;
}
if (n+ss==1||w+e==1) cout<<"No"<<endl;
else couta<<"Yes"<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:14: error: 'couta' was not declared in this scope
30 | else couta<<"Yes"<<endl;
| ^~~~~
|
s036402786
|
p04019
|
C++
|
#include <cstdio>
#include <cstring>
char S[1024];
int D[256];
int main() {
scanf("%s", S);
memset(D, 0, sizeof D);
for (int i = 0; S[i]; i++)
D[S[i]] = 1;
if (D['W'] != D['E'] || D['N'] != D['S'])
printf("No\n");
else
printf("Yes\n");
return 0;
}
[z
|
a.cc:17:1: error: expected unqualified-id before '[' token
17 | [z
| ^
|
s225052076
|
p04019
|
C++
|
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
const int INF = 1e9;
#define int ll;
int n;
int a[MAX_N+10];
signed main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
int ans=0;
for(int i=1;i<=n;i++){
ans+=a[i]/2;
a[i]%=2;
if(a[i]==1 && a[i+1]!=0 && i!=n){
a[i+1]--;
ans++;
}
}
cout<<ans<<endl;
return 0;
}
|
a.cc:7:13: error: 'll' does not name a type
7 | #define int ll;
| ^~
a.cc:9:1: note: in expansion of macro 'int'
9 | int n;
| ^~~
a.cc:9:5: error: 'n' does not name a type
9 | int n;
| ^
a.cc:7:13: error: 'll' does not name a type
7 | #define int ll;
| ^~
a.cc:10:1: note: in expansion of macro 'int'
10 | int a[MAX_N+10];
| ^~~
a.cc:10:5: error: 'a' does not name a type
10 | int a[MAX_N+10];
| ^
a.cc: In function 'int main()':
a.cc:14:8: error: 'n' was not declared in this scope; did you mean 'yn'?
14 | cin>>n;
| ^
| yn
a.cc:7:13: error: 'll' was not declared in this scope
7 | #define int ll;
| ^~
a.cc:15:7: note: in expansion of macro 'int'
15 | for(int i=1;i<=n;i++)cin>>a[i];
| ^~~
a.cc:15:11: error: 'i' was not declared in this scope
15 | for(int i=1;i<=n;i++)cin>>a[i];
| ^
a.cc:15:19: error: expected ')' before ';' token
15 | for(int i=1;i<=n;i++)cin>>a[i];
| ~ ^
| )
a.cc:15:20: error: 'i' was not declared in this scope
15 | for(int i=1;i<=n;i++)cin>>a[i];
| ^
a.cc:7:13: error: 'll' was not declared in this scope
7 | #define int ll;
| ^~
a.cc:17:3: note: in expansion of macro 'int'
17 | int ans=0;
| ^~~
a.cc:17:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
17 | int ans=0;
| ^~~
| abs
a.cc:18:19: error: expected ')' before ';' token
18 | for(int i=1;i<=n;i++){
| ~ ^
| )
|
s717245418
|
p04019
|
C++
|
#include<stdio.h>
#include<iostream>
#include<string>
#include<cmath>
#include <vector>
using namespace std;
int main(void)
{
int X = 0, Y = 0,a =0,b=0;
int a, b, c, d, e;
int i;
string n;
cin >> n;
a = n.size();
for (i = 0; i < a; i++)
{
if (n[i] == 'N')
{
Y = Y + 1;
}
else if (n[i] == 'S')
{
X = X + 1;
}
else if (n[i] == 'E')
{
a = a + 1;
}
else if (n[i] == 'W')
{
b = b- 1;
}
}
if ((X > 0) && (Y > 0)&&(a>0)&&(b>0))
{
printf("Yes\n");
}
else if ((X > 0) && (Y > 0))
{
printf("Yes\n");
}
else if ((a > 0) && (b > 0))
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: redeclaration of 'int a'
12 | int a, b, c, d, e;
| ^
a.cc:11:26: note: 'int a' previously declared here
11 | int X = 0, Y = 0,a =0,b=0;
| ^
a.cc:12:16: error: redeclaration of 'int b'
12 | int a, b, c, d, e;
| ^
a.cc:11:31: note: 'int b' previously declared here
11 | int X = 0, Y = 0,a =0,b=0;
| ^
|
s905513002
|
p04019
|
C++
|
#include "stdio.h"
#include <string.h>
int main(void){
// int num;
char dir[1000];
int n_fla=0,e_flag=0,w_flag=0,s_flag=0,i,result=0;
scanf("%s",dir);
for(i=0;i<strlen(dir);i++){
if(dir[i] == 'N'){
n_flag = 1;
}else if(dir[i] == 'E'){
e_flag = 2;
}else if(dir[i] == 'W'){
w_flag = -2;
}else if(dir[i] == 'S'){
s_flag = -1;
}
}
result = n_flag + e_flag + w_flag + s_flag;
if(result == 0){
printf("Yes\n");
}else{
printf("No\n");
}
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: 'n_flag' was not declared in this scope; did you mean 's_flag'?
11 | n_flag = 1;
| ^~~~~~
| s_flag
a.cc:20:14: error: 'n_flag' was not declared in this scope; did you mean 's_flag'?
20 | result = n_flag + e_flag + w_flag + s_flag;
| ^~~~~~
| s_flag
|
s215589018
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if(a[i]=='W'){
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:9: error: 'a' was not declared in this scope
15 | else if(a[i]=='W'){
| ^
|
s014795912
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S'){
ans[0]--;
}
else if (a[i] == 'W'){
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:10: error: 'a' was not declared in this scope
15 | else if (a[i] == 'W'){
| ^
|
s836689073
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if (a[i] == 'W') {ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:10: error: 'a' was not declared in this scope
15 | else if (a[i] == 'W') {ans[1]++;
| ^
|
s054007925
|
p04019
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if (a[i] == 'W') {
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:26: error: 'a' was not declared in this scope
17 | else if (a[i] == 'W') {
| ^
|
s936797236
|
p04019
|
Java
|
import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] s = sc.next().toCharArray();
String[] tmp = new String[s.length];
// System.out.println(s);
boolean Ncount = false;
boolean Wcount = false;
boolean Scount = false;
boolean Ecount = false;
for (int i = 0; i < s.length; i++) {
// System.out.println(Arrays.toString(tmp));
if (s[i] == 'N') {
Ncount = true;
}
if (s[i] == 'W') {
Wcount = true;
}
if (s[i] == 'S') {
Scount = true;
}
if (s[i] == 'E') {
Ecount = true;
}
}
// System.out.println(Arrays.toString(tmp));
// System.out.println("N:"+Ncount+" W:"+Wcount+" S:"+Scount+"
// E:"+Ecount);
if ((Wcount == Ecount) && (Ncount == Scount)) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
|
Main.java:4: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s779151483
|
p04019
|
Java
|
import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String path = r.readLine();
int p = 0;
for (int j = 0; j < path.length(); j++)
p |= (path.charAt(j) == 'S' ? 1 : path.charAt(j) == 'N' ? 2 : path.charAt(j) == 'W' ? 4 : 8);
return p == 3 || p == 12 || p == 15 ? "Yes" : "No";
}
}
|
Main.java:14: error: incompatible types: unexpected return value
return p == 3 || p == 12 || p == 15 ? "Yes" : "No";
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.