Submission #844496


Source Code Expand

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

typedef long long ll;
typedef long long LL;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

#ifdef DEBUG
    #define cek(x) cout<<x
#else
    #define cek(x) if(false){}
#endif // DEBUG

#define fi first
#define se second
#define INF 1000000000
#define INFLL 1000000000000000000LL
#define EPS 1e-9
#define PI acos(-1.0)
#define pb push_back
#define TC() while(tc--)
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORN(i,n) for(int i=0;i<=n;i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define REPN(i,a,b) for(int i=a;i<=b;i++)
#define reset(a,b) memset(a,b,sizeof(a))
#define sc(x) scanf("%d",&x)

int main(void){
    #ifdef ccsnoopy
        freopen("D:/Code/in.txt","r",stdin);
    #endif

    char str[1010];
    scanf("%s", str);
    int len = strlen(str);
    bool visited[4];
    reset(visited, false);
    FOR(i,len){
        if(str[i] == 'N')visited[0] = true;
        else if(str[i] == 'S') visited[1] = true;
        else if(str[i] == 'E') visited[2] = true;
        else if(str[i] == 'W')visited[3] = true;
    }

    if((visited[0]^visited[1])||(visited[2]^visited[3])){
        cout << "No";
    }else cout <<"Yes";


    return 0;
}



Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:37:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", str);
                     ^

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 4 ms 256 KB
04.txt AC 4 ms 256 KB
05.txt AC 4 ms 256 KB
06.txt AC 4 ms 256 KB
07.txt AC 4 ms 256 KB
08.txt AC 4 ms 256 KB
09.txt AC 4 ms 256 KB
10.txt AC 4 ms 256 KB
11.txt AC 5 ms 256 KB
13.txt AC 4 ms 256 KB
15.txt AC 4 ms 256 KB
s1.txt AC 4 ms 256 KB
s2.txt AC 4 ms 256 KB
s3.txt AC 4 ms 256 KB
s4.txt AC 4 ms 256 KB