Submission #1731951
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/stack:16777216") #include <string> #include <vector> #include <map> #include <list> #include <iterator> #include <cassert> #include <set> #include <queue> #include <iostream> #include <sstream> #include <stack> #include <deque> #include <cmath> #include <memory.h> #include <cstdlib> #include <cstdio> #include <cctype> #include <algorithm> #include <utility> #include <time.h> #include <complex> using namespace std; #define FOR(i,a,b) for(int i = (a); i < (b); i++) #define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--) #define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a, value) memset(a, value, sizeof(a)) #define SZ(a) (int) a.size() #define ALL(a) a.begin(),a.end() #define PB push_back #define MP make_pair typedef long long LL; typedef vector<int> VI; typedef pair<int, int> PII; const double PI = acos(-1.0); const LL INF = 1000 * 1000 *1000 + 7; const LL LINF = INF * (LL)INF; int main() { //freopen("in.txt","r", stdin); //ios::sync_with_stdio(false); cin.tie(0); string s; cin>>s; bool c1 = 0, c2 = 0, c3 = 0, c4 = 0; FOR (i, 0, SZ(s)) { if (s[i] == 'N') c1 = 1; if (s[i] == 'E') c2 = 1; if (s[i] == 'W') c3 = 1; if (s[i] == 'S') c4 = 1; } if (c1 && c2 && c3 && c4) { cout<<"Yes"<<endl; return 0; } if (c1 && c4 && !c2 && !c3) { cout<<"Yes"<<endl; return 0; } if (c2 && c3 && !c1 && !c4) { cout<<"Yes"<<endl; return 0; } cout<<"No"<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Wanna go back home |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1508 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
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 | 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 |