Submission #3144631


Source Code Expand

#include<bits/stdc++.h>
#ifdef LOCAL
    #define _GLIBCXX_DEBUG
    #define dbg(x) cerr << #x << " = " << x << char(10);
#else
    #define dbg(x) ;
    #define cerr if(0) cerr
    #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
    #pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#endif
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mkt make_tuple
using namespace std;
using ld = long double;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
const ld eps = 1e-8l;
const int INF = 1e9 + 10;
const ll INFL = 9 * 1e18;
const ll MOD = 1e9 + 7;
const ld Pi = acosl(-1.0l);

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(9);
    cout << fixed;
    #ifdef LOCAL
        assert(freopen("in", "r", stdin));
        assert(freopen("out", "w", stdout));
        assert(freopen("err", "w", stderr));
    #endif

    map<char, int> mp;
    string s;
    cin >> s;
    for(auto i: s)
        mp[i] = 1;
    dbg(mp['N']);
    dbg(mp['S']);
    if(mp['N'] ^ mp['S'] || mp['E'] ^ mp['W'])
        cout << "No";
    else
        cout << "Yes";
}

Submission Info

Submission Time
Task A - Wanna go back home
User aalekseev
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1269 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 15
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 13.txt, 15.txt, s1.txt, s2.txt, s3.txt, s4.txt
Case Name Status Exec Time Memory
01.txt AC 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 1 ms 256 KB
06.txt AC 1 ms 256 KB
07.txt AC 1 ms 256 KB
08.txt AC 1 ms 256 KB
09.txt AC 1 ms 256 KB
10.txt AC 1 ms 256 KB
11.txt AC 1 ms 256 KB
13.txt AC 1 ms 256 KB
15.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB
s4.txt AC 1 ms 256 KB