Submission #882325
Source Code Expand
/*
Swamy Saranam
Date : 14/09/2016 22:25:16
Author : Krishna Mohan A M
Problem :
Status :
*/
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ld,ld> pdd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef pair<ll,ll> pl;
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define SORT(v) sort((v).begin(),(v).end())
#define UN(v) SORT(v),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define CL(a,b) memset(a,b,sizeof a)
#define pb push_back
#define x first
#define y second
#define endl "\n"
#define sendl " \n"
const int mod = 1000000007;
bool n, s, e, w;
string st;
int main()
{
FASTIO
cin>>st;
n = s = e = w = false;
for(auto i : st){
//cout<<i<<endl;
if(i=='N')
n = true;
else if(i=='S')
s = true;
else if(i=='E')
e = true;
else if(i=='W')
w = true;
}
if((e&&w&&!n&&!s) || (n&&s&&e&&w) || (n&&s&&!e&&!w))
cout<<"Yes\n";
else
cout<<"No\n";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Wanna go back home |
| User | krishnaanaril |
| Language | C++14 (GCC 5.4.1) |
| Score | 200 |
| Code Size | 1291 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| 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 KiB |
| 04.txt | AC | 4 ms | 256 KiB |
| 05.txt | AC | 4 ms | 256 KiB |
| 06.txt | AC | 4 ms | 256 KiB |
| 07.txt | AC | 4 ms | 256 KiB |
| 08.txt | AC | 4 ms | 256 KiB |
| 09.txt | AC | 4 ms | 256 KiB |
| 10.txt | AC | 4 ms | 256 KiB |
| 11.txt | AC | 4 ms | 256 KiB |
| 13.txt | AC | 4 ms | 256 KiB |
| 15.txt | AC | 4 ms | 256 KiB |
| s1.txt | AC | 4 ms | 256 KiB |
| s2.txt | AC | 4 ms | 256 KiB |
| s3.txt | AC | 4 ms | 256 KiB |
| s4.txt | AC | 4 ms | 256 KiB |