Submission #844416


Source Code Expand

/*
*/
#define _CRT_SECURE_NO_WARNINGS

//#pragma comment(linker, "/STACK:16777216")
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>  
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash

#define eps 1e-10
#define M_PI 3.141592653589793
#define bs 1000000007;
#define bsize 512

const int N = 13031;

using namespace std;

string st;
int cnt[1000];

bool ok(char a, char b)
{
	if (cnt[a] > 0 && cnt[b] > 0)
		return 1;
	if (cnt[a] == 0 && cnt[b] == 0)
		return 1;
	return 0;
}

int main(){
	//freopen("beavers.in","r",stdin);
	//freopen("beavers.out","w",stdout);
	//freopen("F:/in.txt","r",stdin);
	//freopen("F:/output.txt","w",stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin >> st;
	for (int i = 0; i < st.size(); i++)
		cnt[st[i]]++;
	if (ok('N','S')&&ok('E','W'))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	cin.get(); cin.get();
	return 0;
}

Submission Info

Submission Time
Task A - Wanna go back home
User LeBron
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1304 Byte
Status AC
Exec Time 4 ms
Memory 256 KB

Compile Error

./Main.cpp:32:0: warning: "M_PI" redefined
 #define M_PI 3.141592653589793
 ^
In file included from /usr/include/c++/5/cmath:44:0,
                 from /usr/include/c++/5/complex:44,
                 from ./Main.cpp:9:
/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 200 / 200
Status
AC × 4
AC × 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 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