Submission #1814136
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <vector> #include <string> #include <iostream> #include <algorithm> #include <map> #include <iterator> #include <functional> #include <set> #include <stack> #include <queue> #include <deque> #include <fstream> #include <iomanip> #include <unordered_map> #include <unordered_set> #include <numeric> #include <cmath> #include <list> #include <sstream> #include <tuple> #include <complex> #include <stdio.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("sse4") typedef long double LD; typedef long long LL; typedef pair<int, int> PII; typedef pair<LD, LD> PDD; typedef pair<LL, LL> PLL; typedef vector<int> VI; typedef vector<LL> VLL; typedef vector<char> VCH; typedef vector<LD> VLD; typedef vector<string> VS; typedef vector<VS> VSS; typedef vector<VI> VVI; typedef vector<VLL> VVLL; typedef vector<VCH> VVCH; typedef vector<PII> VPII; typedef vector<PLL> VPLL; typedef vector<PDD> VPDD; #define MP make_pair #define PB push_back #define X first #define Y second #define next fake_next #define prev fake_prev #define left fake_left #define right fake_right #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 REP(i, t) FOR(i,0,t) #define ALL(a) a.begin(), a.end() #define SZ(a) (int)((a).size()) const LD PI = acos(-1.0); const LL mod = 1000000007; const LL INF = 1e9; const LL LINF = 1e18; const LL MAXQ = 1007; const int MAXN = 10007; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); //freopen("In.txt", "r", stdin); string s; cin >> s; bool a1, a2, a3, a4; a1 = a2 = a3 = a4 = 0; FOR(i, 0, SZ(s)) if (s[i] == 'S') a1 = 1; else if (s[i] == 'N') a2 = 1; else if (s[i] == 'W') a3 = 1; else a4 = 1; if (a1 == a2 && a3 == a4) cout << "Yes"; else cout << "No"; //cin >> s; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Wanna go back home |
User | vjudge5 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1901 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 |