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

#include<iostream>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int e=0,w=0,S=0,n=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='E')
			e=1;
		else if(s[i]=='W')
		{
			w=1;
		}
		else if(s[i]=='S')
			S=1;
		else if(s[i]=='N')
			n=1;
	}
	if(e!=w||S!=n))
	{
		cout<<"No";
	}
	else
	{
		cout<<"Yes";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected primary-expression before ')' token
   21 |         if(e!=w||S!=n))
      |                       ^
Language: C++

#include<bits/stdc++.h>
#define reg register
using namespace std;
string ss;
int w,n,e,s;
inline bool check()
{
    if(w==1&&e==1&&n==1&&s==1)return 1;
    if(w==1&&e==1&&n==0&&s==0)return 1;
    if(w==0&&e==0&&n==1&&s==1)return 1;
    if(w==0&&e==0&&n==0&&s==0)return 1;
    return 0;
}
int nain()
{
    getline(cin,ss);
    for(reg int i=0;i<ss.length();i++)
    if(ss[i]=='W')w++;
    else if(ss[i]=='N')n++;
    else if(ss[i]=='E')e++;
    else if(ss[i]=='S')s++;
    puts(check()?"Yes":"No");
    return 0;
}

Compiler output:
a.cc: In function 'int nain()':
a.cc:17:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |     for(reg int i=0;i<ss.length();i++)
      |                 ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

