Submission #3137591
Source Code Expand
#include <iostream> #include <cmath> #include <string> #include <algorithm> #include <set> #include <vector> #include <map> #include <list> #include <stack> #include <cstdio> #include <cstring> #include <cstdlib> #include <queue> #define pye cout << "yes" << endl; #define pno cout << "no" << endl; #define pYe cout << "Yes" << endl; #define pNo cout << "No" << endl; #define pYE cout << "YES" << endl; #define pNO cout << "NO" << endl; #define prin(num) cout << num << endl; #define REP(i, n) for(i=0; i<n; i++) #define REPR(i, n) for(i=n; i>=0; i--) #define FOR(i, m, n) for(i=m; i<n; i++) #define max(a, b) ((a)>(b) ? (a):(b)) #define min(a, b) ((a)<(b) ? (a):(b)) #define INF 1000000000 #define MOD 1000000007LL #define MAX 100005 #define NIL -1 #define WHITE 0 #define GRAY 1 #define BLACK 2 using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<double, double> doup; typedef map<ll, ll> Map; int main(void) { string s; ll a=0, b=0, c=0, d=0, i; cin >> s; for(i=0; i<s.size(); i++) { if(s[i]=='N') a=1; else if(s[i]=='S') b=1; else if(s[i]=='W') c=1; else d=1; } if(a==b && c==d) pYe else pNo }
Submission Info
Submission Time | |
---|---|
Task | A - Wanna go back home |
User | eQe |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1250 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 |