criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
  string T;
  cin >> T;
  
  int n, s, e, w = 0;
  for (int i = 0; i < S.size(); i++) {
    if (T.at(i) == "N") {
      n++;
    }
    if (T.at(i) == "S") {
      s++;
    }
    if (T.at(i) == "E") {
      e++;
    }
    if (T.at(i) == "W") {
      w++;
    }
  }
  
  if (n > 0 && s == 0) {
    cout << "No" << endl;
  }
  else if (s > 0 && n == 0) {
    cout << "No" << endl;
  }
  else if (e > 0 && w == 0) {
    cout << "No" << endl;
  }
  else if (w > 0 && e == 0) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'S' was not declared in this scope
    9 |   for (int i = 0; i < S.size(); i++) {
      |                       ^
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (T.at(i) == "N") {
      |         ~~~~~~~~^~~~~~
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (T.at(i) == "S") {
      |         ~~~~~~~~^~~~~~
a.cc:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (T.at(i) == "E") {
      |         ~~~~~~~~^~~~~~
a.cc:19:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |     if (T.at(i) == "W") {
      |         ~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  
  int n, s, e, w = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == "N") {
      n++;
    }
    if (S.at(i) == "S") {
      s++;
    }
    if (S.at(i) == "E") {
      e++;
    }
    if (S.at(i) == "W") {
      w++;
    }
  }
  
  if (n > 0 && s == 0) {
    cout << "No" << endl;
  }
  else if (s > 0 && n == 0) {
    cout << "No" << endl;
  }
  else if (e > 0 && w == 0) {
    cout << "No" << endl;
  }
  else if (w > 0 && e == 0) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (S.at(i) == "N") {
      |         ~~~~~~~~^~~~~~
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (S.at(i) == "S") {
      |         ~~~~~~~~^~~~~~
a.cc:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (S.at(i) == "E") {
      |         ~~~~~~~~^~~~~~
a.cc:19:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |     if (S.at(i) == "W") {
      |         ~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int a = S.size();
  int TZ = 0;
  int NB = 0;
  int a, b, c, d;
  for(int i = 0; i < a; i++){
char H = S[i];
   if(S[i] == 'N') a++;
    else if(S[i] == 'S') b--;
    else if (S[i] == 'W') c++;
    else d--;
  }
  
  if(a > 0 && b > 0 && c > 0 && d > 0){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a'
   10 |   int a, b, c, d;
      |       ^
a.cc:7:7: note: 'int a' previously declared here
    7 |   int a = S.size();
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int a = S.size();
  int TZ = 0;
  int NB = 0;
  int a, b, c, d;
  for(int i = 0; i < a; i++){
char H = S[i];
   if(S[i] == 'N') a++;
    else if(S[i] == 'S') b--;
    else if (S[i] == 'W') c++;
    else d--;
  }
  
  if(a > 0 && b > 0 && c > 0 && d > 0;){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a'
   10 |   int a, b, c, d;
      |       ^
a.cc:7:7: note: 'int a' previously declared here
    7 |   int a = S.size();
      |       ^
a.cc:19:39: error: expected primary-expression before ')' token
   19 |   if(a > 0 && b > 0 && c > 0 && d > 0;){
      |                                       ^
Language: C++

 
int main() {
  string S;
  cin >> S;
  int a = S.size();
  int TZ = 0;
  int NB = 0;
  for(int i = 0; i < a; i++){
char H = S[i];
   if(S[i] == 'N') NB++;
    else if(S[i] == 'S') NB--;
    else if (S[i] == 'W') TZ++;
    else TZ--;
  }
  
  if(TZ == 0 && NB == 0){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> S;
      |   ^~~
a.cc:4:10: error: 'S' was not declared in this scope
    4 |   cin >> S;
      |          ^
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:17:22: error: 'endl' was not declared in this scope
   17 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:19:8: error: 'cout' was not declared in this scope
   19 |   else cout << "No" << endl;
      |        ^~~~
a.cc:19:24: error: 'endl' was not declared in this scope
   19 |   else cout << "No" << endl;
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
#define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
static const ll INF = 1LL << 60;
//Write From this Line
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}

int main()
{
	string s;
	cin >> s;
	leftunique(s);
	if(s.size() == 2 || s.size() == 4){
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

}


Compiler output:
a.cc:13:9: warning: "leftunique" redefined
   13 | #define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
      |         ^~~~~~~~~~
a.cc:8:9: note: this is the location of the previous definition
    8 | #define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
      |         ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:24: error: 'SORT' was not declared in this scope
   13 | #define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
      |                        ^~~~
a.cc:19:9: note: in expansion of macro 'leftunique'
   19 |         leftunique(s);
      |         ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[1010];
int n,v1,v2,v3,v4;
int main()
{
	gets(s);
	n=strlen(s);
	for(int i=0;i<n;i++)
	{
		if(s[i]=='N')v1=1;
		if(s[i]=='W')v2=1;
		if(s[i]=='S')v3=1;
		if(s[i]=='E')v4=1;
	}
	if((v1^v3)||(v2^v3))
		printf("No");
	else printf("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

s = gets.chomp
news = s.split('').uniq()
ans = 'No'
if news.length() == 4 && (news.include?('S') && news.include?('N') && news.include?('W') && news.include?('E'))
  ans = 'Yes'
elsif news.length() == 2 && ((news.include?('S') && news.include?('N')) || (news.include?('W') && news.include?('E')))
  ans = "Yes"
end

puts ans

Compiler output:
a.cc:2:16: error: empty character constant
    2 | news = s.split('').uniq()
      |                ^~
a.cc:3:7: warning: multi-character character constant [-Wmultichar]
    3 | ans = 'No'
      |       ^~~~
a.cc:5:9: warning: multi-character character constant [-Wmultichar]
    5 |   ans = 'Yes'
      |         ^~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.chomp
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  bool N=0,S=0,E=0,W=0;
  string S;
  cin >> S;
  for(int i=0;i<S.size();i++)
  {
    char b=S.at(i);
    if(b=='N')N=1;
    else if(b=='S')S=1;
    else if(b=='E')E=1;
    else if(b=='W')W=1;
  }
  if(N==S&&E==W)cout << "Yes" << endl;
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: conflicting declaration 'std::string S'
    6 |   string S;
      |          ^
a.cc:5:12: note: previous declaration as 'bool S'
    5 |   bool N=0,S=0,E=0,W=0;
      |            ^
a.cc:8:19: error: request for member 'size' in 'S', which is of non-class type 'bool'
    8 |   for(int i=0;i<S.size();i++)
      |                   ^~~~
a.cc:10:14: error: request for member 'at' in 'S', which is of non-class type 'bool'
   10 |     char b=S.at(i);
      |              ^~
Language: C++

#include <iostream>
//#include <iomanip>
#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <bitset>
//#include <math.h>
using namespace std ;
//using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;

//ll mod = 1000000007 ;
//long double pie = acos(-1) ;

string yorn(bool a){if(a) return"Yes" ; return "No" ;}
//string YorN(bool a){if(a) return"YES" ; return "NO" ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}

int main(){
	bool n,s,e,w ;
	n = s = e = w = false ;
	string s ; cin >> s ;
	for(int i=0;i<s.size();i++){
		if(s.at(i)=='N') n = true ;
		if(s.at(i)=='S') s = true ;
		if(s.at(i)=='E') e = true ;
		if(s.at(i)=='W') w = true ;
	}
	cout << yorn((n==s)&&(e==w)) << endl ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:16: error: conflicting declaration 'std::string s'
   37 |         string s ; cin >> s ;
      |                ^
a.cc:35:16: note: previous declaration as 'bool s'
   35 |         bool n,s,e,w ;
      |                ^
a.cc:38:25: error: request for member 'size' in 's', which is of non-class type 'bool'
   38 |         for(int i=0;i<s.size();i++){
      |                         ^~~~
a.cc:39:22: error: request for member 'at' in 's', which is of non-class type 'bool'
   39 |                 if(s.at(i)=='N') n = true ;
      |                      ^~
a.cc:40:22: error: request for member 'at' in 's', which is of non-class type 'bool'
   40 |                 if(s.at(i)=='S') s = true ;
      |                      ^~
a.cc:41:22: error: request for member 'at' in 's', which is of non-class type 'bool'
   41 |                 if(s.at(i)=='E') e = true ;
      |                      ^~
a.cc:42:22: error: request for member 'at' in 's', which is of non-class type 'bool'
   42 |                 if(s.at(i)=='W') w = true ;
      |                      ^~
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        boolean ns = true;
        if (0 <= s.indexOf("N") || 0 <= s.indexOf("S")) {
            ns = (0 <= s.indexOf("N") && 0 <= s.indexOf("S"));
        }
        boolean ew = true;
        if (0 <= s.indexOf("E") || 0 <= s.indexOf("W")) {
            ew = (0 <= s.indexOf("E") && 0 <= s.indexOf("W"));
        }
        String result = ns && ew ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
}import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        boolean ns = true;
        if (0 <= s.indexOf("N") || 0 <= s.indexOf("S")) {
            ns = (0 <= s.indexOf("N") && 0 <= s.indexOf("S"));
        }
        boolean ew = true;
        if (0 <= s.indexOf("E") || 0 <= s.indexOf("W")) {
            ew = (0 <= s.indexOf("E") && 0 <= s.indexOf("W"));
        }
        String result = ns && ew ? "Yes" : "No";

        // 出力
        System.out.println(result);
        sc.close();
    }
}

Compiler output:
Main.java:26: error: class, interface, enum, or record expected
}import java.util.Scanner;
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long;
using ll = long long;
#define rep(i,n) for(lint (i) = 0;(i) < (lint)(n);(i)++)
#define repInRange(i,start,end) for(lint (i) = (start);(i) < (end);++(i))
using pl = pair<lint,lint>;
using Vecint = vector<lint>;
using Llist = list<lint>;

ll pow(ll k,ll l) {
	ll ret = 1;
	rep(i,l) {
		ret *= k;
	}
	return ret;
}

template <typename T>
T sum(vector<T> vec) {
	ll ret = 0;
	rep(i,vec.size()) {
		ret += vec.at(i);
	}
	return ret;
}

void Main() {
	string s;
	pl c(0,0);
	cin >> s;
	rep(i,s.size()) {
		switch s[i] {
		case 'N':
			c.second++;
			break;
		case 'E':
			c.first++;
			break;
		case 'W':
			c.first--;
			break;
		case 'S':
			c.second--;
			break;
		}
	}
	if (!((c.first())&(c.second()))) {
		cout << "Yes" << '\n';
		return;
	}
	cout << "No" << '\n';
	return;
}

signed main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	Main();
	return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:33:24: error: expected '(' before 's'
   33 |                 switch s[i] {
      |                        ^
      |                        (
a.cc:48:23: error: expression cannot be used as a function
   48 |         if (!((c.first())&(c.second()))) {
      |                ~~~~~~~^~
a.cc:48:36: error: expression cannot be used as a function
   48 |         if (!((c.first())&(c.second()))) {
      |                            ~~~~~~~~^~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int n,e,s,w;
    char ch;
    scanf("%c",&ch");
    for(int i=1;i<=ch.size;i++)
    {
        if(ch[i]='W')
        {
            w++;
        }
        if(ch[i]='N')
        {
            n++;
        }
        if(ch[i]='E')
        {
            e++;
        }
        if(ch[i]='S')
        {
            s++;
        }
    }
    if(n-s==0&&e-w==0)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}

Compiler output:
a.cc:9:19: warning: missing terminating " character
    9 |     scanf("%c",&ch");
      |                   ^
a.cc:9:19: error: missing terminating " character
    9 |     scanf("%c",&ch");
      |                   ^~~
a.cc: In function 'int main()':
a.cc:9:19: error: expected ')' before 'for'
    9 |     scanf("%c",&ch");
      |          ~        ^
      |                   )
   10 |     for(int i=1;i<=ch.size;i++)
      |     ~~~            
a.cc:10:17: error: 'i' was not declared in this scope
   10 |     for(int i=1;i<=ch.size;i++)
      |                 ^
a.cc:10:23: error: request for member 'size' in 'ch', which is of non-class type 'char'
   10 |     for(int i=1;i<=ch.size;i++)
      |                       ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int n,e,s,w;
    char ch;
    scanf("%c，&ch");
    for(int i=1;i<=ch.size;i++)
    {
        if(ch[i]='W')
        {
            w++;
        }
        if(ch[i]='N')
        {
            n++;
        }
        if(ch[i]='E')
        {
            e++;
        }
        if(ch[i]='S')
        {
            s++;
        }
    }
    if(n-s==0&&e-w==0)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: request for member 'size' in 'ch', which is of non-class type 'char'
   10 |     for(int i=1;i<=ch.size;i++)
      |                       ^~~~
a.cc:12:14: error: invalid types 'char[int]' for array subscript
   12 |         if(ch[i]='W')
      |              ^
a.cc:16:14: error: invalid types 'char[int]' for array subscript
   16 |         if(ch[i]='N')
      |              ^
a.cc:20:14: error: invalid types 'char[int]' for array subscript
   20 |         if(ch[i]='E')
      |              ^
a.cc:24:14: error: invalid types 'char[int]' for array subscript
   24 |         if(ch[i]='S')
      |              ^
Language: C++

var w,n,e,s:longint;
    x:char;
begin
  while not eoln do
  begin
    read(x);
    case x of
      'W':w:=1;
      'N':n:=1;
      'E':e:=1;
      'S':s:=1;
    end;
  end;
  if (w=e) and (n=s) then
    writeln('Yes')
  else
    writeln('No');
end.

Compiler output:
a.cc:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     writeln('Yes')
      |             ^~~~~
a.cc:17:13: warning: multi-character character constant [-Wmultichar]
   17 |     writeln('No');
      |             ^~~~
a.cc:1:1: error: 'var' does not name a type
    1 | var w,n,e,s:longint;
      | ^~~
a.cc:2:5: error: 'x' does not name a type
    2 |     x:char;
      |     ^
a.cc:3:1: error: 'begin' does not name a type
    3 | begin
      | ^~~~~
a.cc:7:5: error: expected unqualified-id before 'case'
    7 |     case x of
      |     ^~~~
a.cc:9:7: error: expected unqualified-id before 'N'
    9 |       'N':n:=1;
      |       ^~~
a.cc:10:7: error: expected unqualified-id before 'E'
   10 |       'E':e:=1;
      |       ^~~
a.cc:11:7: error: expected unqualified-id before 'S'
   11 |       'S':s:=1;
      |       ^~~
a.cc:12:5: error: 'end' does not name a type
   12 |     end;
      |     ^~~
a.cc:13:3: error: 'end' does not name a type
   13 |   end;
      |   ^~~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if (w=e) and (n=s) then
      |   ^~
a.cc:18:1: error: 'end' does not name a type
   18 | end.
      | ^~~
Language: C++

#include<bits/stdc++.h> 
using namespace std;
int b,l;
string s;
int main(){
    cin>>s;
    l=s.length();
    for(register int i=0;i<l;++i){
        if(s[i]=='S'){
            b=0;
            for(register int i=0;i<l;++i)if(a[i]=='N'){
                b=1;
                break;
            }
            if(!b){
                puts("No");
                return 0;
            }
        }if(s[i]=='N'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='S'){
                b=1;
                break;
            }if(!b){
                puts("No");
                return 0;
            }
        }if(s[i]=='E'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='W'){
                b=1;
                break;
            }
            if(!b){
                puts("No");
                return 0;
            }
        }if(s[i]=='W'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='E'){
                b=1;
                break;
            }if(!b){
                puts("No");
                return 0;
            }
        }
    }
    puts("Yes");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |     for(register int i=0;i<l;++i){
      |                      ^
a.cc:11:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   11 |             for(register int i=0;i<l;++i)if(a[i]=='N'){
      |                              ^
a.cc:11:45: error: 'a' was not declared in this scope
   11 |             for(register int i=0;i<l;++i)if(a[i]=='N'){
      |                                             ^
a.cc:21:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |             for(register int i=0;i<l;i++)if(a[i]=='S'){
      |                              ^
a.cc:21:45: error: 'a' was not declared in this scope
   21 |             for(register int i=0;i<l;i++)if(a[i]=='S'){
      |                                             ^
a.cc:30:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |             for(register int i=0;i<l;i++)if(a[i]=='W'){
      |                              ^
a.cc:30:45: error: 'a' was not declared in this scope
   30 |             for(register int i=0;i<l;i++)if(a[i]=='W'){
      |                                             ^
a.cc:40:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |             for(register int i=0;i<l;i++)if(a[i]=='E'){
      |                              ^
a.cc:40:45: error: 'a' was not declared in this scope
   40 |             for(register int i=0;i<l;i++)if(a[i]=='E'){
      |                                             ^
Language: C++

#include<bits/stdc++.h> 
using namespace std;
int b,l;
string s;
int main(){
    cin>>s;
    l=s.length();
    for(register int i=0;i<l;++i){
        if(s[i]=='S'){
            b=0;
            for(register int i=0;i<l;++i)if(a[i]=='N'){
                b=1;
                break;
            }
            if(!b){
                puts("No");
                return 0;
            }
        }if(a[i]=='N'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='S'){
                b=1;
                break;
            }if(!b){
                puts("No");
                return 0;
            }
        }if(a[i]=='E'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='W'){
                b=1;
                break;
            }
            if(!b){
                puts("No");
                return 0;
            }
        }if(a[i]=='W'){
            b=0;
            for(register int i=0;i<l;i++)if(a[i]=='E'){
                b=1;
                break;
            }if(!b){
                puts("No");
                return 0;
            }
        }
    }
    puts("Yes");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |     for(register int i=0;i<l;++i){
      |                      ^
a.cc:11:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   11 |             for(register int i=0;i<l;++i)if(a[i]=='N'){
      |                              ^
a.cc:11:45: error: 'a' was not declared in this scope
   11 |             for(register int i=0;i<l;++i)if(a[i]=='N'){
      |                                             ^
a.cc:19:13: error: 'a' was not declared in this scope
   19 |         }if(a[i]=='N'){
      |             ^
a.cc:21:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |             for(register int i=0;i<l;i++)if(a[i]=='S'){
      |                              ^
a.cc:28:13: error: 'a' was not declared in this scope
   28 |         }if(a[i]=='E'){
      |             ^
a.cc:30:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |             for(register int i=0;i<l;i++)if(a[i]=='W'){
      |                              ^
a.cc:38:13: error: 'a' was not declared in this scope
   38 |         }if(a[i]=='W'){
      |             ^
a.cc:40:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |             for(register int i=0;i<l;i++)if(a[i]=='E'){
      |                              ^
Language: C++

#include<bits/stdc++.h>
#include<cmath>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
const ll MOD = 1000000007;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define fs first
#define sc second
 
template<typename T>
T gcd(T a,T b){return b?gcd(b,a%b):a;}

const int INF = 1e9;
const ll LLINF = 1e16;
 
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

// 割り算の切り上げ処理
template<typename T>
T round_up(T a, T b) {
  return (a + b - 1) / b;
}


using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    //auto dp=make_v<int>(4,h,w);
    //fill_v(dp,0);
    string s;
    cin >> s;
    bool sflag = false;
    bool nflag = false;
    bool eflag = false;
    bool wflag = false;
    rep(i,n){
        if(sflag && s[i] != 'S' && s[i] != 'N'){
            print("No");
            return 0;
        }
        if(nflag && s[i] != 'S' && s[i] != 'N'){
            print("No");
            return 0;
        }
        if(eflag && s[i] != 'E' && s[i] != 'W'){
            print("No");
            return 0;
        }
        if(wflag && s[i] != 'E' && s[i] != 'W'){
            print("No");
            return 0;
        }
        if(s[i] == 'S') sflag = true;
        if(s[i] == 'N') nflag = true;
        if(s[i] == 'E') eflag = true;
        if(s[i] == 'W') wflag = true;
    }
    print("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:11: error: 'n' was not declared in this scope
   78 |     rep(i,n){
      |           ^
a.cc:9:39: note: in definition of macro 'rep'
    9 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
      |                                       ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
string str;
int w,n,e,s;
bool check()
{
    if(w==1 && e==1 && n==1 && s==1) return 1;
    if(w==1 && e==1 && n==0 && s==0) return 1;
    if(w==0 && e==0 && n==1 && s==1) return 1;
    if(w==0 && e==0 && n==0 && s==0) return 1;
    return 0;
}
int nain()
{
	getline(cin,str);
	for(int i=0;i<str.length();i++)
	{
		if(str[i]=='W') w++;
		else if(str[i]=='N') n++;
		else if(str[i]=='E') e++;
		else s++;
	}
	if(check()) printf("Yes");
	else printf("No");
	printf("\n");
	return 0;
}

Compiler output:
/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
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  string T;
  cin >> T;
  iny N = 0, E = 0, S = 0, W = 0;
  for(int i = 0; i < T.size() ;i++){
    if(T.at(i) == 'N')N++;
    else if(T.at(i) == 'E')E++;
    else if(T.at(i) == 'S')S++;
    else if(T.at(i) == 'W')W++;
  }
  int flag = 1;
  if(N == 0 && S != 0)flag = 0;
  if(N != 0 && S == 0)flag = 0;
  if(W == 0 && E != 0)flag = 0;
  if(W != 0 && E != 0)flag = 0;
  cout << (flag?"Yes":"No") << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'iny' was not declared in this scope; did you mean 'int'?
    6 |   iny N = 0, E = 0, S = 0, W = 0;
      |   ^~~
      |   int
a.cc:8:23: error: 'N' was not declared in this scope
    8 |     if(T.at(i) == 'N')N++;
      |                       ^
a.cc:9:28: error: 'E' was not declared in this scope
    9 |     else if(T.at(i) == 'E')E++;
      |                            ^
a.cc:10:28: error: 'S' was not declared in this scope
   10 |     else if(T.at(i) == 'S')S++;
      |                            ^
a.cc:11:28: error: 'W' was not declared in this scope
   11 |     else if(T.at(i) == 'W')W++;
      |                            ^
a.cc:14:6: error: 'N' was not declared in this scope
   14 |   if(N == 0 && S != 0)flag = 0;
      |      ^
a.cc:14:16: error: 'S' was not declared in this scope
   14 |   if(N == 0 && S != 0)flag = 0;
      |                ^
a.cc:15:6: error: 'N' was not declared in this scope
   15 |   if(N != 0 && S == 0)flag = 0;
      |      ^
a.cc:15:16: error: 'S' was not declared in this scope
   15 |   if(N != 0 && S == 0)flag = 0;
      |                ^
a.cc:16:6: error: 'W' was not declared in this scope
   16 |   if(W == 0 && E != 0)flag = 0;
      |      ^
a.cc:16:16: error: 'E' was not declared in this scope
   16 |   if(W == 0 && E != 0)flag = 0;
      |                ^
a.cc:17:6: error: 'W' was not declared in this scope
   17 |   if(W != 0 && E != 0)flag = 0;
      |      ^
a.cc:17:16: error: 'E' was not declared in this scope
   17 |   if(W != 0 && E != 0)flag = 0;
      |                ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<math.h>
using namespace std;
 
int main() {
	int n=0,w=0,s=0,e=0;
    int ns = 0, we = 0;
	string s;
	cin >> s;
    
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] == 'N')n = 1;
		else if (s[i] == 'S')y = 1;
		else if (s[i] == 'W')z = 1;
		else if (s[i] == 'E')t = 1;
	}
       
    ns = s + n;
    we = w + e;
 
	if (ns == 1 || we == 1)cout << "No" << endl;
	else cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: conflicting declaration 'std::string s'
   10 |         string s;
      |                ^
a.cc:8:21: note: previous declaration as 'int s'
    8 |         int n=0,w=0,s=0,e=0;
      |                     ^
a.cc:13:31: error: request for member 'length' in 's', which is of non-class type 'int'
   13 |         for (int i = 0; i < s.length(); i++)
      |                               ^~~~~~
a.cc:15:22: error: invalid types 'int[int]' for array subscript
   15 |                 if (s[i] == 'N')n = 1;
      |                      ^
a.cc:16:27: error: invalid types 'int[int]' for array subscript
   16 |                 else if (s[i] == 'S')y = 1;
      |                           ^
a.cc:16:38: error: 'y' was not declared in this scope
   16 |                 else if (s[i] == 'S')y = 1;
      |                                      ^
a.cc:17:27: error: invalid types 'int[int]' for array subscript
   17 |                 else if (s[i] == 'W')z = 1;
      |                           ^
a.cc:17:38: error: 'z' was not declared in this scope
   17 |                 else if (s[i] == 'W')z = 1;
      |                                      ^
a.cc:18:27: error: invalid types 'int[int]' for array subscript
   18 |                 else if (s[i] == 'E')t = 1;
      |                           ^
a.cc:18:38: error: 't' was not declared in this scope
   18 |                 else if (s[i] == 'E')t = 1;
      |                                      ^
Language: C

#include<stdio.h>
#include<string.h>
int main() {
  char in;
  int N,S,W,E;
  scanf("%c",&in);
  N = strchr(in, (int)'N');
  S = strchr(in, (int)'S');
  W = strchr(in, (int)'W');
  E = strchr(in, (int)'E');
  if (N != (null) && S != (null)){
    printf("Yes\n");
  } else if (W != (null) && E != (null)){
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0 ;
}
  


Compiler output:
main.c: In function 'main':
main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    7 |   N = strchr(in, (int)'N');
      |              ^~
      |              |
      |              char
In file included from main.c:2:
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:7:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    7 |   N = strchr(in, (int)'N');
      |     ^
main.c:8:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    8 |   S = strchr(in, (int)'S');
      |              ^~
      |              |
      |              char
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:8:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    8 |   S = strchr(in, (int)'S');
      |     ^
main.c:9:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    9 |   W = strchr(in, (int)'W');
      |              ^~
      |              |
      |              char
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:9:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    9 |   W = strchr(in, (int)'W');
      |     ^
main.c:10:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
   10 |   E = strchr(in, (int)'E');
      |              ^~
      |              |
      |              char
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'char'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:10:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   10 |   E = strchr(in, (int)'E');
      |     ^
main.c:11:13: error: 'null' undeclared (first use in this function)
   11 |   if (N != (null) && S != (null)){
      |             ^~~~
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
int main() {
  char S;
  int N,S,W,E;
  scanf("%c",&S);
  N = strchr(S, (int)'N');
  S = strchr(S, (int)'S');
  W = strchr(S, (int)'W');
  E = strchr(S, (int)'E');
  if (N != (null) && S != (null)){
    printf("Yes\n");
  } else if (W != (null) && E != (null)){
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0 ;
}
  

Compiler output:
main.c: In function 'main':
main.c:5:9: error: conflicting types for 'S'; have 'int'
    5 |   int N,S,W,E;
      |         ^
main.c:4:8: note: previous declaration of 'S' with type 'char'
    4 |   char S;
      |        ^
main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    7 |   N = strchr(S, (int)'N');
      |              ^
      |              |
      |              int
In file included from main.c:2:
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:7:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    7 |   N = strchr(S, (int)'N');
      |     ^
main.c:8:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    8 |   S = strchr(S, (int)'S');
      |              ^
      |              |
      |              int
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:8:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    8 |   S = strchr(S, (int)'S');
      |     ^
main.c:9:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
    9 |   W = strchr(S, (int)'W');
      |              ^
      |              |
      |              int
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:9:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    9 |   W = strchr(S, (int)'W');
      |     ^
main.c:10:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion]
   10 |   E = strchr(S, (int)'E');
      |              ^
      |              |
      |              int
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int'
  246 | extern char *strchr (const char *__s, int __c)
      |                      ~~~~~~~~~~~~^~~
main.c:10:5: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   10 |   E = strchr(S, (int)'E');
      |     ^
main.c:11:13: error: 'null' undeclared (first use in this function)
   11 |   if (N != (null) && S != (null)){
      |             ^~~~
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util*;
import java.io.*;

public class Main {
    
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String S = br.readLine();
        br.close();

        int N = S.length();

        boolean[] direction = new boolean[4];
        Map<Character, Integer> chr_code = new HashMap<>();

        chr_code.put('N', 0);
        chr_code.put('S', 1);
        chr_code.put('E', 2);
        chr_code.put('W', 3);

        for(int i = 0; i < N; i++){
            char now_chr = S.charAt(i);
            direction[chr_code.get(now_chr)] = true;
        }

        if(
            !(direction[0] ^ direction[1]) &&
            !(direction[2] ^ direction[3])
        ){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util*;
                ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;


int main() {
    string T;
    cin >> T;
    bool N = false, W = false, S = false, E = false;
    for (int i = 0; i < S.size(); i++){
        if (T.at(i) == 'N'){
            N = true;
        }
        if (T.at(i) == 'E'){
            E = true;
        }
        if (T.at(i) == 'W'){
            W = true;
        }
        if (T.at(i) == 'S'){
            S = true;
        }
    }
    if ((N && S) && (E && W)){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool'
   13 |     for (int i = 0; i < S.size(); i++){
      |                           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;


int main() {
    string T;
    cin >> T;
    bool N = false, W = false, S = false, E = false;
    for (int i = 0; i < S.size(); i++){
        if (S.at(i) == 'N'){
            N = true;
        }
        if (S.at(i) == 'E'){
            E = true;
        }
        if (S.at(i) == 'W'){
            W = true;
        }
        if (S.at(i) == 'S'){
            S = true;
        }
    }
    if ((N && S) && (E && W)){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool'
   13 |     for (int i = 0; i < S.size(); i++){
      |                           ^~~~
a.cc:14:15: error: request for member 'at' in 'S', which is of non-class type 'bool'
   14 |         if (S.at(i) == 'N'){
      |               ^~
a.cc:17:15: error: request for member 'at' in 'S', which is of non-class type 'bool'
   17 |         if (S.at(i) == 'E'){
      |               ^~
a.cc:20:15: error: request for member 'at' in 'S', which is of non-class type 'bool'
   20 |         if (S.at(i) == 'W'){
      |               ^~
a.cc:23:15: error: request for member 'at' in 'S', which is of non-class type 'bool'
   23 |         if (S.at(i) == 'S'){
      |               ^~
Language: Java

import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        int w,e,n,k;
        for(int i=0;i<s.length();i++){
              if(s.charAt(i)=='W')  w++;
              if(s.charAt(i)=='E')  e++;
              if(s.charAt(i)=='S')  k++;
              if(s.charAt(i)=='N')  n++;
}
if(w==0  && e!=0) System.out.println("No");
else if(e==0  && w!=0) System.out.println("No"); 

else if(k==0  && n!=0) System.out.println("No"); 

else if(n==0  && k!=0) System.out.println("No"); 

else System.out.println("Yes");
    }
}


Compiler output:
Main.java:9: error: variable w might not have been initialized
              if(s.charAt(i)=='W')  w++;
                                    ^
Main.java:10: error: variable e might not have been initialized
              if(s.charAt(i)=='E')  e++;
                                    ^
Main.java:11: error: variable k might not have been initialized
              if(s.charAt(i)=='S')  k++;
                                    ^
Main.java:12: error: variable n might not have been initialized
              if(s.charAt(i)=='N')  n++;
                                    ^
Main.java:14: error: variable w might not have been initialized
if(w==0  && e!=0) System.out.println("No");
   ^
Main.java:14: error: variable e might not have been initialized
if(w==0  && e!=0) System.out.println("No");
            ^
Main.java:15: error: variable e might not have been initialized
else if(e==0  && w!=0) System.out.println("No"); 
        ^
Main.java:17: error: variable k might not have been initialized
else if(k==0  && n!=0) System.out.println("No"); 
        ^
Main.java:17: error: variable n might not have been initialized
else if(k==0  && n!=0) System.out.println("No"); 
                 ^
Main.java:19: error: variable n might not have been initialized
else if(n==0  && k!=0) System.out.println("No"); 
        ^
10 errors
Language: Java

import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
int w,e,n,s;
        for(int i=0;i<s.length();i++){
              if(s.charAt(i)=='W')  w++;
              if(s.charAt(i)=='E')  e++;
			if(s.charAt(i)=='S')  s++;
if(s.charAt(i)=='N')  n++;
}
if(w==0  && e!=0) System.out.println("No");
else if(e==0  && w!=0) System.out.println("No"); 

else if(s==0  && n!=0) System.out.println("No"); 

else if(n==0  && s!=0) System.out.println("No"); 

else System.out.println("Yes");
    }
}


Compiler output:
Main.java:7: error: variable s is already defined in method main(String[])
int w,e,n,s;
          ^
Main.java:8: error: int cannot be dereferenced
        for(int i=0;i<s.length();i++){
                       ^
Main.java:9: error: int cannot be dereferenced
              if(s.charAt(i)=='W')  w++;
                  ^
Main.java:10: error: int cannot be dereferenced
              if(s.charAt(i)=='E')  e++;
                  ^
Main.java:11: error: int cannot be dereferenced
			if(s.charAt(i)=='S')  s++;
			    ^
Main.java:12: error: int cannot be dereferenced
if(s.charAt(i)=='N')  n++;
    ^
6 errors
Language: Java

import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
int w,e,n,s;
        for(int i=0;i<s.length();i++){
              if(s.charAt(i)=='W')  w++;
              if(s.charAt(i)=='E')  e++;
			if(s.charAt(i)=='S')  s++;
if(s.charAt(i)=='N')  n++;
}
if(w==0  && e!=0) System.out.println("No");
else if(e==0  && w!=0) System.out.println("No"); 

else if(s==0  && n!=0) System.out.println("No"); 

else if(n==0  && s!=0) System.out.println("No"); 

else System.out.println(“Yes”);
    }
}


Compiler output:
Main.java:21: error: illegal character: '\u201c'
else System.out.println(?Yes?);
                        ^
Main.java:21: error: illegal character: '\u201d'
else System.out.println(?Yes?);
                            ^
Main.java:21: error: not a statement
else System.out.println(?Yes?);
                         ^
3 errors
Language: C++

#include <iostream>
using namespace std;
int main(void) {
	bool ok = true;
	string s;
	cin >> s;
	vector<int> news(4, 0);
	for (int i = 0; i < s.size(); ++i) {
		if      (s[i] == 'N') ++news[0];
		else if (s[i] == 'E') ++news[1];
		else if (s[i] == 'W') ++news[2];
		else if (s[i] == 'S') ++news[3];
	}
	if (news[0] > 0 && news[3] == 0) ok = false;
	if (news[3] > 0 && news[0] == 0) ok = false;
	if (news[1] > 0 && news[2] == 0) ok = false;
	if (news[2] > 0 && news[1] == 0) ok = false;

	cout << (ok ? "Yes" : "No") << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> news(4, 0);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> news(4, 0);
      |                ^~~
a.cc:9:41: error: 'news' was not declared in this scope
    9 |                 if      (s[i] == 'N') ++news[0];
      |                                         ^~~~
a.cc:10:41: error: 'news' was not declared in this scope
   10 |                 else if (s[i] == 'E') ++news[1];
      |                                         ^~~~
a.cc:11:41: error: 'news' was not declared in this scope
   11 |                 else if (s[i] == 'W') ++news[2];
      |                                         ^~~~
a.cc:12:41: error: 'news' was not declared in this scope
   12 |                 else if (s[i] == 'S') ++news[3];
      |                                         ^~~~
a.cc:14:13: error: 'news' was not declared in this scope
   14 |         if (news[0] > 0 && news[3] == 0) ok = false;
      |             ^~~~
a.cc:15:13: error: 'news' was not declared in this scope
   15 |         if (news[3] > 0 && news[0] == 0) ok = false;
      |             ^~~~
a.cc:16:13: error: 'news' was not declared in this scope
   16 |         if (news[1] > 0 && news[2] == 0) ok = false;
      |             ^~~~
a.cc:17:13: error: 'news' was not declared in this scope
   17 |         if (news[2] > 0 && news[1] == 0) ok = false;
      |             ^~~~