void add(ll& a, ll b){a = (a+b) % MOD;}

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N=0,S=0,W=0,E=0;
    string s;cin>>s;
    REP(i,s.size()){
        if(s[i]=='N') N++;
        if(s[i]=='S') S++;
        if(s[i]=='W') W++;
        if(s[i]=='E') E++;
    }
    if(H>0&&S>0){
        if(W>0&&S>0){
            cout<<"Yes";
        }
        else if(W==0&&S==0) cout<<"Yes";
        else cout<<"No";
    }
    else if(W>0&&E>0){
        if(N>0&&S>0){
            cout<<"Yes";
        }
        else if(N==0&&S==0) cout<<"Yes";
        else cout<<"No";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:8: error: 'H' was not declared in this scope
   39 |     if(H>0&&S>0){
      |        ^
Language: C++

#include <bits/stdc++.h>
#define il inline
#define ri register int
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define mid ((l+r)>>1)
#define MAXN 1050
#define MAXM
#define mod
#define inf (1<<30)
#define eps (1e-6)
#define alpha 0.75
#define rep(i, x, y) for(ri i = x; i <= y; ++i)
#define repd(i, x, y) for(ri i = x; i >= y; --i)
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, int> pli;
typedef pair <int, ll> pil;
typedef pair <ll, ll> pll;
template <typename T> il bool chkmin(T &x, T y) {return x > y ? x = y, 1 : 0;}
template <typename T> il bool chkmax(T &x, T y) {return x < y ? x = y, 1 : 0;}
template <typename T> il void read(T &x) {
	char ch = getchar(); int f = 1; x = 0;
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') x = x*10+ch-'0', ch = getchar();
	x *= f;
}
template <typename T, typename... Args> il void read(T &x, Args &...args) {
	read(x), read(args...);
}
int x1, x2, y1, y2;
char s[MAXN];
int main() {
	scanf("%s", s+1);
	rep(i, 1, strlen(s+1)) 
		if(s[i] == 'N') y1 = 1;
		else if(s[i] == 'S') y2 = 1;
		else if(s[i] == 'E') x1 = 1;
		else if(s[i] == 'W') x2 = 1;
	puts(((y1^y2) || (x1^x2)) ? "No" : "Yes");
	return 0;
}


Compiler output:
a.cc:37:13: error: 'int y1' redeclared as different kind of entity
   37 | int x1, x2, y1, y2;
      |             ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:41:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   41 |         rep(i, 1, strlen(s+1))
      |             ^
a.cc:15:29: note: in definition of macro 'rep'
   15 | #define rep(i, x, y) for(ri i = x; i <= y; ++i)
      |                             ^
a.cc:42:36: error: assignment of function 'double y1(double)'
   42 |                 if(s[i] == 'N') y1 = 1;
      |                                 ~~~^~~
a.cc:46:18: error: invalid operands of types 'double(double) noexcept' and 'int' to binary 'operator^'
   46 |         puts(((y1^y2) || (x1^x2)) ? "No" : "Yes");
      |                ~~^~~
      |                |  |
      |                |  int
      |                double(double) noexcept
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[1005];
int main()
{
  scanf("%s",s+1);
  int n=strlen(s+1);
  for(int i=1;i<=n;i++) cnt[s[i]-'A']++;
  if((cnt['S'-'A']&&!cnt['N'-'A'])||(cnt['N'-'A']&&!cnt['S'-'A'])||
     (cnt['W'-'A']&&!cnt['E'-'A'])||(cnt['E'-'A']&&!cnt['W'-'A']))
    puts("No");
  else puts("Yes");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
    8 |   for(int i=1;i<=n;i++) cnt[s[i]-'A']++;
      |                         ^~~
      |                         int
a.cc:9:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |   if((cnt['S'-'A']&&!cnt['N'-'A'])||(cnt['N'-'A']&&!cnt['S'-'A'])||
      |       ^~~
      |       int
Language: C++

#include <cstdio>
char a[1005];bool N=0,S=0,W=0,E=0;
int main (){
	scanf ("%s",a+1);int n=strlen(a+1);
    for (int i=1;i<=n;i++) 
        if (a[i]=='N') N=1;
    	else if (a[i]=='S') S=1;
    	else if (a[i]=='W') W=1;
    	else E=1;
    if ((N^S)||(W^E)) puts("Yes");
    else puts("No");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:32: error: 'strlen' was not declared in this scope
    4 |         scanf ("%s",a+1);int n=strlen(a+1);
      |                                ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <cstdio>
  +++ |+#include <cstring>
    2 | char a[1005];bool N=0,S=0,W=0,E=0;
Language: C++

#include <cstdio>
char a[1005];bool N=0,S=0,W=0,E=0;
int main (){
	scanf ("%s",a+1);
    for (int i=1;i<=n;i++) 
        if (a[i]=='N') N=1;
    	else if (a[i]=='S') S=1;
    	else if (a[i]=='W') W=1;
    	else E=1;
    if ((N^S)||(W^E)) puts("Yes");
    else puts("No");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: 'n' was not declared in this scope
    5 |     for (int i=1;i<=n;i++)
      |                     ^
Language: C++

#include <cstdio>
const int N=1005;
char a[N];bool N=0,S=0,W=0,E=0;
int main (){
	scanf ("%s",a+1);
    for (int i=1;i<=n;i++) 
        if (a[i]=='N') N=1;
    	else if (a[i]=='S') S=1;
    	else if (a[i]=='W') W=1;
    	else E=1;
    if ((N^S)||(W^E)) puts("Yes");
    else puts("No");
	return 0;
}

Compiler output:
a.cc:3:16: error: conflicting declaration 'bool N'
    3 | char a[N];bool N=0,S=0,W=0,E=0;
      |                ^
a.cc:2:11: note: previous declaration as 'const int N'
    2 | const int N=1005;
      |           ^
a.cc: In function 'int main()':
a.cc:6:21: error: 'n' was not declared in this scope
    6 |     for (int i=1;i<=n;i++)
      |                     ^
a.cc:7:25: error: assignment of read-only variable 'N'
    7 |         if (a[i]=='N') N=1;
      |                        ~^~
Language: C++

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

int main(){
	string s;
	cin >> s;
	int N=0,W=0,S=0,E=0;
	for(int i=0;i<s.size(),i++){
		if(s[i]=='N')N=1;
		if(s[i]=='W')W=10;
		if(s[i]=='S')S=-1;
		if(s[i]=='E')E=-10;
	}
	if(N+W+S+E==0)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:35: error: expected ';' before ')' token
    8 |         for(int i=0;i<s.size(),i++){
      |                                   ^
      |                                   ;
Language: 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;//圆满的结束 
}

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

#include<iostream>
#include<vector>

using namespace std;

#define P pair<int, int>;
pair<int, int> temp;
int N;

int main(){
  cin >> N;
  
  vector<pair<int, int>> A;
  
  int a, b;
  for (int i = 0; i < N; i ++) {
    cin >> a;
    temp.first = i;
    temp.second = a;
    A.push_back(temp);
  }
  
  sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected ')' before ';' token
    6 | #define P pair<int, int>;
      |                         ^
a.cc:23:38: note: in expansion of macro 'P'
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                      ^
a.cc:23:31: note: to match this '('
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                               ^
a.cc: In lambda function:
a.cc:6:25: error: expected '{' before ';' token
    6 | #define P pair<int, int>;
      |                         ^
a.cc:23:38: note: in expansion of macro 'P'
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                      ^
a.cc: In function 'int main()':
a.cc:6:25: error: expected ')' before ';' token
    6 | #define P pair<int, int>;
      |                         ^
a.cc:23:38: note: in expansion of macro 'P'
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                      ^
a.cc:23:7: note: to match this '('
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |       ^
a.cc:23:41: error: 'x' was not declared in this scope
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                         ^
a.cc:23:44: error: expected primary-expression before 'const'
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                            ^~~~~
a.cc:23:53: error: 'y' was not declared in this scope
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                                     ^
a.cc:23:86: error: expected primary-expression before ')' token
   23 |   sort(A.begin(), A.end(),  [](const P& x, const P& y) { return x.second > y.second;})
      |                                                                                      ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

pair<int, int> temp;
int N;

int main(){
  cin >> N;
  
  vector<pair<int, int>> A[N];
  
  int a, b;
  for (int i = 0; i < N; i ++) {
    cin >> a;
    temp.first = i;
    temp.second = a;
    A.push_back(temp);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: request for member 'push_back' in 'A', which is of non-class type 'std::vector<std::pair<int, int> > [N]'
   19 |     A.push_back(temp);
      |       ^~~~~~~~~
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

pair<int, int> temp;

int main(){
  cin >> N;
  
  vector<pair<int, int>> A[N];
  
  int a, b;
  for (int i = 0; i < N; i ++) {
    cin >> a;
    temp.first = i;
    temp.second = a;
    A.push_back(temp);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'N' was not declared in this scope
    9 |   cin >> N;
      |          ^
a.cc:18:5: error: 'A' was not declared in this scope
   18 |     A.push_back(temp);
      |     ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin>>S;
    int N=S.length();
    int n=0,w=0,s=0,e=0;
    rep(i,0,N){
        if(S[i]=='N') n++;
        if(S[i]=='W') w++;
        if(S[i]=='S') s++;
        if(S[i]=='E') e++;
    }
    if(((n==0&&s==0)||(n&&s))&&((w==0&&e==0)||(w&&e))) cout <<"Yes"<<"\n";
    else cout << "No"<<"\n";
}#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin>>S;
    int N=S.length();
    int n=0,w=0,s=0,e=0;
    rep(i,0,N){
        if(S[i]=='N') n++;
        if(S[i]=='W') w++;
        if(S[i]=='S') s++;
        if(S[i]=='E') e++;
    }
    if(((n==0&&s==0)||(n&&s))&&((w==0&&e==0)||(w&&e))) cout <<"Yes"<<"\n";
    else cout << "No"<<"\n";
}

Compiler output:
a.cc:34:2: error: stray '#' in program
   34 | }#include <bits/stdc++.h>
      |  ^
a.cc:34:3: error: 'include' does not name a type
   34 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:50:10: error: redefinition of 'const ll MOD'
   50 | const ll MOD=1000000007;
      |          ^~~
a.cc:17:10: note: 'const ll MOD' previously defined here
   17 | const ll MOD=1000000007;
      |          ^~~
a.cc:52:5: error: redefinition of 'int main()'
   52 | int main() {
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main() {
      |     ^~~~
Language: Java

import java.util.*;

public class Wanna_go_back_home{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String S_s[] = s.split("");
    String N = "N";
    String W = "W";
    String S = "S";
    String E = "E";
    int x = 0;
    int y = 0;
    for(int i = 0;i < s.length();i++){
      if(S_s[i].equals(N)) x++;
      else if(S_s[i].equals(W)) y--;
      else if(S_s[i].equals(S)) x--;
      else if(S_s[i].equals(E)) y++;
    }
    if(x == 0 && y == 0){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:3: error: class Wanna_go_back_home is public, should be declared in a file named Wanna_go_back_home.java
public class Wanna_go_back_home{
       ^
1 error
Language: C++

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

int main() {
  vector<int> vec(4);
  string S;
  cin >> S;
  int n = S.size();
  
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'N') vec.at(0) += 1;
    else if (S.at(i) == 'E') vec.at(1) += 1;
    else if (S.at(i) == 'W') vec.at(2) += 1;
    else if (S.at(i) == 'S') vec.at(3) += 1;
  }
  
  int p = vec.at(0) * vec.at(1) * vec.at(2) * vec.at(3);
  if (p != 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'N' was not declared in this scope
   10 |   for (int i = 0; i < N; i++) {
      |                       ^
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main() {
  int n=0, w=0, s=0, e=0;
  char* c = malloc(1000 * sizeof(char));
  
  scanf("%s", c);
  int N = 0;
  int i=0;
  while (*(c+i)) {
    N++;
    i++;
  }
  
  for (int i=0; i<N; i++) {
    if (*(c+i) == 'N') {n++;}
    if (*(c+i) == 'W') {w++;}
    if (*(c+i) == 'S') {s++;}
    if (*(c+i) == 'E') {e++;}
  }
  
  if (n) {n = 1;}
  if (w) {w = 1;}
  if (s) {s = 1;}
  if (e) {e = 1;}
  
  int f = (n == s);
  int g = (e == w);

  f = f & g;
  if (f) {
    printf("Yes\n");
  }
  else {
    printf("No\n");
  }
  
  return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
    6 |   char* c = malloc(1000 * sizeof(char));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main(){
    string a;
    int sumn=0,sume=0;
    cin>>a;
    for(int i=0;i<strlen(a);i++){
        if(a[i]=='N')  sumn++;
        if(a[i]=='S')  sumn--;
        if(a[i]=='E')  sume++;
        if(a[i]=='W')  sume--;
    }
    if(sumn==0&&sume==0)  cout<<"Yes"<<endl;
    if(sumn!=0||sume!=0)  cout<<"NO"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    8 |     for(int i=0;i<strlen(a);i++){
      |                          ^
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

char c[N];

int main() {
  scanf("%s", c + 1);
  int n = strlen(c + 1), a, b, c, d;
  a = b = c = d = 0;
  for (int i = 1; i <= n; i++) {
    if (c[i] == 'N') a = 1;
    if (c[i] == 'S') b = 1;
    if (c[i] == 'W') c = 1;
    if (c[i] == 'E') d = 1;
  }
  if ((a ^ b) || (c ^ d)) {
    puts("No");
  } else {
    puts("Yes");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: invalid types 'int[int]' for array subscript
   14 |     if (c[i] == 'N') a = 1;
      |          ^
a.cc:15:10: error: invalid types 'int[int]' for array subscript
   15 |     if (c[i] == 'S') b = 1;
      |          ^
a.cc:16:10: error: invalid types 'int[int]' for array subscript
   16 |     if (c[i] == 'W') c = 1;
      |          ^
a.cc:17:10: error: invalid types 'int[int]' for array subscript
   17 |     if (c[i] == 'E') d = 1;
      |          ^
Language: 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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'else' without a previous 'if'
   45 |         else No;
      |         ^~~~
Language: 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;
}

Compiler output:
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*
Language: 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;
}

Compiler output:
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'){
      |                   ^
Language: 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;
}

Compiler output:
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){
      |                 ^
Language: 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;
}

Compiler output:
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() {
      |     ^~~~
Language: 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;
	}
}

Compiler output:
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
Language: 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 )
{
	// 引数に０がある場合は０を返す
	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;
  }

}





  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:161:22: error: expected ';' before ':' token
  161 |     cout<<"Yes"<<endl:
      |                      ^
      |                      ;
Language: 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;
}

Compiler output:
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)
      |              ~~^~~~~~
Language: 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;
}

Compiler output:
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)
      |              ~~^~~~~~
Language: 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;
}

Compiler output:
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() {
      |            ^
Language: 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;
}

Compiler output:
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){
      |                     ^
Language: 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;
}

Compiler output:
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 | }
      | ^
Language: 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;
}

Compiler output:
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 | }
      | ^
Language: 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;
}

Compiler output:
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 | }
      | ^
Language: 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;
    }
}

Compiler output:
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 | }
      | ^
Language: 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;   
}

Compiler output:
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 |
Language: 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;
}

Compiler output:
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;
Language: 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;
}

Compiler output:
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