Submission #845412
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(i=a;i<b;++i) #define rep(i,n) REP(i,0,n) #define ll long long #define ull unsigned ll typedef long double ld; #define ALL(a) (a).begin(),(a).end() #define ifnot(a) if(not a) #define dump(x) cerr << #x << " = " << (x) << endl using namespace std; // #define int ll bool test = 0; int dx[] = { 0,1,0,-1 }; int dy[] = { 1,0,-1,0 }; #define INF (1 << 28) ull mod = (int)1e9 + 7; //..................... #define MAX (int)1e6 + 5 signed main() { ll i, j, k, l; ll N; string s; map<char, int> m; cin >> s; rep(i, s.size()) { m[s[i]] = 0; } //dump(m.count('S')); bool yes = false; if (m.size() == 4) { yes = true; } else if (m.size() == 2) { if (m.count('N') == 0 && m.count('S') == 0) { // cerr << "NS" << endl; yes = true; } else if (m.count('W') == 0 && m.count('E') == 0) { // cerr << "SE" << endl; yes = true; } } puts(yes ? "Yes" : "No"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Wanna go back home |
User | naimonon77 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1049 Byte |
Status | AC |
Exec Time | 4 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 | 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 | 4 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 |