Submission #844427


Source Code Expand

#include <iostream>

#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

#include <cmath>
#include <algorithm>

#include <fstream>

using namespace std;

#define M_PI 3.14159265358979323846264338327950288


int main()
{
  srand(179179);

  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  cout.setf(ios_base::fixed);
  cout.precision(28);

  string S;
  cin >> S;
  map<char, int> m;
  for (auto& x : S) {
    ++m[x];
  }
  if (m.size() == 4 || (m.size() == 2 && (m['S'] > 0 && m['N'] > 0 || m['E'] > 0 && m['W'] > 0))) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}

Submission Info

Submission Time
Task A - Wanna go back home
User ultizet
Language C++14 (GCC 5.4.1)
Score 0
Code Size 740 Byte
Status WA
Exec Time 65 ms
Memory 764 KB

Compile Error

./Main.cpp:19:0: warning: "M_PI" redefined
 #define M_PI 3.14159265358979323846264338327950288
 ^
In file included from /usr/include/c++/5/cmath:44:0,
                 from ./Main.cpp:12:
/usr/include/math.h:372:0: note: this is the location of the previous definition
 # define M_PI  3.14159265358979323846 /* pi */
 ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
WA × 4
WA × 15
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 WA 65 ms 764 KB
04.txt WA 4 ms 256 KB
05.txt WA 4 ms 256 KB
06.txt WA 4 ms 256 KB
07.txt WA 4 ms 256 KB
08.txt WA 4 ms 256 KB
09.txt WA 6 ms 256 KB
10.txt WA 4 ms 256 KB
11.txt WA 4 ms 256 KB
13.txt WA 4 ms 256 KB
15.txt WA 4 ms 256 KB
s1.txt WA 4 ms 256 KB
s2.txt WA 4 ms 256 KB
s3.txt WA 4 ms 256 KB
s4.txt WA 4 ms 256 KB