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

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

#define N 500010
int c[2][N];
int n;
string s;

void ZAlgo(string &s, vector<int> &z){
	int n = s.size();
	z = vector<int>(n);
	z[0] = n;
	int i = 1, j = 0;
	while(i < n){
		while(i+j < n && s[j]==s[i+j]) j++;
		a[i] = j;
		if(j==0){
			i++;
			continue;
		}
		int k = 1;
		while(i+k < n && k+a[k]<j) z[i+k] = z[k], k++;
		i += k;
		j -= k;
	}
}

int main(){
	cin>>s;
	n = s.size();
	rep(k, 2){
		vector<int> z;
		ZAlgo(s, z);
		for(int i = 1; i <= n/2; i++){
			if(c[i]) continue;
			for(int j = 2*i; j <= n; j+=i){
				if(z[j-i]>=i) c[k][j] = 1;
				else break;
			}
		}
		reverse(all(s));
	}

	reverse(c[1], c[1]+n+1);

	if(!c[n]){
		cout<<1<<endl;
		cout<<1<<endl;
	} else if(s==string(n, s[0])){
		cout<<n<<endl;
		cout<<1<<endl;
	} else {
		cout<<2<<endl;
		int sum = 0;
		for(int i = 0; i <= n; i++) if(!c[i]&&!c2[i]) sum++;
		cout<<sum<<endl;
		//for(int i = 0; i <= n; i++) cout<<c[i]<<" "<<c2[i]<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'void ZAlgo(std::string&, std::vector<int>&)':
a.cc:53:17: error: 'a' was not declared in this scope
   53 |                 a[i] = j;
      |                 ^
a.cc: In function 'int main()':
a.cc:92:56: error: 'c2' was not declared in this scope; did you mean 'c'?
   92 |                 for(int i = 0; i <= n; i++) if(!c[i]&&!c2[i]) sum++;
      |                                                        ^~
      |                                                        c
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

const int MAXN = 1e5 + 10;
char s[MAXN];
int next[MAXN];
int main(){
	cin >> s + 1;
	int l = strlen(s + 1);
	bool ok = 1;
	for(int i = 1 ; i <= l ; ++ i)
		if(s[i] != s[1]){
			ok = 0;
			break;
		}
	if(ok){
		cout << l << endl << 1 << endl;
		return 0;
	}
	next[1] = 0;
	int len = 0;
	for(int i = 2 ; i <= l ; ++ i){
		while(len && s[len + 1] != s[i])
			len = next[len];
		if(s[len + 1] == s[i])
			len ++;
		next[i] = len;	
	}
	int t = l - len;	
	if(len != 0 && l % t == 0){
		cout << 2 << endl;
		if(l / t == 2)
			cout << l - 1 << endl;
		else
			cout << l - (l / t) << endl;
	}
	else
		cout << 1 << endl << 1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: reference to 'next' is ambiguous
   23 |         next[1] = 0;
      |         ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:9:5: note:                 'int next [100010]'
    9 | int next[MAXN];
      |     ^~~~
a.cc:27:31: error: reference to 'next' is ambiguous
   27 |                         len = next[len];
      |                               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:9:5: note:                 'int next [100010]'
    9 | int next[MAXN];
      |     ^~~~
a.cc:30:17: error: reference to 'next' is ambiguous
   30 |                 next[i] = len;
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:9:5: note:                 'int next [100010]'
    9 | int next[MAXN];
      |     ^~~~
Language: C++

for(int i=1;i<=sz/2;i++){
                if(!bad1[i]){
                    string tmp=str.substr(0,i);
                    int j=i;
                    while( j+i<=sz ){
                        if(tmp==str.substr(j,i)){
                            bad1[j+i]=true;
                            j+=i;
                        }else{
                            break;
                        }
                    }
                }
            }

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for(int i=1;i<=sz/2;i++){
      | ^~~
a.cc:1:13: error: 'i' does not name a type
    1 | for(int i=1;i<=sz/2;i++){
      |             ^
a.cc:1:21: error: 'i' does not name a type
    1 | for(int i=1;i<=sz/2;i++){
      |                     ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main(){
    string str;
    cin>>str;
    char aho=str[0];
    bool flag=true;
    for(int i=0;i<str.size();i++){
        if(str[i]!=aho){
            flag=false;
            break;
        }
    }
    if(flag){//みんな同じ文字
        cout<<str.size()<<endl;
        cout<<1<<endl;
    }else{
        //先ずはstr.size()のすべての約数を求める。
        int sz=str.size();
        vector<int> div;
        for(int i=2;i<=sz;i++){
            if(sz%i==0){
                div.push_back(i);
            }
        }
        int syuuki;
        for(int i=0;i<div.size();i++){//div[i]個の文字からなる周期を持つのかチェックする。
            string tmp=str.substr(0,div[i]);
            int j=0;
            bool fla=true;
            while(j+div[i]<=sz){
                string hikaku=str.substr(j,div[i]);
                if(tmp!=hikaku){
                    fla=false;
                    break;
                }
                j+=div[i];
            }
            if(fla){
                syuuki=div[i];
                break;
            }
        }
        if(syuuki==sz){
            cout<<1<<endl;
            cout<<1<<endl;
        }else{
            cout<<2<<endl;
            bool bad1[250001]={};
            string nex=str.substr(0,syuuki);
            int nn=nex.size();
            for(int i=1;i<=nn/2;i++){
                if(!bad1[2*i]){
                    string tmp=nex.substr(0,i);
                    int j=i;
                    while( tmp==nex.substr(j,i) ){
                        bad1[j+i]=true;
                        j+=i;
                        if(j+i>nex.size()) break;
                    }
                }
            }
            reverse(nex.begin(),nex.end());
            bool bad2[250001]={};
            for(int i=1;i<=nn/2;i++){
                if(!bad2[2*i]){
                    string tmp=nex.substr(0,i);
                    int j=i;
                    while( tmp==nex.substr(j,i) ){
                        bad2[j+i]=true;
                        j+=i;
                        if(j+i>nex.size()) break;
                    }
                }
            }
            int res=sz-1;
            for(int i=1;i<nn;i++){
                if(bad1[i]) res--;
            }
            for(int i=1;i<nn;i++){
                if(bad2[i]) res--;
            }
            if(syuuki!=2){
                res -= (sz/syuuki-1);
            }
            cout<<res<<endl;
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:13: error: 'reverse' was not declared in this scope
   66 |             reverse(nex.begin(),nex.end());
      |             ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <random>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef vector<vvi> vvvi;
typedef vector<vll> vvll;
typedef std::vector<std::pair<int, int> > vpi;
typedef vector<vpi> vvpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

char incaa[505000];

vector<int> prefix_function (string s) {
    int n = (int) s.length();
    vector<int> pi (n);
    for (int i=1; i<n; ++i) {
        int j = pi[i-1];
        while (j > 0 && s[i] != s[j])
            j = pi[j-1];
        if (s[i] == s[j])  ++j;
        pi[i] = j;
    }
    return pi;
}

int main()
{

    gets(incaa);
    string s(incaa);
    int n = s.size();
    bool f1=true;
    forn(i,0,n) {
        if(s[i]!=s[0]) f1=false;
    }
    if(f1) {
        cout<<n<<endl;
        cout<<1<<endl;
        return 0;
    }
    cout<<2<<endl;
    
    vi pf1 = prefix_function(s);
    reverse(all(s));
    vi pf2 = prefix_function(s);
    
    int cnt =0 ;
    forn(i,1,n) {
        int l = i;
        int r = n-i;
        int sl = pf1[l-1];
        int sr = pf2[r-1];
        int dl = l - sl;
        int dr = r - sr;
        if((l%dl == 0 && sl>0)|| (r%dr ==0 &&sr>0)) continue;
        cnt++;
    }
    cout<<cnt<<endl;
    
    
    
    
    
}



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

s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      | ^
a.cc:1:3: error: 'n' does not name a type
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      |   ^
a.cc:1:5: error: 'e' does not name a type
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      |     ^
a.cc:1:7: error: 'w' does not name a type
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      |       ^
a.cc:1:9: error: 'i' does not name a type
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      |         ^
a.cc:1:15: error: expected constructor, destructor, or type conversion before '(' token
    1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
      |               ^
Language: C

#include<iostream>
using namespace std;
typedef long long li;
#define yn(i) print((i)?"Yes":"No")
#define binom2(n) ((n)*(n-1)/2)
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

char dir[]={'N','W','S','E'};

int main() {
  string s; cin >>s;
  int n=s.size();
  int d[]={0,0,0,0};
  rep(i,n) rep(j,4) if(s[i]==dir[j]) d[j]|=1;
  yn(!((d[0]^d[2]) or (d[1]^d[3])));
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
using namespace std;
int main(){
    string s;
    cin>>s;
    long long n=0,ss=0,w=0,e=0;
    f(i,0,s.size()){
        if(s[i]=='N'){
            n++;
        }
        else if(s[i]=='S'){
            ss++;
        }
        else if(s[i]=='W'){
            w++;
        }
        else{
            e++;
        }
    }
    if(n>0&&ss>0&&w=0&&e=0){
        cout<<"Yes"<<endl;
    }
    else if(n=0&&ss=0&&w>0&&e>0){
        cout<<"Yes"<<endl;
    }
    else if(n>0&&ss>0&&w>0&&e>0){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: lvalue required as left operand of assignment
   22 |     if(n>0&&ss>0&&w=0&&e=0){
      |                     ~^~~
a.cc:25:16: error: lvalue required as left operand of assignment
   25 |     else if(n=0&&ss=0&&w>0&&e>0){
      |               ~^~~~
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    string q;
    cin>>q;
    int n=q.size();
    bool n=false,e=false,w=false,s=false;
    if(n) cout<<1;
    rep(i,n){
        if(q[i]=='n') n=true;
        else if(q[i]=='e') e=true;
        else if(q[i]=='w') w=true;
        else s=true;
    }
    if(n&&!s) cout<<"No";
    else if(s&&!n) cout<<"No";
    else if(e&&!w) cout<<"No";
    else if(w&&!e) cout<<"No";
    else cout<<"Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: conflicting declaration 'bool n'
   14 |     bool n=false,e=false,w=false,s=false;
      |          ^
a.cc:13:9: note: previous declaration as 'int n'
   13 |     int n=q.size();
      |         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;

int main() {
  string s;
  cin >> s;
  bool n, w, s, e;
  n = false, w = false, s = false, e = false;
  int n = s.size();
  rep(i, n){
    if(s[i] == 'N')n=true;
    if(s[i] == 'W')w=true;
    if(s[i] == 'S')s=true;
    if(s[i] == 'E')e=true;
  }
  int cn = 0;
  if(n)cn++;
  if(w)cn++;
  if(s)cn++;
  if(e)cn++;
  if(cn == 4){
    cout << "Yes" << endl;
  }else if(cn == 3 || cn == 1){
    cout << "No" << endl;
  }else{
    if(n){
      if(s){
        cout << "Yes" << endl;
        return 0;
      }else{
        cout << "No" << endl;
        return 0;
      }
    }
    if(w){
      if(e){
        cout << "Yes" << endl;
        return 0;
      }else{
        cout << "No" << endl;
        return 0;
      }
    }
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conflicting declaration 'bool s'
   10 |   bool n, w, s, e;
      |              ^
a.cc:8:10: note: previous declaration as 'std::string s'
    8 |   string s;
      |          ^
a.cc:12:7: error: conflicting declaration 'int n'
   12 |   int n = s.size();
      |       ^
a.cc:10:8: note: previous declaration as 'bool n'
   10 |   bool n, w, s, e;
      |        ^
a.cc:22:6: error: could not convert 's' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   22 |   if(s)cn++;
      |      ^
      |      |
      |      std::string {aka std::__cxx11::basic_string<char>}
a.cc:30:10: error: could not convert 's' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   30 |       if(s){
      |          ^
      |          |
      |          std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main() {
  string s;
  k=s.size();
  int cnt_x=0;
  int cnt_y=0;
  for(int i=0;i<k;i++){
  if(s[i]=='W'){cnt_x--;}
      if(s[i]=='E'){cnt_x++;}  if(s[i]=='N'){cnt_y++;}  if(s[i]=='S'){cnt_y--;}
  
  }
  if(cnt_x==0 && cnt_y==0)cout << "Yes"<<endl;
  else cout <<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'k' was not declared in this scope
    6 |   k=s.size();
      |   ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
/*

Chào cô gái, có ph?i em tên t? t? không, mà sao lúc sub bài này anh toàn nghi d?n em th?

Miku is waving, start shaking >:(



*/


typedef long long ll ;
const ll mk = 100055;
const ll logn  = 29;
const ll mod = 1e9 + 7;

#define endl "\n"
#define IOS  ios::sync_with_stdio(0); cin.tie(0);
#define fi first
#define se second
#define pii pair<ll,ll>
#define pq priority_queue
#define UwU              uwu
#define mp make_pair
#define Miku             best_waifu
#define Miku_dancing     god_waving
#define Miku_singing     god_shaking
#define a_Miku           cho_doi_bot_ngu

vector <ll> Pr;
ll d[mk + 5];

unordered_map <ll,ll> occurance;
 
unordered_map <ll,pii> cnt;


vector < pii > Rev; 


void Sieve()   // i dont know why my previous sieve goes tle TvT
{
    vector<bool> prime(mk + 5 , 1);
  
    for (ll i=3; i * i <=mk; i+=2) 
    { 
        if (prime[i] == true) 
        { 
            for (ll j = i * i ; j <=mk; j += 2*i)  prime[j] = false; 
        } 
    } 
  
    Pr.push_back(2);
    for (ll p=3; p<=mk; p+=2) if (prime[p]) Pr.push_back(p);
}
inline pair<ll,ll> root(ll x)     // find the root of x
{
    ll val=1,reverse_val=1;
    for (auto i: Pr)
    {
        if(i*i>x) break;
        if(x%i==0)
        {
            ll num=0;
            while(x%i==0)
            {
                num++;
                x/=i;
            }
            num%=3;
            for(ll j = 0 ; j < num ; j++) val *= i;
            for(ll j = 0 ; j < 3 - num; j++) reverse_val *= i;
        }
    }
    if(x>1)
    {
        
        // x must be a prime 
    	ll num = 1; 
    	for(ll i = 0 ; i < num; i++) val *= x; 
    	for(ll i = 0 ; i < 3 - num ; i++) reverse_val *= x; 
    }
    return mp(val,reverse_val);
}
  

void solve()
{
    Sieve();
    ll n;
    cin >> n;
    for (ll i = 1; i <= n; i++)
    {
        ll x; cin >> x; 
        if(cnt.count(x)==0)
        {
            pair<ll,ll> cur= root(x);
            Rev.push_back(cur);
            cnt[x]=cur;
        }
        else
            Rev.push_back(cnt[x]);
            occurance[Rev.back().first]++;
    }
    ll ans=0;
    if(occurance[1]>=1) ans++;
    for (ll i = 0; i < n; i++)
    {
    	
        ll value = Rev[i].first;
        ll cur_val = occurance[value];
        if(cur_val==0) continue;
        if(value==1) continue;
        ll rever = Rev[i].second;
        ans += max(cur_val, occurance[rever]);
        occurance[rever]=0;
        occurance[value]=0;
       /// cout <<  " Miku huhuhu"
    }
    cout << ans << endl;
}
 
ll main()
{
    solve();
}


Compiler output:
a.cc:126:1: error: '::main' must return 'int'
  126 | ll main()
      | ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    strng s;
    cin >> s;
    bool flag1=true;
    bool flag2=true;
    rep(i,s.size()){
        if(s.at(i)=='N')flag1=false;
        if(s.at(i)=='W')flag2=false;
    }
    rep(i,s.size()){
        if(!flag1){
            if(s.at(i)=='S')flag1=true;
        }
        if(!flag2){
            if(s.at(i)=='E')flag2=true;
        }
    }
    if(flag1&&flag2) cout << "Yes" << endl;
    else cout << "No" << endl;
}
   


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'strng' was not declared in this scope
    9 |     strng s;
      |     ^~~~~
a.cc:10:12: error: 's' was not declared in this scope
   10 |     cin >> s;
      |            ^
Language: C++

#include <iostream>
using namespace std;

string S;
int N;
int So;
int E;
int W;

int main(){
  cin >> S;
  for(int i = 0; i < sizeof(S); i++){
    if(S[i] == "N") N++;
    if(S[i] == "S") So++;
    if(S[i] == "E") E++;
    if(S[i] == "W") W++;
  }
  if(N == So && W == E){
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if(S[i] == "N") N++;
a.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(S[i] == "S") So++;
a.cc:15:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "E") E++;
a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if(S[i] == "W") W++;
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 cnt_N =0;
    int cnt_S =0;
    int cnt_E =0;
    int cnt_W =0;
    
    for(int i=0; i<S.length(); i++){
      if(S.charAt(i)=='N')cnt_N++;
      else if(S.charAt(i)=='S')cnt_S++;
      else if(S.charAt(i)=='E')cnt_E++;
      else if(S.charAt(i)=='W')cnt_W++;
    }
    if(cnt_N = cnt_S && cnt_E = cnt_W){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}   

Compiler output:
Main.java:18: error: bad operand types for binary operator '&&'
    if(cnt_N = cnt_S && cnt_E = cnt_W){
                     ^
  first type:  int
  second type: int
Main.java:18: error: incompatible types: int cannot be converted to boolean
    if(cnt_N = cnt_S && cnt_E = cnt_W){
             ^
2 errors
Language: C++

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

int main(){
  string S;
  cin >> S;
  int A=0,B=0,C=0,D=0;
  for(int i=0;i<N;i++){
    if(S.at(i)=='N'){
      A++;
    }
    else if(S.at(i)=='W'){
      B++;
    }
    else if(S.at(i)=='S'){
      C++;
    }
    else{
      D++;
    }
  }
  if(A==B && B==C){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

#include <iostream>
using namespace std;
int main(void){
   string S;
   cin >> S;
   int n = 0,s = 0,w = 0;e = 0;
   for(int i = 0;i < t.size();i++){
       swich(S[i]){
             case 'N':
             n++;
             break;
             case 'S':
             s++;
             break;
             case 'W':
             w++;
             break;
             case 'E':
             e++;
             break;
       }  
   }
   
   if(
         ((n > 0 && s > 0) || (n == 0 && s == 0)) &&
         ((w > 0 && e > 0) || (w == 0 && e == 0))
         
      ){
            cout << "Yes" << endl;
      }else{
            cout << "No" << endl;
      }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: 'e' was not declared in this scope
    6 |    int n = 0,s = 0,w = 0;e = 0;
      |                          ^
a.cc:7:22: error: 't' was not declared in this scope
    7 |    for(int i = 0;i < t.size();i++){
      |                      ^
a.cc:8:8: error: 'swich' was not declared in this scope
    8 |        swich(S[i]){
      |        ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;cin>>S;
  int n[]={0,0,0,0};
  map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
  for(auto c:S) n[mp[c]]=1;
  if(n[0]^n[1] || n[2]^n[3]) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected identifier before 'N'
    6 |   map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
      |                      ^~~
a.cc:6:25: error: expected ']' before ',' token
    6 |   map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
      |                         ^
      |                         ]
a.cc: In lambda function:
a.cc:6:25: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:6:27: error: expected '}' before ']' token
    6 |   map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
      |                    ~      ^
a.cc:6:27: error: could not convert '{<lambda closure object>main()::<lambda()>(), 0}' from '<brace-enclosed initializer list>' to 'std::map<char, int>'
    6 |   map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
      |                           ^
      |                           |
      |                           <brace-enclosed initializer list>
a.cc:6:27: error: expected ',' or ';' before ']' token
a.cc: At global scope:
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(auto c:S) n[mp[c]]=1;
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(n[0]^n[1] || n[2]^n[3]) cout<<"No"<<endl;
      |   ^~
a.cc:9:3: error: expected unqualified-id before 'else'
    9 |   else cout<<"Yes"<<endl;
      |   ^~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    string S;
    cin >> S;
    map<char,bool>Map;
	for (char c : a) {
		Map[c] = true;
	}
	if ((Map['N'] == Map['S']) && (Map['E'] == Map['W'])) {
        cout << "Yes" << endl;
    }
	else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'a' was not declared in this scope
    7 |         for (char c : a) {
      |                       ^
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	string s;
	cin>>s;
	map<char, int> mp;
	for(auto ch : s){
		mp[ch]++;
	}
	if(mp['N'] > 0 && mp['S'] == 0)cout<<"No"<<'\n';
	else if(mp['S'] > 0 && mp['N'] == 0)cout<<"No"<<'\n';
	else if(mp['E'] > 0 && mp['W'] == 0)cout<<"No"<<'\n';
	else if(mp['W'] > 0 && mp['E'] == 0)cout<<"No"<<'\n';
	else cout<<"Yes"<<'\n'

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:31: error: expected ';' before 'return'
   24 |         else cout<<"Yes"<<'\n'
      |                               ^
      |                               ;
   25 | 
   26 |         return 0;
      |         ~~~~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    char[] ch=sc.next().toCharArray();
    int[] nums=new int[4];
    for(int i=0;i<ch.length;i++){
      switch(ch[i]){
        case 'N':
          nums[0]++;
          break;
        case 'W':
          nums[1]++;
          break;
        case 'S':
          nums[2]++;
          break;
        case 'E':
          nums[3]++;
          break;
      }
    }
    if(((nums[0]>0&&nums[2]>0)||(nums[0]==0&&nums[2]==0))&&((nums[1]>0&&nums[3]>0)||(nums[1]==0&&nums[3]==0)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:23: error: ')' expected
    if(((nums[0]>0&&nums[2]>0)||(nums[0]==0&&nums[2]==0))&&((nums[1]>0&&nums[3]>0)||(nums[1]==0&&nums[3]==0)){
                                                                                                             ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    char[] ch=sc.next().toCharArray();
    int[] nums=new int[4];
    for(int i=0;i<ch.length;i++){
      switch(ch[i]){
        case 'N':
          nums[0]++;
          break;
        case 'W':
          nums[1]++;
          break;
        case 'S':
          nums[2]++;
          break;
        case 'E':
          nums[3]++;
          break;
      }
    }
    if(nums[0]>0&&nums[1]>0&&nums[2]>0&&nums[3]>0){
      System.out,println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:24: error: not a statement
      System.out,println("Yes");
            ^
Main.java:24: error: ';' expected
      System.out,println("Yes");
                ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
 string S;
 cin>>S;
 vector<bool>vec(4);
 int s=S.size();
for(int i=0; i<s; i++){
if(S.at(i)=="N"){
vec.at(0)=true;
}
else if(S.at(i)=="W"){
vec.at(1)=true;
}
else if(S.at(i)=="S"){
vec.at(2)=true;
}
else if(S.at(i)=="E"){
vec.at(3)=true;
}
}
if(vec.at(0)==true&&vec.at(1)==true&&vec.at(2)==true&&vec.at(3)==true){
cout<<"Yes"<<endl;
}
else if(vec.at(0)==true&&vec.at(1)==false&&vec.at(2)==true&&vec.at(3)==false)
cout<<"Yes"<<endl;
else if(vec.at(0)==false&&vec.at(1)==true&&vec.at(2)==false&&vec.at(3)==true)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll long long
#define double long double
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define ALL(V) ((V).begin(),(V).end())
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
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;}
const int vx[4]={0,1,0,-1},vy[4]={1,0,-1,0};
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: request for member 'at' in 'S', which is of non-class type 'int'
   52 |     if(S.at(i)=='N') N++;
      |          ^~
a.cc:53:10: error: request for member 'at' in 'S', which is of non-class type 'int'
   53 |     if(S.at(i)=='W') W++;
      |          ^~
a.cc:54:10: error: request for member 'at' in 'S', which is of non-class type 'int'
   54 |     if(S.at(i)=='S') S++;
      |          ^~
a.cc:55:10: error: request for member 'at' in 'S', which is of non-class type 'int'
   55 |     if(S.at(i)=='E') E++;
      |          ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b)
{
    if (a % b == 0)
    {
        return(b);
    }
    else
    {
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int main() {
  string x;
  cin >> x;
  int e=0,n=0,s=0,w=0;
  for(int i=0;i<n;i++){
    if(x[i]=="E"){
      e++;
    }
    if(x[i]=="N"){
      n++;
    }
    if(x[i]=="S"){
      s++;
    }
    if(x[i]=="W"){
      w++;
    }
  }
  if(e-w==e||w-e==w){
    cout << "No" << endl;
  }
  else if(n-s==n||s-n==s){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   89 |     if(x[i]=="E"){
a.cc:92:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   92 |     if(x[i]=="N"){
a.cc:95:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   95 |     if(x[i]=="S"){
a.cc:98:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   98 |     if(x[i]=="W"){
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: 's' was not declared in this scope
   10 |     int n = 0,w = 0;s = 0;e = 0;
      |                     ^
a.cc:10:27: error: 'e' was not declared in this scope
   10 |     int n = 0,w = 0;s = 0;e = 0;
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main()
{
  string s;
  cin >> s;
  map<char, int> mp;
  rep(i, s.size()) {
    mp[s[i]]++;
  }
  string ans = "Yes";
  if (mp['N']==0 ^^ mp['S']==0) ans = "No";
  if (mp['E']==0 ^^ mp['W']==0) ans = "No";
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: expected primary-expression before '^' token
   20 |   if (mp['N']==0 ^^ mp['S']==0) ans = "No";
      |                   ^
a.cc:21:19: error: expected primary-expression before '^' token
   21 |   if (mp['E']==0 ^^ mp['W']==0) ans = "No";
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<llll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  
int main() {
  string s;
  cin >> s;
  ll k=s.size();
  ll a=0,b=0,c=0,d=0;
  rep(i,k){
    if(s[i]=='S'){
      a++;
    }
    else if(s[i]=='N'){
      b++;
    }
    else if(s[i]=='W'){
      c++;
    }
    else
      d++;
  }
  if(a*b==0&&max(a,b)!=0){
    cout << "No" << endl;
  }
  else if(c*d==0&&max(c,d)!=0){
    cout << "No" << endl;
  }
  else
    cout << "Yes" << endl;
}

Compiler output:
a.cc:8:16: error: 'llll' was not declared in this scope
    8 | typedef vector<llll> vl;
      |                ^~~~
a.cc:8:20: error: template argument 1 is invalid
    8 | typedef vector<llll> vl;
      |                    ^
a.cc:8:20: error: template argument 2 is invalid
Language: C++

/*
Author : N_o_o_B
Created : April 22 2020 22:57:50 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    string s;
    cin >> s;
    bool ok = 1;
    vi cnt(4);int i=0;
    for(char c:{'N','S','E','W'}){
        cnt[i] = 0;
        for(char c1:s){
            cnt[i] += (c1 == c);
        }
        cnt[i] = bool(cnt[i]);
        i++;
    }
    bool ok = !(cnt[0]^cnt[1]);
    ok &= (!(cnt[2]^cnt[3]));
    cout << (ok ? "Yes":"No") << endl;



    time_taken();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:99:10: error: redeclaration of 'bool ok'
   99 |     bool ok = !(cnt[0]^cnt[1]);
      |          ^~
a.cc:89:10: note: 'bool ok' previously declared here
   89 |     bool ok = 1;
      |          ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    vector<string> t = {"NS", "WE", "NEWS"};
    for (int i = 0; i < 3; i++) {
        sort(all(t[i]));
    }
    string s;
    cin >> s;
    sort(all(s));
    s.erase(unique(s.begin(), s.end()), s.end());
    if (find(all(t), s) == t.end()) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
    8 |         sort(all(t[i]));
      |              ^~~
      |              std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
a.cc:12:10: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   12 |     sort(all(s));
      |          ^~~
      |          std::filesystem::perms::all
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

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

int main() {
string s;
cin >> s;
bool S= false;
bool W= false;
bool N= false;
bool E= false;


int l = s.size();

for(int i = 0;i < l;i++){
switch (s[i]) {
  case 'S' :
  S = true;
  break;
  case 'W' :
  W = true;
  break;
  case 'N' :
  N = true;
  break;
  default :
  E = true;
  break;
}
}

if((N&&S)||(W&&E)||(N&&S&&W&&E)){
  cout << "Yes" <<endl;
}
else{
  cout << "No" <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <string>
#include <iostream>
using namespace std;
int main(){
 string s; cin >> s;
  int x=0,y=0;
  for(int i=0;i<s.length();i++){
   if(s[i]=='N') y++; 
   if(s[i]=='S') y--;
   if(s[i]=='W') s--;
   if(s[i]=='E') s++;
  }
  string ans;
  if(x==0 and y==0) ans="Yes";
  else ans="No";
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   10 |    if(s[i]=='W') s--;
      |                  ~^~
a.cc:11:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |    if(s[i]=='E') s++;
      |                  ~^~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
char s[1005];
scanf("%s",s);
int n=0,w=0,e=0,s=0;
for(int i=0;s[i]!='\0';i++){
if(s[i]=='s'){s++;}
if(s[i]=='n'){n++;}
if(s[i]=='w'){w++;}
if(s[i]=='e'){e++;}
}
if(s==0&&n!=0||s!=0&&n==0){printf("No");}
else if(w==0&&e!=0||w!=0&&e==0){printf("No");}
else{printf("Yes");}
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: conflicting types for 's'; have 'int'
    8 | int n=0,w=0,e=0,s=0;
      |                 ^
main.c:6:6: note: previous declaration of 's' with type 'char[1005]'
    6 | char s[1005];
      |      ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  int a,b,c,d;
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  vector<char> a(S.size());
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'N') {
      a++;
    }
    else if (S.at(i) == 'W') {
      b++;
    }
    else if (S.at(i) == 'S') {
      c++;
    }
    else {
      d++;
    }
  }
  
  if (a > 0 && c == 0) {
    cout << "No" <<endl;
  }
  else if (b > 0 && d == 0) {
    cout << "No" <<endl;
  }
  else if (a == 0 && c > 0) {
    cout << "No" <<endl;
  }
  else if (b == 0 && d > 0) {
    cout << "No" <<endl;
  }
  else {
    cout << "Yes" <<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: conflicting declaration 'std::vector<char> a'
   12 |   vector<char> a(S.size());
      |                ^
a.cc:7:7: note: previous declaration as 'int a'
    7 |   int a,b,c,d;
      |       ^
Language: C++

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

int main() {
  string S;
  cin  S;
  int a,b,c,d;
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  vector<char> a(S.size());
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'N') {
      a++;
    }
    else if (S.at(i) == 'W') {
      b++;
    }
    else if (S.at(i) == 'S') {
      c++;
    }
    else {
      d++;
    }
  }
  
  if (a > 0 && c == 0) {
    cout << "No" <<endl;
  }
  else if (b > 0 && d == 0) {
    cout << "No" <<endl;
  }
  else if (a == 0 && c > 0) {
    cout << "No" <<endl;
  }
  else if (b == 0 && d > 0) {
    cout << "No" <<endl;
  }
  else {
    cout << "Yes" <<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'S'
    6 |   cin  S;
      |      ^ ~
      |      ;
a.cc:12:16: error: conflicting declaration 'std::vector<char> a'
   12 |   vector<char> a(S.size());
      |                ^
a.cc:7:7: note: previous declaration as 'int a'
    7 |   int a,b,c,d;
      |       ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  int a,b,c,d;
  int a = b - c = d =0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'N') {
      a++;
    }
    else if (S.at(i) == 'W') {
      b++;
    }
    else if (S.at(i) == 'S') {
      c++;
    }
    else {
      d++;
    }
  }
  
  if (a == d && b == c) {
    cout << "Yes" <<endl;
  }
  else {
    cout << "No" <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int a'
    8 |   int a = b - c = d =0;
      |       ^
a.cc:7:7: note: 'int a' previously declared here
    7 |   int a,b,c,d;
      |       ^
a.cc:8:13: error: lvalue required as left operand of assignment
    8 |   int a = b - c = d =0;
      |           ~~^~~
Language: C++

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

int main() {
  string S;
  cin >> S;
  int a = b = c = d = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == 'N') {
      a++;
    }
    else if (S.at(i) == 'W') {
      b++;
    }
    else if (S.at(i) == 'S') {
      c++;
    }
    else {
      d++;
    }
  }
  
  if (a == d && b == c) {
    cout << "Yes" <<endl;
  }
  else {
    cout << "No" <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'b' was not declared in this scope
    7 |   int a = b = c = d = 0;
      |           ^
a.cc:7:15: error: 'c' was not declared in this scope
    7 |   int a = b = c = d = 0;
      |               ^
a.cc:7:19: error: 'd' was not declared in this scope
    7 |   int a = b = c = d = 0;
      |                   ^
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++) {
      |                       ^