s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s325971088 | p04019 | u409064224 | 1536542589 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 369 | s = input()
l = [0]*4
y = "Yes"
n = "No"
res = ""
for i in s:
if i == "S":
l[0] += 1
elif i == "E":
l[1] += 1
elif i == "N":
l[2] += 1
elif i == "W":
l[3] += 1
if (l[0] == 0 and l[2] >= 1) or (l[0] >= 1 and l[2] == 0) or (l[1] == 0 and l[3] >= 1) or (l[3] == 0 and l[1] ... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,771 |
s076604273 | p04019 | u108617242 | 1536542443 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 250 | S = input()
if len(set(S)) % 2 == 1:
print('No')
elif len(set(S)) == 4:
print('Yes')
elif len(set(S)) == 2:
if 'N' in S and 'S' in S:
print('Yes')
elif 'W' in S and 'E' in S:
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,772 |
s558252768 | p04019 | u790301364 | 1536330612 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 611 | def main23():
strbuf = input("");
flag = [];
for i in range(4):
flag.append(False);
for i in range(len(strbuf)):
if strbuf[i] == 'N':
flag[0] = True;
if strbuf[i] == 'W':
flag[1] = True;
if strbuf[i] == 'S':
flag[2] = True;
if s... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,773 |
s980130677 | p04019 | u284854859 | 1535827419 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 325 | # cook your dish here
s=list(input())
a = s.count('N')
b = s.count('W')
c = s.count('S')
d = s.count('E')
ass = 0
if a ==0:
if c == 0:
ass += 1
else:
if c > 0:
ass += 1
if b == 0:
if d == 0:
ass += 1
else:
if d > 0:
ass += 1
if ass == 2:
print('Yes')
else:
print(... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,774 |
s219774503 | p04019 | u690536347 | 1535045859 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 222 | x,y=0,0
s=input()
a=s.count("N")>0
b=s.count("S")>0
c=s.count("E")>0
d=s.count("W")>0
e=(a,b,c,d)
if e==(True,True,False,False) or e==(False,False,True,True) or e==(True,True,True,True):
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,775 |
s361035031 | p04019 | u353412420 | 1533984815 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 95 | s=input()
print("Yes" if (not ('N' in s)^('S' in s)) and (not ('W' in s)^('E' in s)) else "No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,776 |
s297977294 | p04019 | u263933075 | 1533930111 | Python | Python (2.7.6) | py | Accepted | 11 | 2568 | 151 | s = set(raw_input())
l = len(s)
if l in [1, 3]:
print 'No'
elif l == 4:
print 'Yes'
else:
print ['No', 'Yes'][s in [set('NS'), set('WE')]]
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,777 |
s234355561 | p04019 | u005260772 | 1533930088 | Python | Python (2.7.6) | py | Accepted | 10 | 2696 | 151 | s = set(raw_input())
l = len(s)
if l in [1, 3]:
print 'No'
elif l == 4:
print 'Yes'
else:
print ['No', 'Yes'][s in [set('NS'), set('WE')]]
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,778 |
s963274502 | p04019 | u333945892 | 1533782870 | Python | Python (3.4.3) | py | Accepted | 46 | 4584 | 643 | from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]
def inpl(): return list(map(int, input().split()))
def inpl_str()... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,779 |
s190928305 | p04019 | u297574184 | 1533773730 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 211 | Ss = input()
setS = set(Ss)
lenS = len(setS)
if lenS in [1, 3]:
print('No')
elif lenS == 4:
print('Yes')
else:
if setS in [set('NS'), set('WE')]:
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,780 |
s519852522 | p04019 | u808427016 | 1533101386 | Python | Python (3.4.3) | py | Accepted | 45 | 3828 | 194 | S = input()
from collections import Counter
cs = Counter(S)
result = not (((cs["N"] > 0) ^ (cs["S"] > 0)) | ((cs["W"] > 0) ^ (cs["E"] > 0)))
if result:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,781 |
s921446835 | p04019 | u832039789 | 1532842770 | Python | Python (3.4.3) | py | Accepted | 16 | 2940 | 74 | s=input();print(['Yes','No'][(('N'in s)^('S'in s))|(('E'in s)^('W'in s))]) | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,782 |
s111133357 | p04019 | u832039789 | 1532842582 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 75 | s=input();print('No'if(('N'in s)^('S'in s))|(('E'in s)^('W'in s))else'Yes') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,783 |
s021103287 | p04019 | u562935282 | 1532377529 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 273 | s = input()
cnt_n = s.count('N')
cnt_s = s.count('S')
cnt_e = s.count('E')
cnt_w = s.count('W')
p1 = ((cnt_n > 0) and (cnt_s > 0)) or ((cnt_n == 0) and (cnt_s == 0))
p2 = ((cnt_e > 0) and (cnt_w > 0)) or ((cnt_e == 0) and (cnt_w == 0))
print('Yes' if p1 and p2 else 'No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,784 |
s101777806 | p04019 | u627417051 | 1531460306 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 401 | S = list(input())
if S.count("N") == 0 and S.count("S") == 0:
if S.count("E") >= 1 and S.count("W") >= 1:
print("Yes")
else:
print("No")
elif S.count("E") == 0 and S.count("W") == 0:
if S.count("N") >= 1 and S.count("S") >= 1:
print("Yes")
else:
print("No")
else:
if S.count("N") >= 1 and S.count("S") >= 1 ... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,785 |
s802573662 | p04019 | u353919145 | 1530622378 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 363 | def back_home():
S=input()
if((('S'in S) and ('N' in S)) and not (('E' in S) or ('W' in S))):
print('Yes')
elif(not (('S' in S) or ('N' in S)) and (('E' in S) and ('W' in S))):
print("Yes")
elif((('S'in S) and ('N' in S)) and (('E' in S) and ('W' in S))):
print("Yes")
else:... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,786 |
s346171595 | p04019 | u863370423 | 1530620345 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 311 | def backhome():
s = input()
if (('N' in s) and ('S' in s)) and not (('W' in s) or ('E' in s)):
print("Yes")
elif (('W' in s) and ('E' in s)) and not (('N' in s) or ('S' in s)):
print("Yes")
elif (('W' in s) and ('E' in s)) and (('N' in s) and ('S' in s)):
print("Yes")
else:
print("No")
backhome() | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,787 |
s675462346 | p04019 | u957084285 | 1529900643 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 85 | s = input()
print(["Yes","No"][(("N"in s) ^ ("S"in s)) or (("W"in s) ^ ("E" in s))])
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,788 |
s336582710 | p04019 | u218843509 | 1529821683 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 124 | s = set(list(input()))
if s == {"N", "S"} or s == {"E", "W"} or s == {"N", "W", "S", "E"}:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,789 |
s656764935 | p04019 | u136090046 | 1529786430 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 283 | import collections
s = input()
d = collections.Counter(s)
if len(d.keys()) == 4:
print("Yes")
elif len(d.keys()) == 2 and "N" in d.keys() and "S" in d.keys():
print("Yes")
elif len(d.keys()) == 2 and "E" in d.keys() and "W" in d.keys():
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,790 |
s274674714 | p04019 | u136395536 | 1528644953 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 209 | S = input()
n = S.count("N")
w = S.count("W")
s = S.count("S")
e = S.count("E")
if (n == 0 and s > 0) or (s == 0 and n > 0) or (w == 0 and e > 0) or (e == 0 and w > 0):
print("No")
else:
print("Yes") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,791 |
s761927694 | p04019 | u200239931 | 1528505764 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 796 | def getinputdata():
array_result = []
data = input()
array_result.append(data.split(" "))
flg = True
try:
while flg:
data = input()
if(data != ""):
array_result.append(data.split(" "))
flg = True
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,792 |
s741407876 | p04019 | u354638986 | 1528467066 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 351 | def main():
s = input()
s_set = set(s)
if len(s_set) == 4:
print("Yes")
elif len(s_set) == 2:
if ("N" in s_set and "S" in s_set) or ("W" in s_set and "E" in s_set):
print("Yes")
else:
print("No")
else:
print("No")
if __na... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,793 |
s983860914 | p04019 | u327248573 | 1528423660 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 139 | S = set(input())
if S == set(['N', 'S', 'W', 'E']) or S == set(['N', 'S']) or S == set(['E', 'W']):
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,794 |
s851423622 | p04019 | u813450984 | 1528090091 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 290 | s = set(list(input()))
if len(s) == 3 or len(s) == 1:
print('No')
elif 'N' in s and 'S' in s and 'E' in s and 'W' in s:
print('Yes')
elif len(s) == 2:
if 'N' in s and 'S' in s:
print('Yes')
elif 'W' in s and 'E' in s:
print('Yes')
else:
print('No')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,795 |
s911276147 | p04019 | u952708174 | 1526914425 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 211 | import collections
S = input().strip()
count = collections.Counter(S)
cond1 = (count['N']==0) == (count['S']==0)
cond2 = (count['E']==0) == (count['W']==0)
if cond1 and cond2:
print('Yes')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,796 |
s350537576 | p04019 | u102126195 | 1526828832 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 594 | S = input()
S_list = []
for i in range(len(S)):
if S[i] == "N":
S_list.append(0)
elif S[i] == "W":
S_list.append(1)
elif S[i] == "S":
S_list.append(2)
elif S[i] == "E":
S_list.append(3)
route = [0, 0, 0, 0]
for i in S_list:
route[i] += 1
if route[0] != 0 and route[1... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,797 |
s965090766 | p04019 | u186426563 | 1526414731 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 88 | s = input()
print('Yes' if(('W' in s)==('E' in s) and ('N' in s)==('S' in s)) else 'No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,798 |
s831414964 | p04019 | u846150137 | 1526299372 | Python | Python (3.4.3) | py | Accepted | 24 | 3444 | 143 | from collections import Counter
a=Counter(set(list(input().strip())))
if a["N"]==a["S"] and a["E"]==a["W"]:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,799 |
s106249886 | p04019 | u729133443 | 1526253479 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 79 | s=input();f=lambda c:c in s;print(['Yes','No'][f('N')^f('S') or f('E')^f('W')]) | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,800 |
s587145272 | p04019 | u729133443 | 1526253212 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 168 | s = list(input())
if ('N' in s and 'S' in s or not ('N' in s or 'S' in s)) and ('E' in s and 'W' in s or not ('E' in s or 'W' in s)):
print('Yes')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,801 |
s012968990 | p04019 | u143492911 | 1526010922 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 402 | s=list(input())
n=len(s)
n_cnt,w_cnt,s_cnt,e_cnt=0,0,0,0
for i in range(n):
if s[i]=="N":
n_cnt=1
elif s[i]=="W":
w_cnt=1
elif s[i]=="S":
s_cnt=1
elif s[i]=="E":
e_cnt=1
if n_cnt+w_cnt+s_cnt+e_cnt==4:
print("Yes")
elif n_cnt+s_cnt==2 and w_cnt+e_cnt==0:
print("Yes... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,802 |
s425962419 | p04019 | u039623862 | 1525845179 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 172 | import collections
c = collections.Counter(input())
if (c['N'] > 0) ^ (c['S'] > 0):
print('No')
elif (c['W'] > 0) ^ (c['E'] > 0):
print('No')
else:
print('Yes') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,803 |
s125525955 | p04019 | u766407523 | 1525834273 | Python | Python (3.4.3) | py | Accepted | 20 | 3316 | 182 | import collections
cnt = collections.Counter(input())
ans = 'Yes'
if (cnt['E'] == 0) ^ (cnt['W'] == 0):
ans = 'No'
if (cnt['N'] == 0) ^ (cnt['S'] == 0):
ans = 'No'
print(ans) | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,804 |
s961546843 | p04019 | u761320129 | 1524928858 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 155 | S = input()
n = 'N' in S
w = 'W' in S
s = 'S' in S
e = 'E' in S
print('No' if (n and not s) or (s and not n) or (w and not e) or (e and not w) else 'Yes')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,805 |
s573151584 | p04019 | u520158330 | 1524853154 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 192 | S = input()
M = ["N","W","S","E"]
Sw = [0,0,0,0]
for i in range(4):
if M[i] in S: Sw[i] += 1
if (Sw[0]+Sw[2])%2==0 and (Sw[1]+Sw[3])%2==0:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,806 |
s772560099 | p04019 | u226108478 | 1524847505 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 363 | # -*- coding: utf-8 -*-
# AtCoder Grand Contest
# Problem A
if __name__ == '__main__':
s = input()
# See:
# http://agc003.contest.atcoder.jp/data/agc/003/editorial.pdf
# https://beta.atcoder.jp/contests/agc003/submissions/849782
if (('S' in s) ^ ('N' in s)) or (('W' in s) ^ ('E' in s)):
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,807 |
s683135450 | p04019 | u226108478 | 1524847058 | Python | Python (3.4.3) | py | Accepted | 23 | 3316 | 478 | # -*- coding: utf-8 -*-
# AtCoder Grand Contest
# Problem A
if __name__ == '__main__':
from collections import Counter
s = Counter(input())
if ('S' in s.keys()) and ('N' not in s.keys()):
print('No')
elif ('N' in s.keys()) and ('S' not in s.keys()):
print('No')
elif ('W' in s.ke... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,808 |
s926813950 | p04019 | u257974487 | 1524629367 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 238 | s = input()
S = s.count("S")
E = s.count("E")
N = s.count("N")
W = s.count("W")
if S > 0 and N > 0 or S == 0 and N == 0:
if E > 0 and W > 0 or E == 0 and W == 0:
print("Yes")
else:
print("No")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,809 |
s345356325 | p04019 | u856232850 | 1524376664 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 230 | a = input()
b = a.count('N')
c = a.count('S')
d = a.count('W')
e = a.count('E')
if (b != 0 and c== 0) or (b == 0 and c != 0):
print('No')
elif (d != 0 and e== 0) or (d == 0 and e != 0):
print('No')
else:
print('Yes') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,810 |
s635091541 | p04019 | u388927326 | 1524226023 | Python | Python (3.4.3) | py | Accepted | 22 | 3444 | 524 | #!/usr/bin/env python3
import sys, math, copy
# import fractions, itertools
# import numpy as np
# import scipy
HUGE = 2147483647
HUGEL = 9223372036854775807
ABC = "abcdefghijklmnopqrstuvwxyz"
def main():
s = input()
parity_sn = 0
if "S" in s:
parity_sn += 1
if "N" in s:
parity_sn += ... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,811 |
s426950402 | p04019 | u294000907 | 1523421369 | Python | Python (3.4.3) | py | Accepted | 19 | 3060 | 290 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 文字列の読み込み
str = input()
a = list(set(str))
if len(a)==4:
print("Yes")
elif len(a)%2==1:
print("No")
else:
if ('N' in a and 'S' in a ) or ('W' in a and 'E' in a ):
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,812 |
s062064581 | p04019 | u636387751 | 1522953484 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 333 | S = input()
flag = []
yoko = 0
tate = 0
for i in S:
if i not in flag:
flag.append(i)
if i == "W":
yoko += 1
elif i == "E":
yoko -= 1
elif i == "N":
tate += 1
else:
tate -= 1
if yoko == 0 and tate == 0:
print("Yes")
else:
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,813 |
s706578116 | p04019 | u875361824 | 1522812110 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 196 | def main():
S = input()
s = set(S)
if s == set("NWSE") or s == set("NS") or s == set("WE"):
print("Yes")
else:
print("No")
if __name__ == '__main__':
main()
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,814 |
s596667334 | p04019 | u391475811 | 1522778397 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 306 | S=input()
s,w,n,e=0,0,0,0
for i in range(len(S)):
if S[i]=='N':
n+=1
elif S[i]=='S':
s+=1
elif S[i]=='W':
w+=1
else:
e+=1
ns=False
ew=False
if (n>0 and s>0) or (n==0 and s==0):
ns=True
if (e>0 and w>0) or (e==0 and w==0):
ew=True
if ns and ew:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,815 |
s149321437 | p04019 | u075012704 | 1522611368 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 119 | S = input()
OK = [{"N", "S"}, {"E", "W"}, {"N", "E", "W", "S"}]
if set(S) in OK:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,816 |
s383921792 | p04019 | u729707098 | 1522444410 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 226 | s = input()
answer = "Yes"
if "N" in s and "S" not in s:
answer = "No"
elif "S" in s and "N" not in s:
answer = "No"
elif "W" in s and "E" not in s:
answer = "No"
elif "E" in s and "W" not in s:
answer = "No"
print(answer) | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,817 |
s784921251 | p04019 | u985076807 | 1522328538 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 109 | t = input()
if ('N' in t) == ('S' in t) and ('E' in t) == ('W' in t):
print('Yes')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,818 |
s044272963 | p04019 | u985076807 | 1522328432 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 161 | t = input()
n = 'N' in t
s = 'S' in t
e = 'E' in t
w = 'W' in t
if ('N' in t) == ('S' in t) and ('E' in t) == ('W' in t):
print('Yes')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,819 |
s479700069 | p04019 | u985076807 | 1522327046 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 289 | travel = input()
n = travel.count('N')
s = travel.count('S')
e = travel.count('E')
w = travel.count('W')
# print(f'N : {n}, S : {s}')
# print(f'E : {e}, W : {w}')
if n >= 1 and s == 0 or s >= 1 and n == 0 or e >= 1 and w == 0 or w >= 1 and e == 0:
print('No')
else:
print('Yes')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,820 |
s427187910 | p04019 | u941884460 | 1522122974 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 218 | s = input().rstrip()
dir = set()
for i in range(len(s)):
dir.add(s[i])
if len(dir)%2 == 0:
if ('N' in dir and 'S' in dir) or ('E' in dir and 'W' in dir):
print('Yes')
else:
print('No')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,821 |
s286659275 | p04019 | u075012704 | 1522101996 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 108 | check = [{"N", "S"}, {"E", "W"}, {"N", "E", "W", "S"}]
print("Yes" if set(list(input())) in check else 'No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,822 |
s272164856 | p04019 | u548624367 | 1521778494 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 106 | s = list(input())
if (('N' in s)^('S' in s)) or (('W' in s)^('E' in s)):
print("No")
else:
print("Yes")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,823 |
s543820455 | p04019 | u548624367 | 1521778411 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 106 | s = list(input())
if (("N" in s)^("S" in s)) or (("W" in s)^("E" in s)):
print("No")
else:
print("Yes")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,824 |
s746831738 | p04019 | u030726788 | 1521596524 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 135 | import sys
s=input()
op={"N":"S","S":"N","W":"E","E":"W"}
for i in s:
if(op[i] not in s):
print("No")
sys.exit()
print("Yes") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,825 |
s180908491 | p04019 | u667024514 | 1521213768 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 151 | s = str(input())
if ("S" in s) == ("N" in s):
if ("W" in s) == ("E" in s):
print("Yes")
else:
print("No")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,826 |
s409223668 | p04019 | u215693191 | 1519851474 | Python | Python (2.7.6) | py | Accepted | 11 | 2568 | 410 | def isAbleToBack(plan):
alphaToInt = {'E':0, 'W':1, 'N':2, 'S':3}
count = [False]*4
for c in plan:
count[alphaToInt[c]] = True
for i in xrange(4):
if count[i] and not count[i^1]:
return False
return True
def main():
plan = raw_input().strip()
if isAbleToBack(plan... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,827 |
s888349384 | p04019 | u562016607 | 1519484128 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 425 | S = [i for i in input()]
North = 0
East = 0
West = 0
South = 0
for i in S:
if i == "N":
North += 1
elif i == "E":
East += 1
elif i == "W":
West += 1
else:
South += 1
if North*East*West*South > 0:
print("Yes")
else:
if North *South == 0 and North+South > 0:
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,828 |
s592286618 | p04019 | u103539599 | 1518376822 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 112 | S=set(input())
if S=={"E","N","S","W"} or S=={"N","S"} or S=={"E","W"}:
print("Yes")
else:
print("No")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,829 |
s532527685 | p04019 | u761320129 | 1515684153 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 230 | from collections import Counter
S = input()
c = Counter(S)
if (c['N'] > 0 and c['S'] == 0) or (c['S'] > 0 and c['N'] == 0) or\
(c['W'] > 0 and c['E'] == 0) or (c['E'] > 0 and c['W'] == 0):
print('No')
else:
print('Yes') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,830 |
s066102302 | p04019 | u858748695 | 1515549491 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 199 | #!/usr/bin/env python3
S = input()
y, x = set(), set()
for c in S:
if c == 'N' or c == 'S':
y.add(c)
else:
x.add(c)
print(('No', 'Yes')[len(y) % 2 == 0 and len(x) % 2 == 0])
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,831 |
s350760453 | p04019 | u291111534 | 1510270641 | Python | PyPy2 (5.6.0) | py | Accepted | 38 | 27884 | 91 | S=raw_input()
print "No" if ("S" in S)+("N" in S)==1 or ("W" in S)+("E" in S)==1 else "Yes" | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,832 |
s698567335 | p04019 | u536081558 | 1510178182 | Python | Python (2.7.6) | py | Accepted | 10 | 2568 | 90 | s = raw_input()
print ['No', 'Yes'][('N' in s) == ('S' in s) and ('W' in s) == ('E' in s)] | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,833 |
s060176772 | p04019 | u309605945 | 1508470115 | Python | Python (2.7.6) | py | Accepted | 11 | 2568 | 86 | s = raw_input()
i=lambda c:c in s
print "No"*((i('N')^i('S'))or(i('W')^i('E')))or"Yes" | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,834 |
s535894080 | p04019 | u663710122 | 1507675526 | Python | Python (3.4.3) | py | Accepted | 18 | 3060 | 90 | S = input()
print('No' if ('E' in S) ^ ('W' in S) or ('S' in S) ^ ('N' in S) else 'Yes')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,835 |
s477288650 | p04019 | u254456372 | 1506111575 | Python | Python (3.4.3) | py | Accepted | 22 | 3316 | 404 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections
def main():
S = input()
c = collections.Counter(S)
if (c["N"] > 0 and c["S"] == 0) or (c["N"] == 0 and c["S"] > 0):
ok = False
elif (c["W"] > 0 and c["E"] == 0) or (c["W"] == 0 and c["E"] > 0):
ok = False
else:
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,836 |
s982125032 | p04019 | u596276291 | 1505506518 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 520 | from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10
def main():
S = input()
c = Counter(S)
n, w, s, e = c["N"], c["... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,837 |
s716489611 | p04019 | u830580569 | 1502316619 | Python | Python (2.7.6) | py | Accepted | 10 | 2568 | 339 | def wanna_go_home():
s = str(raw_input())
setlist = sorted(list(set(s)))
distinct_chars = len(setlist)
if distinct_chars%2!=0:
print "No"
else:
if distinct_chars==4:
print "Yes"
else:
if ''.join(setlist)=='NS' or ''.join(setlist)=='EW':
print "Yes"
else:
print "No"
if __name__ == "__main__... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,838 |
s878387522 | p04019 | u835482198 | 1500885179 | Python | Python (3.4.3) | py | Accepted | 20 | 3316 | 159 | from collections import Counter
s = Counter(input())
if (s['N'] > 0) == (s['S'] > 0) and (s["W"] > 0) == (s['E'] > 0):
print("Yes")
else:
print("No")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,839 |
s305878400 | p04019 | u089230684 | 1500364917 | Python | Python (3.4.3) | py | Accepted | 20 | 3060 | 379 | from sys import stdin
def main():
M = stdin.readline().strip()
S,E,N,W=False,False,False,False
for i in M:
if i == 'S':
S = True
elif i == 'E':
E = True
elif i == 'N':
N = True
elif i == 'W':
W = True
if S == N and E == W:
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,840 |
s399756327 | p04019 | u537963083 | 1499724487 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 398 | import sys
s = input()
if s.find('N') != -1:
if s.find('S') == -1:
print('No')
sys.exit()
if s.find('S') != -1:
if s.find('N') == -1:
print('No')
sys.exit()
if s.find('W') != -1:
if s.find('E') == -1:
print('No')
sys.exit()
if s.find('E') != -1:
if s.... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,841 |
s817834958 | p04019 | u976162616 | 1499722771 | Python | Python (3.4.3) | py | Accepted | 18 | 3060 | 476 | if __name__ == "__main__":
S = input()
res = set(S)
ok = True
for x in S:
if x == 'N':
if 'S' not in res:
ok = False
elif x == 'S':
if 'N' not in res:
ok = False
elif x == 'E':
if 'W' not in res:
... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,842 |
s909219053 | p04019 | u846552659 | 1497826252 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 444 | # -*- coding:utf-8 -*-
S = list(input())
flag1 = True
flag2 = True
list1 = [ tmp for tmp in S if tmp == 'N' or tmp == 'S' ]
list2 = [ tmp for tmp in S if tmp == 'W' or tmp == 'E' ]
if len(list1) > 0:
if 'N' in list1 and 'S' in list1:
pass
else:
flag1 = False
if len(list2) > 0:
if 'W' in lis... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,843 |
s117238625 | p04019 | u272028993 | 1493266191 | Python | Python (2.7.6) | py | Accepted | 11 | 2568 | 234 | s=raw_input()
n=False
e=False
w=False
ss=False
for i in xrange(len(s)):
if s[i]=="N":n=True
elif s[i]=="E":e=True
elif s[i]=="W":w=True
else:ss=True
if (n+ss)%2==0 and (e+w)%2==0:
print("Yes")
else:
print("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,844 |
s669532688 | p04019 | u942697937 | 1492231338 | Python | Python (2.7.6) | py | Accepted | 11 | 2568 | 132 | S = set(raw_input())
if len(set("NS") & S) == 1:
print "No"
elif len(set("WE") & S) == 1:
print "No"
else:
print "Yes"
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,845 |
s852525493 | p04019 | u934019430 | 1492141368 | Python | Python (3.4.3) | py | Accepted | 53 | 4848 | 232 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from random import *
s = input()
m = {}
for ch in s:
m.update({ch:1})
res = (m.get('N') == m.get('S')) and m.get('W') == m.get('E')
if res:
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,846 |
s277589115 | p04019 | u058240079 | 1491487742 | Python | Python (2.7.6) | py | Accepted | 10 | 2568 | 301 | s = raw_input()
bls = [False for _ in range(4)]
for c in s:
if c == 'N':
bls[0] = True
elif c == 'E':
bls[1] = True
elif c == 'W':
bls[2] = True
elif c == 'S':
bls[3] = True
if bls[0] == bls[3] and bls[1] == bls[2]:
print 'Yes'
else:
print 'No'
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,847 |
s581101494 | p04019 | u834311314 | 1484628170 | Python | Python (3.4.3) | py | Accepted | 23 | 3064 | 383 | Str = input()
N = False
W = False
S = False
E = False
for i in Str:
if i == 'N':
N = True
if i == 'W':
W = True
if i == 'S':
S = True
if i == 'E':
E = True
if (N == True and S == False) or (N == False and S == True):
print("No")
elif (W == True and E == False) or (W ... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,848 |
s791137752 | p04019 | u095015466 | 1481219408 | Python | Python (2.7.6) | py | Accepted | 17 | 2568 | 231 | d={"N":0,"W":0,"S":0,"E":0}
s=raw_input()
for i in xrange(len(s)):
d[s[i]]+=1
if((d["N"]==0 and d["S"]==0) or (d["N"]>0 and d["S"]>0)) and ((d["E"]==0 and d["W"]==0) or (d["E"]>0 and d["W"]>0)):
print "Yes"
else: print "No" | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,849 |
s968454679 | p04019 | u116275728 | 1474595402 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 141 | S = input()
if (S.count('N') > 0) == (S.count('S') > 0) and (S.count('E') > 0) == (S.count('W') > 0):
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,850 |
s923419323 | p04019 | u612721349 | 1473307918 | Python | Python (3.4.3) | py | Accepted | 59 | 3828 | 189 | from collections import Counter
c = Counter(input())
print("Yes" if ((c["N"] > 0 and c["S"] > 0) or c["N"] == c["S"]) \
and ((c["E"] > 0 and c["W"] > 0) or c["E"] == c["W"]) else "No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,851 |
s507424469 | p04019 | u091855288 | 1472951651 | Python | Python (2.7.6) | py | Accepted | 28 | 2568 | 281 | S = raw_input()
S = list(S)
S = set(S)
flagSN = False
flagEW = False
if ('N' in S and 'S' in S) or ('N' not in S and 'S' not in S):
flagSN = True
if ('W' in S and 'E' in S) or ('W' not in S and 'E' not in S):
flagEW = True
if flagSN and flagEW:
print 'Yes'
else:
print 'No' | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,852 |
s096189789 | p04019 | u411544692 | 1472868694 | Python | Python (2.7.6) | py | Accepted | 25 | 2568 | 198 | S = raw_input()
n = 0
s = 0
e = 0
w = 0
if 'N' in S:
n = 1
if 'S' in S:
s = 1
if 'E' in S:
e = 1
if 'W' in S:
w = 1
ns = (n+s)%2
ew = (e+w)%2
print 'Yes' if ns+ew == 0 else 'No'
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,853 |
s115636441 | p04019 | u866746776 | 1472806312 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 235 | n = w = s = e = 0
for c in input():
if c == "N":
n += 1
if c == "W":
w += 1
if c == "S":
s += 1
if c == "E":
e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,854 |
s981714797 | p04019 | u556160473 | 1472341066 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 288 | str = input()
flg = [False]*4
for s in str:
if s == 'N':
flg[0] = True
elif s == 'S':
flg[1] = True
elif s == 'E':
flg[2] = True
elif s == 'W':
flg[3] = True
if flg[0] == flg[1] and flg[2] == flg[3]:
print('Yes')
else:
print('No') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,855 |
s620497149 | p04019 | u886545507 | 1472239643 | Python | Python (2.7.6) | py | Accepted | 30 | 2568 | 286 | #AGC003A
s=raw_input()
l=[s[i] for i in xrange(len(s))]
if l.count('N')==0 and l.count('S')>0:
print "No"
elif l.count('N')>0 and l.count('S')==0:
print "No"
elif l.count('E')==0 and l.count('W')>0:
print "No"
elif l.count('E')>0 and l.count('W')==0:
print "No"
else:
print "Yes"
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,856 |
s561763937 | p04019 | u713368238 | 1472140239 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 330 | s = list(input())
for i in s:
if i == 'E' and 'W' not in s:
print('No')
break
elif i == 'W' and 'E' not in s:
print('No')
break
elif i == 'S' and 'N' not in s:
print('No')
break
elif i == 'N' and 'S' not in s:
print('No')
break
else:
pr... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,857 |
s763647105 | p04019 | u830390742 | 1471961362 | Python | Python (2.7.6) | py | Accepted | 27 | 2568 | 96 | s = raw_input()
print 'No' if (('N' in s) ^ ('S' in s)) or (('W' in s) ^ ('E' in s)) else 'Yes'
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,858 |
s113693122 | p04019 | u557523358 | 1471916541 | Python | Python (3.4.3) | py | Accepted | 40 | 3064 | 89 | s = input()
f = lambda c: c in s
print('No' if f('N')^f('S') or f('E')^f('W') else 'Yes') | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,859 |
s973698436 | p04019 | u916127336 | 1471885285 | Python | Python (2.7.6) | py | Accepted | 27 | 2572 | 365 | str = raw_input()
countN = str.count("N")
countS = str.count("S")
firstPair = False
if (countN == countS) or (countN * countS != 0):
firstPair = True
countE = str.count("E")
countW = str.count("W")
secondPair = False
if (countE == countW) or (countE * countW != 0):
secondPair = True
if (firstPair * secondPair... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,860 |
s720881482 | p04019 | u591287669 | 1471884549 | Python | Python (3.4.3) | py | Accepted | 44 | 3064 | 117 | s=set(list(input()))
if s=={'N','S'} or s=={'E','W'} or s=={'N','E','W','S'}:
print('Yes')
else:
print('No')
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,861 |
s605528321 | p04019 | u077080573 | 1471837188 | Python | Python (3.4.3) | py | Accepted | 43 | 3064 | 104 | s = list(input())
N,E,W,S = "N" in s,"E" in s,"W" in s,"S" in s
print("Yes" if N==S and E==W else "No")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,862 |
s823072956 | p04019 | u620944332 | 1471834997 | Python | Python (3.4.3) | py | Accepted | 41 | 3064 | 424 | # -*- coding: utf-8 -*-
if __name__ == '__main__':
clist = list(input())
chars = ['N', 'W', 'S', 'E']
a = []
for c in chars:
a.append(clist.count(c))
for i in [0, 1]:
if (a[i] > 0):
if (a[i + 2] == 0):
print('No')
exit()
if (a[i + 2... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,863 |
s579935447 | p04019 | u077080573 | 1471832031 | Python | Python (3.4.3) | py | Accepted | 42 | 3064 | 348 | s = list(input())
flag_N,flag_E,flag_W,flag_S = 0,0,0,0
if "N" in s:
flag_N = 1
if "E" in s:
flag_E = 1
if "W" in s:
flag_W = 1
if "S" in s:
flag_S = 1
if ((flag_N == 1 and flag_S == 0) or (flag_N == 0 and flag_S == 1)
or (flag_E == 1 and flag_W ==0) or (flag_E == 0 and flag_W == 1)):
print("... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,864 |
s326455264 | p04019 | u226155577 | 1471831913 | Python | Python (2.7.6) | py | Accepted | 28 | 2568 | 87 | s = raw_input()
i=lambda c:c in s
print "No"*((i('N')^i('S'))or(i('W')^i('E')))or"Yes"
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,865 |
s141128569 | p04019 | u756132450 | 1471831025 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 263 | temp = input()
s = temp.count("S")
n = temp.count("N")
e = temp.count("E")
w = temp.count("W")
if (s == n):
if (e>=1 & w >= 1):
print ("Yes")
else:
print ("No")
elif (e == w):
if (s >= 1 & n >= 1):
print ("Yes")
else:
print ("No")
else:
print ("No") | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,866 |
s578393127 | p04019 | u159043787 | 1471830773 | Python | Python (2.7.6) | py | Accepted | 29 | 2692 | 460 | IN = list(raw_input())
N = 0
S = 0
E = 0
W = 0
for i in range(len(IN)):
if IN[i] == 'N':
N += 1
elif IN[i] == 'S':
S += 1
elif IN[i] == 'E':
E += 1
elif IN[i] == 'W':
W += 1
if (N>0 and S>0):
if (E==0 and W==0)or(E>0 and W>0):
print 'Yes'
else:
p... | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,867 |
s548091709 | p04019 | u638629468 | 1471830291 | Python | Python (2.7.6) | py | Accepted | 28 | 2568 | 272 | import sys
line = sys.stdin.readline().strip()
n = "N" in line
s = "S" in line
e = "E" in line
w = "W" in line
if not (n or s) and (e and w):
print "Yes"
elif (n and s) and not (e or w):
print "Yes"
elif n and s and e and w:
print "Yes"
else:
print "No"
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,868 |
s592064922 | p04019 | u478015420 | 1471829894 | Python | Python (2.7.6) | py | Accepted | 27 | 2568 | 221 | if __file__.startswith('/tmp/'):
import sys; sys.stdin = open('input.txt')
ctr = [0] * 4
for c in raw_input().strip():
ctr['NSWE'.index(c)] = 1
if ctr[0] == ctr[1] and ctr[2] == ctr[3]:
print 'Yes'
else:
print 'No' | p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,869 |
s551565117 | p04019 | u425351967 | 1471829662 | Python | Python (3.4.3) | py | Accepted | 39 | 3064 | 294 | S0=input()
N=E=W=S=False
for i in range(len(S0)):
if S0[i]=='N':
N=True
elif S0[i]=='E':
E=True
elif S0[i]=='W':
W=True
else:
S=True
if ((N and S) or (not N and not S)) and ((E and W)or(not E and not W)):
print ("Yes")
else:
print("No")
| p04019 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives on an infinite two-dimensional plane. He is going on an <var>N</var>-day trip.
At the beginning of Day <var>1</var>, he is at home. His plan is described in a string <var>S</var> of length <... | SENW
| Yes
| 1,200,870 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.