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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s936864950 | p04019 | u537782349 | 1563987694 | Python | Python (3.4.3) | py | Accepted | 19 | 3064 | 291 | a = input()
b = [False] * 4
for i in range(len(a)):
if a[i] == "N":
b[0] = True
elif a[i] == "E":
b[1] = True
elif a[i] == "S":
b[2] = True
elif a[i] == "W":
b[3] = True
if b[0] == b[2] and b[1] == b[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,571 |
s960590186 | p04019 | u077291787 | 1563986886 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 213 | # AGC003A - Wanna go back home
def main():
S = input().rstrip()
flg = (("N" in S) ^ ("S" in S) ^ 1) & (("E" in S) ^ ("W" in S) ^ 1)
print("Yes" if flg else "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,572 |
s641344347 | p04019 | u077291787 | 1563986455 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 396 | # AGC003A - Wanna go back home
from collections import Counter
def main():
D = Counter(input().rstrip())
flg = True
if (
(D["N"] != 0 and D["S"] == 0)
or (D["N"] == 0 and D["S"] != 0)
or (D["E"] != 0 and D["W"] == 0)
or (D["E"] == 0 and D["W"] != 0)
):
flg = Fal... | 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,573 |
s477649716 | p04019 | u077291787 | 1563986177 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 437 | # AGC003A - Wanna go back home
def main():
S = input().rstrip()
D = {"N": 0, "S": 0, "E": 0, "W": 0}
for i in S:
D[i] += 1
flg = [True] * 2
if (D["N"] != 0 and D["S"] == 0) or (D["N"] == 0 and D["S"] != 0):
flg[0] = False
if (D["E"] != 0 and D["W"] == 0) or (D["E"] == 0 and... | 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,574 |
s885155056 | p04019 | u623659526 | 1563747567 | Python | Python (3.4.3) | py | Accepted | 33 | 4328 | 362 | import logging
logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)
def main():
trip = input()
logging.info("Hello!")
if (not (("S" in trip) ^ ("N" in trip))) and (not (("E" in trip) ^ ("W" in trip))):
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,575 |
s917092721 | p04019 | u889344512 | 1563697714 | Python | Python (3.4.3) | py | Accepted | 20 | 3060 | 192 | s = str(input())
N = s.count("N")
S = s.count("S")
W = s.count("W")
E = s.count("E")
if (max(N,S)>0 and min(N,S) == 0) or (max(W,E)>0 and min(W,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,576 |
s679590997 | p04019 | u970449052 | 1563424271 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 248 | s=input()
if 'N' in s and not'S' in s:
print('No')
exit()
if not 'N' in s and 'S' in s:
print('No')
exit()
if 'W' in s and not'E' in s:
print('No')
exit()
if not 'W' in s and 'E' in s:
print('No')
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,577 |
s326109559 | p04019 | u537782349 | 1563325718 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 278 | a = [False]*4
b = list(input())
for i in range(len(b)):
if b[i] == "N":
a[0] = True
elif b[i] == "W":
a[1] = True
elif b[i] == "S":
a[2] = True
elif b[i] == "E":
a[3] = True
print("Yes" if a[0] == a[2] and a[1] == a[3] 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,578 |
s155694725 | p04019 | u677523557 | 1563205070 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 336 | S = input()
no = False
so = False
ea = False
we = False
for s in S:
if s == 'N':
no = True
elif s == 'S':
so = True
elif s == 'E':
ea = True
elif s == 'W':
we = True
if ((no and so) or (not no and not so)) and ((ea and we) or (not ea and not we)):
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,579 |
s208509391 | p04019 | u291766461 | 1563141602 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 348 | def check(d1, d2, direction):
if d1 in direction and not d2 in direction:
return False
if d2 in direction and not d1 in direction:
return False
return True
S = input()
direction = {s for s in S}
for (x, y) in [("N", "S"), ("W", "E")]:
if not check(x, y, direction):
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,580 |
s880050493 | p04019 | u480138356 | 1563139019 | Python | Python (3.4.3) | py | Accepted | 19 | 3188 | 540 | S = list(input())
tmp = "NWSE"
n = False
w = False
s = False
e = False
for i in range(len(S)):
if S[i] == "W":
w = True
elif S[i] == "N":
n = True
elif S[i] == "E":
e = True
else:
s = True
if w and e:
if n:
if 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,581 |
s420215050 | p04019 | u623349537 | 1563123834 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 174 | S = input()
if ("N" in S and "S" not in S) or ("S" in S and "N" not in S) or("W" in S and "E" not in S) or ("E" in S and "W" not 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,582 |
s467786291 | p04019 | u123824541 | 1562983906 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 272 | S = input()
ans_NS = 0
ans_EW = 0
if S.count('S') >= 1:
ans_NS += 1
if S.count('N') >= 1:
ans_NS += 1
if S.count('E') >= 1:
ans_EW += 1
if S.count('W') >= 1:
ans_EW += 1
if ans_EW != 1:
if ans_NS != 1:
print('Yes')
exit()
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,583 |
s656873668 | p04019 | u671252250 | 1562956167 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 222 | # coding: utf-8
# Your code here!
s = set(input())
if (('N' in s and 'S' in s) or not('N' in s) and not('S' in s)) and (('E' in s and 'W' in s) or not('E' in s) and not('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,584 |
s678028726 | p04019 | u170324846 | 1562865580 | Python | Python (3.4.3) | py | Accepted | 18 | 3060 | 168 | def NS(S):
return ("N" in S) ^ ("S" in S)
def EW(S):
return ("E" in S) ^ ("W" in S)
S = input()
if not(NS(S)) and not(EW(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,585 |
s969215888 | p04019 | u473291366 | 1562777295 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 209 | S = input()
dict = {
"N": False,
"E": False,
"W": False,
"S": False
}
for s in S:
dict[s] = True
if dict["N"] != dict["S"] or dict["E"] != dict["W"]:
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,586 |
s199735327 | p04019 | u035605655 | 1562722066 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 284 | S = input()
S = list(S)
flag = True
if ('N' in S and 'S' not in S):
flag = False;
if ('S' in S and 'N' not in S):
flag = False
if ('E' in S and 'W' not in S):
flag = False
if ('W' in S and 'E' not in S):
flag = False
if flag:
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,587 |
s458463243 | p04019 | u222138979 | 1562694718 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 517 | #AGC003
s = input()
dicti = {'N':0, 'S':0, 'W':0, 'E':0}
for letter in s:
dicti[letter] += 1
if dicti['N'] > 0 and dicti['S'] > 0:
if dicti['W'] > 0 and dicti['E'] > 0:
print('Yes')
elif dicti['W'] == 0 and dicti['E'] == 0:
print('Yes')
else:
print('No')
elif dicti['W'] > 0 and ... | 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,588 |
s047456951 | p04019 | u144980750 | 1562684391 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 274 | s=input()
ans=[0,0]
n=0
S=0
w=0
e=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
elif s[i]=="E":
e=1
print("Yes" if n*S==1 and (w+e==2 or w+e==0) or w*e==1 and (n+S==2 or n+S==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,589 |
s262609055 | p04019 | u239342230 | 1562649783 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 130 | S=input()
if (S.count('N')>0) == (S.count('S')>0) and (S.count('W')>0) == (S.count('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,590 |
s126853389 | p04019 | u539517139 | 1562590896 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 176 | s=input()
x='Yes'
if 'N' in s:
if 'S' not in s:
x='No'
else:
if 'S' in s:
x='No'
if 'E' in s:
if 'W' not in s:
x='No'
else:
if 'W' in s:
x='No'
print(x) | 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,591 |
s140961676 | p04019 | u116670634 | 1562477072 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 200 | s = input()
f1 = ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s)
f2 = ('W' in s and 'E' in s) or ('W' not in s and 'E' not in s)
f3 = f1 and f2
if f3:
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,592 |
s814675325 | p04019 | u223646582 | 1562455278 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 213 | S = set(input())
if len(S) == 4:
print('Yes')
elif len(S) == 3 or len(S) == 1:
print('No')
else: # len(S)==2
if 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,593 |
s628511575 | p04019 | u778814286 | 1562426052 | Python | Python (3.4.3) | py | Accepted | 24 | 3824 | 1,036 | ###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
fro... | 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,594 |
s085084627 | p04019 | u691018832 | 1562294677 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 295 | import sys
input = sys.stdin.readline
s = input()
cnt = 0
if 'N' in s and 'S' in s:
cnt += 1
elif 'N' not in s and 'S' not in s:
cnt += 1
if 'W' in s and 'E' in s:
cnt += 1
elif 'W' not in s and 'E' not in s:
cnt += 1
if cnt == 2:
ans = 'Yes'
else:
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,595 |
s967824066 | p04019 | u665038048 | 1562287134 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 564 | from collections import Counter
s = list(input())
s_cnt = Counter(s)
s_cnt_keys = list(s_cnt.keys())
if len(s_cnt.keys()) == 4:
print('Yes')
exit()
elif len(s_cnt.keys()) == 2:
if s_cnt_keys[0] == 'S' and s_cnt_keys[1] == 'N':
print('Yes')
exit()
elif s_cnt_keys[0] == 'N' and s_cnt_key... | 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,596 |
s809388132 | p04019 | u693953100 | 1562200387 | Python | Python (3.4.3) | py | Accepted | 20 | 3060 | 232 | s = input()
N = s.count('N')
S = s.count('S')
W = s.count('W')
E = s.count('E')
if N==0 and S:
print('No')
elif S==0 and N:
print('No')
elif E==0 and W:
print('No')
elif W==0 and E:
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,597 |
s103724796 | p04019 | u970308980 | 1561932728 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 248 | s = input().rstrip()
N = s.count('N')
W = s.count('W')
S = s.count('S')
E = s.count('E')
if (N > 0 and S == 0) or (N == 0 and S > 0):
print('No')
exit()
if (W > 0 and E== 0) or (W == 0 and E > 0):
print('No')
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,598 |
s577469063 | p04019 | u504562455 | 1561777593 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 291 | s = input()
flag = True
if "N" in s:
if "S" not in s:
flag = False
if "S" in s:
if "N" not in s:
flag = False
if "E" in s:
if "W" not in s:
flag = False
if "W" in s:
if "E" not in s:
flag = False
if flag:
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,599 |
s207455373 | p04019 | u977193988 | 1561749273 | Python | Python (3.4.3) | py | Accepted | 18 | 3060 | 202 | s=list(input())
w=['N','W','S','E']
q=[]
for i in range(4):
if s.count(w[i])>0:
q.append(1)
else:
q.append(0)
if q[0]==q[2] and q[1]==q[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,600 |
s014173531 | p04019 | u702582248 | 1561602561 | Python | Python (3.4.3) | py | Accepted | 35 | 5076 | 483 | from fractions import gcd
import math
def inverse(a):
return pow(a, mod - 2, mod)
def usearch(x, a):
lft = 0
rgt = len(a) + 1
while rgt - lft > 1:
mid = (rgt + lft) // 2
if a[mid] <= x:
lft = mid
else:
rgt = mid
return lft
def main():
s = inpu... | 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,601 |
s598108777 | p04019 | u222207357 | 1561570628 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 317 | S = input()
direct = 'NWSE'
cnt = {}
ans = "Yes"
for ch in direct:
cnt[ch] = S.count(ch)
if cnt['N'] == 0 and cnt['S'] != 0:
ans = "No"
elif cnt['N'] != 0 and cnt['S'] == 0:
ans = 'No'
elif cnt['E'] != 0 and cnt['W'] == 0:
ans = 'No'
elif cnt['E'] == 0 and cnt['W'] != 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,602 |
s088177967 | p04019 | u026155812 | 1561539865 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 323 | import sys
S = set(input())
ls = ['N','W','S','E']
if ls[0] in S and not ls[2] in S:
print('No')
sys.exit()
if ls[1] in S and not ls[3] in S:
print('No')
sys.exit()
if ls[2] in S and not ls[0] in S:
print('No')
sys.exit()
if ls[3] in S and not ls[1] in S:
print('No')
sys.exit()
print('Ye... | 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,603 |
s477662026 | p04019 | u167681750 | 1561512757 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 92 | s = set(input())
print("Yes" if ("N" in s)==("S" in s) and ("E" in s)==("W" 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,604 |
s046128796 | p04019 | u497046426 | 1561238381 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 246 | S = input()
if (S.count('N') > 0 and S.count('S') == 0) or (S.count('S') > 0 and S.count('N') == 0):
print('No')
elif (S.count('E') > 0 and S.count('W') == 0) or (S.count('W') > 0 and S.count('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,605 |
s395272018 | p04019 | u500297289 | 1561235350 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 306 | S = input()
if 'N' in S:
if 'S' not in S:
print('No')
exit()
if 'S' in S:
if 'N' not in S:
print('No')
exit()
if 'W' in S:
if 'E' not in S:
print('No')
exit()
if 'E' in S:
if 'W' not in S:
print('No')
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,606 |
s016181328 | p04019 | u905268546 | 1561128840 | Python | Python (3.4.3) | py | Accepted | 20 | 2940 | 122 | s = input()
N = "N" in s
W = "W" in s
S = "S" in s
E = "E" in s
if N ^ S or W ^ E:
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,607 |
s390991888 | p04019 | u820047642 | 1561002701 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 200 | Plan=input()
N,W,S,E=Plan.count("N"),Plan.count("W"),Plan.count("S"),Plan.count("E")
if (N==0 and S>=1) or (N>=1 and S==0) or (W==0 and E>=1) 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,608 |
s478677062 | p04019 | u102461423 | 1560794998 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 99 | se = set(input())
print('Yes' if se == set('WE') or se == set('NS') or se == set('WENS') 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,609 |
s651500870 | p04019 | u957872856 | 1560657023 | Python | Python (3.4.3) | py | Accepted | 17 | 3192 | 387 | s = list(input())
n = [None]*2
if "S" in s and "N" in s:
n[0] = 1
elif "S" in s and "N" not in s:
n[0] = 0
elif "S" not in s and "N" in s:
n[0] = 0
if "W" in s and "E" in s:
n[1] = 1
elif "W" in s and "E" not in s:
n[1] = 0
elif "W" not in s and "E" in s:
n[1] = 0
if n.count(1)==2:
print("Yes")
elif 0 in ... | 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,610 |
s282716472 | p04019 | u268516119 | 1560630360 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 95 | S=input()
print("NYoe s"[
(("N" in S) == ("S" in S))and(("E" in S) == ("W" in S))
::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,611 |
s418423620 | p04019 | u867736259 | 1560576447 | Python | Python (3.4.3) | py | Accepted | 20 | 3064 | 347 | a = input()
n,f = 0,1
if 'N' in a:
if 'S' in a:
n = 1
else:
f = 0
if 'W' in a:
if 'E' in a:
n = 1
else:
f = 0
if 'S' in a:
if 'N' in a:
n = 1
else:
f = 0
if 'E' in a:
if 'W' in a:
n = 1
else:
f = 0
if (n*f) == 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,612 |
s149958424 | p04019 | u223904637 | 1560563438 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 175 | s=list(input())
l=[0]*4
if "N" in s:
l[0]=1
if "S" in s:
l[1]=-1
if "E" in s:
l[2]=2
if "W" in s:
l[3]=-2
if sum(l)==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,613 |
s145369799 | p04019 | u717001163 | 1560434398 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 188 | s=input()
f=True
if 'W' in s and not 'E' in s:f=False
if 'E' in s and not 'W' in s:f=False
if 'N' in s and not 'S' in s:f=False
if 'S' in s and not 'N' in s:f=False
print(["No","Yes"][f]) | 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,614 |
s631898662 | p04019 | u538632589 | 1560109065 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 254 | S = input()
d_set = set()
for s in S:
d_set.add(s)
if ("N" in d_set and "S" not in d_set) or ("S" in d_set and "N" not in d_set) or ("E" in d_set and "W" not in d_set) or ("W" in d_set and "E" not in d_set):
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,615 |
s440357592 | p04019 | u315703650 | 1560060507 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 227 | s = input()
if (s.count("N")>0 and s.count("S")==0)\
or (s.count("S")>0 and s.count("N")==0)\
or (s.count("W")>0 and s.count("E")==0)\
or (s.count("E")>0 and s.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,616 |
s413577259 | p04019 | u682730715 | 1560052716 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 286 | s = list(input())
N = 0
W = 0
S = 0
E = 0
for i in s:
if i == 'N':
N = 1
if i == 'W':
W = 1
if i == 'S':
S = 1
if i == 'E':
E = 1
if ((N == 0 and S == 0) or (N == 1 and S == 1)) and ((W == 0 and E == 0) or (W == 1 and E == 1)):
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,617 |
s729803402 | p04019 | u405256066 | 1559978655 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 212 | from sys import stdin
S = set(list(stdin.readline().rstrip()))
if len(S) % 2 != 0:
print("No")
elif S == {"N","S"} or S == {"W","E"}:
print("Yes")
elif len(S) == 4:
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,618 |
s210803309 | p04019 | u502389123 | 1559186870 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 353 | s = input()
if 'E' in s and 'W' in s:
if 'N' in s and 'S' in s:
print('Yes')
elif 'N' in s or 'S' in s:
print('No')
else:
print('Yes')
elif 'E' in s or 'W' in s:
print('No')
else:
if 'N' in s and 'S' in s:
print('Yes')
elif 'N' in s or 'S' in s:
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,619 |
s571510113 | p04019 | u373111370 | 1559032591 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 378 | a = str(input())
n = 0
w = 0
e = 0
s = 0
for i in a:
if i == "N":
n += 1
elif i == "W":
w += 1
elif i == "E":
e += 1
elif i == "S":
s += 1
ans = True
if (n == 0 and s != 0) or (n != 0 and s == 0):
ans = False
if (e == 0 and w != 0) or (e != 0 and w == 0):
ans = Fa... | 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,620 |
s268222026 | p04019 | u388415336 | 1559027307 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 350 | path = list(input())
if ('N' in path) is True:
north = 1
else:
north = 0
if ('S' in path) is True:
south = -1
else:
south = 0
if ('E' in path) is True:
east = 1
else:
east = 0
if ('W' in path) is True:
west = -1
else:
west = 0
if ((north + south) == 0) and ((east + west) == 0):
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,621 |
s886838479 | p04019 | u767664985 | 1558953602 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 182 | S = set(input())
if len(S) == 4:
print("Yes")
elif len(S) == 2 and "N" in S and "S" in S:
print("Yes")
elif len(S) == 2 and "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,622 |
s587788742 | p04019 | u623687794 | 1558655818 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 269 | s=input()
a =["N","S","W","E"]
flag1=0
flag2=0
if a[0] in s and a[1] in s:
flag1=1
if a[0] not in s and a[1] not in s:
flag1=1
if a[2] in s and a[3] in s:
flag2=1
if a[2] not in s and a[3] not in s:
flag2=1
if flag1+flag2==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,623 |
s867420788 | p04019 | u764600134 | 1558582808 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 444 | # -*- coding: utf-8 -*-
"""
A - Wanna go back home
https://atcoder.jp/contests/agc003/tasks/agc003_a
"""
import sys
def solve(S):
if ('N' in S and 'S' not in S) or ('S' in S and 'N' not in S):
return 'No'
if ('E' in S and 'W' not in S) or ('W' in S and 'E' not in S):
return 'No'
return 'Y... | 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,624 |
s780950304 | p04019 | u885899351 | 1558551490 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 154 | s=input()
f=0
if "S" in s and "N" in s:pass
elif "S" in s or "N" in s:f=1
if "W" in s and "E" in s:pass
elif "W" in s or "E" in s:f=1
print("YNeos"[f::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,625 |
s676528858 | p04019 | u923712635 | 1558489922 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 132 | S = input()
x = not (('S' in S)^('N' in S))
y = not (('E' in S)^('W' in S))
if(x and y):
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,626 |
s742376573 | p04019 | u865741247 | 1558478386 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 220 | S = input()
n = S.count("N")
s = S.count("S")
w = S.count("W")
e = S.count("E")
ans = "Yes"
if n * s ==0:
if n != 0 or s != 0:
ans = "No"
if w * e ==0:
if w != 0 or e != 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,627 |
s552367962 | p04019 | u532966492 | 1558398981 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 192 | seq=input()
N=seq.count("N")
S=seq.count("S")
E=seq.count("E")
W=seq.count("W")
if (N>0 and S==0) or (N==0 and S>0) or (E>0 and W==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,628 |
s863222018 | p04019 | u064246852 | 1558244607 | Python | Python (3.4.3) | py | Accepted | 21 | 3316 | 326 | s = input()
from collections import defaultdict
d = defaultdict(bool)
def inv(c):
dic = {"W":"E", "E":"W", "S":"N", "N":"S"}
return dic[c]
for c in s:
d[c] = True
def sol():
for c in "NSWE":
if d[c] == True and d[inv(c)] == False:
return False
return True
print("YNeos"[not sol():... | 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,629 |
s555316235 | p04019 | u614314290 | 1558231088 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 222 | S = input()
lm = {"N":0, "W":0, "S":0, "E":0}
for s in S:
lm[s] += 1
n, w, s, e = lm["N"], lm["W"], lm["S"], lm["E"]
print(["Yes", "No"][not((n == s == 0 or (0 < n and 0 < s)) and (w == e == 0 or (0 < w and 0 < e)))])
| 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,630 |
s306004809 | p04019 | u278886389 | 1558117546 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 83 | c = list(input())
print(['Yes','No'][('N' in c)^('S' in c)or('E' in c)^('W' in 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,631 |
s380528010 | p04019 | u077019541 | 1558103702 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 224 | S = input()
if "N" in S and "S" not in S:
print("No")
elif "W" in S and "E" not in S:
print("No")
elif "E" in S and "W" not in S:
print("No")
elif "S" in S and "N" not 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,632 |
s125503924 | p04019 | u606045429 | 1557984936 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 113 | S = input()
if any(set(S) == s for s in map(set, ["NS", "EW", "NSEW"])):
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,633 |
s383582220 | p04019 | u091051505 | 1557193102 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 292 | s = input()
s_num = s.count("S")
e_num = s.count("E")
n_num = s.count("N")
w_num = s.count("W")
c = 0
if ((s_num > 0) & (n_num > 0)) | (s_num + n_num == 0):
c += 1
if ((e_num > 0) & (w_num > 0)) | (e_num + w_num == 0):
c += 1
if c == 2:
ans = "Yes"
else:
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,634 |
s373662111 | p04019 | u969190727 | 1557085769 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 156 | S=set(input())
s=len(S)
if s==4:
print("Yes")
elif s==2:
if S=={'E', 'W'} or S=={'N', '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,635 |
s858223182 | p04019 | u017271745 | 1557016375 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 216 | S = input()
n = S.count('N')
w = S.count('W')
s = S.count('S')
e = S.count('E')
ans = 'Yes'
if n > 0 and s == 0 or n == 0 and s > 0:
ans = 'No'
if w > 0 and e == 0 or w == 0 and e > 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,636 |
s493265073 | p04019 | u949414593 | 1556909764 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 82 | s=''.join(sorted(set(input())))
print(['No','Yes'][s=='NS'or s=='EW'or s=='ENSW']) | 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,637 |
s463407288 | p04019 | u282228874 | 1556808669 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 194 | S = set(list(input()))
if ('S' in S and 'N' not in S) or ('N' in S and 'S' not in S) or ('W' in S and 'E' not in S)or ('E' in S and 'W' not 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,638 |
s905862157 | p04019 | u282228874 | 1556808600 | Python | Python (3.4.3) | py | Accepted | 18 | 3060 | 187 | S = input()
w = S.count('W')
e = S.count('E')
n = S.count('N')
s = S.count('S')
if (w and not e) or (e and not w) or (n and not s) or (s and not n):
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,639 |
s333990837 | p04019 | u756388720 | 1556550880 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 205 | S = input()
if 'N' in S and 'S' not in S: print('No')
elif 'S' in S and 'N' not in S: print('No')
elif 'W' in S and 'E' not in S: print('No')
elif 'E' in S and 'W' not 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,640 |
s076095074 | p04019 | u710789518 | 1556456530 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 130 | S = input()
s = list(set(S))
if s.count('S') == s.count('N') and s.count('E') == s.count('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,641 |
s060049364 | p04019 | u223133214 | 1555795652 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 354 | import sys
input = sys.stdin.readline
SS = list(input())
if 'N' in SS:
if not 'S' in SS:
print('No')
exit()
if 'S' in SS:
if not 'N' in SS:
print('No')
exit()
if 'W' in SS:
if not 'E' in SS:
print('No')
exit()
if 'E' in SS:
if not 'W' in SS:
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,642 |
s322150309 | p04019 | u163320134 | 1555631346 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 362 | s=input()
ans=[0]*4
check='NWSE'
for i in range(len(s)):
for j in range(len(check)):
if s[i]==check[j]:
ans[j]+=1
if ans[0]!=0 and ans[2]!=0 and ans[1]!=0 and ans[3]!=0:
print('Yes')
elif ans[0]!=0 and ans[2]!=0 and ans[1]==0 and ans[3]==0:
print('Yes')
elif ans[0]==0 and ans[2]==0 and ans[1]!=0 and 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,643 |
s972326355 | p04019 | u608088992 | 1555105868 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 165 | S = set(list(input()))
if len(S) == 4: print("Yes")
elif len(S) == 2:
if S == {"N", "S"} or S == {"E", "W"}: 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,644 |
s444333489 | p04019 | u143509139 | 1554862943 | Python | Python (3.4.3) | py | Accepted | 18 | 3064 | 205 | S=input()
n=S.count('N')
s=S.count('S')
e=S.count('E')
w=S.count('W')
if (n >= 1 and s >= 1) or (n == 0 and s == 0):
if (e >= 1 and w >= 1) or (e == 0 and w == 0):
print('Yes')
exit()
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,645 |
s683968974 | p04019 | u802772880 | 1554686021 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 181 | s=input()
ans='No'
y='Yes'
if ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s):
if ('E' in s and 'W' in s) or ('E' not in s and 'W' not in s):
ans=y
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,646 |
s116124410 | p04019 | u151625340 | 1554655754 | Python | Python (3.4.3) | py | Accepted | 21 | 3188 | 415 | S = input()
N = len(S)
d = [0,0,0,0]
s = ['N','W','S','E']
for i in range(N):
for j in range(4):
if S[i] == s[j]:
d[j] += 1
break
flag = True
if (d[0] == 0 and d[2] == 0) or (d[0] != 0 and d[2] != 0):
pass
else:
flag = False
if (d[1] == 0 and d[3] == 0) or (d[1] != 0 and d[3... | 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,647 |
s227641402 | p04019 | u071730284 | 1554643339 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 143 | S = input()
s = set(S[:])
ans = s == set(["N", "W", "S", "E"]) or s == set(["N", "S"]) or s == set(["W", "E"])
print("Yes" if ans 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,648 |
s530015726 | p04019 | u518064858 | 1554597875 | Python | Python (3.4.3) | py | Accepted | 38 | 3060 | 310 | s=set(list(input()))
if "S" in s:
if not "N" in s:
print("No")
exit()
if "N" in s:
if not "S" in s:
print("No")
exit()
if "E" in s:
if not "W" in s:
print("No")
exit()
if "W" in s:
if not "E" in s:
print("No")
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,649 |
s509119256 | p04019 | u859897687 | 1554553601 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 188 | a=input()
ans="Yes"
if "W"in a and"E"not in a:
ans="No"
elif "E"in a and"W"not in a:
ans="No"
elif "N"in a and"S"not in a:
ans="No"
elif "S"in a and"N"not in a:
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,650 |
s237539779 | p04019 | u643840641 | 1554427061 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 116 | s = list(set(list(input())))
print("Yes" if s.count('N') == s.count('S') and s.count('E') == s.count('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,651 |
s765735009 | p04019 | u426108351 | 1554161088 | Python | Python (3.4.3) | py | Accepted | 18 | 3188 | 378 | S = input()
flag = 1
if S.count("W") == 0 and S.count("E") == 0:
if S.count("N") == 0 or S.count("S") == 0:
flag = 0
else:
flag = 1
elif S.count("W") == 0 or S.count("E") == 0:
flag = 0
elif S.count("N") == 0 and S.count("S") == 0:
flag = 1
elif S.count("N") == 0 or S.count("S") == 0:
flag = 0
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,652 |
s929474779 | p04019 | u363610900 | 1554097707 | Python | Python (3.4.3) | py | Accepted | 20 | 3060 | 236 | # -*- coding: utf-8 -*-
s = set(input())
ans = 0
for i in s:
if 'N' in i:
ans += 1
elif 'W' in i:
ans += -2
elif 'S' in i:
ans += -1
else:
ans += 2
print('Yes' if ans == 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,653 |
s937337510 | p04019 | u363610900 | 1554097317 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 130 | # -*- coding: utf-8 -*-
s=set(input())
if s in [{'W','E'},{'N','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,654 |
s326026709 | p04019 | u751488284 | 1554083368 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 123 | s = input()
N = 'N' in s
S = 'S' in s
E = 'E' in s
W = 'W' in s
if N ^ S or E ^ W:
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,655 |
s373300712 | p04019 | u591510335 | 1553866112 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 135 | s = input()
print('No' if len([x for x in [[s.count('N'), s.count('S')], [s.count('W'), s.count('E')]] if x.count(0) == 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,656 |
s940178954 | p04019 | u227082700 | 1553833133 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 113 | s=input();ans=0
if"N"in s:ans+=1
if"S"in s:ans-=1
if"E"in s:ans+=2
if"W"in s:ans-=2
print("Yes"if ans==0else"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,657 |
s242592290 | p04019 | u379692329 | 1553325210 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 128 | S = input()
flagNS = (('N' in S) == ('S' in S))
flagEW = (('E' in S) == ('W' in S))
print("Yes" if flagNS and flagEW 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,658 |
s615016978 | p04019 | u137667583 | 1553272558 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 65 | print('NYoe s'[set(input())in map(set,['','NS','EW','NSEW'])::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,659 |
s015543608 | p04019 | u137667583 | 1553269431 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 79 | S=set(input())
print('Yes'if S in [{'N','S'},{'E','W'}]or len(S)%4==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,660 |
s758018784 | p04019 | u882620594 | 1553224827 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 285 | S = input()
if "N" in S and "S" in S:
if ("W" in S and "E" in S) or ("W" not in S and "E" not in S):
print("Yes")
else:
print("No")
elif "N" in S or "S" in S:
print("No")
else:
if "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,661 |
s945935114 | p04019 | u175034939 | 1553143480 | Python | Python (3.4.3) | py | Accepted | 17 | 3060 | 212 | s = list(set(list(input())))
s.sort()
if len(s) == 4:
print('Yes')
elif len(s) == 2:
if s[0] + s[1] == 'NS' or s[0] + s[1] == 'EW':
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,662 |
s833592224 | p04019 | u137667583 | 1553108148 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 109 | S = input()
X = ['N' in S, 'S' in S, 'W' in S, 'E' in S]
print('Yes' if X[0]==X[1] and X[2]==X[3] 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,663 |
s272124696 | p04019 | u137667583 | 1553107960 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 149 | S = input()
X = ['N' in S, 'S' in S]
Y = ['W' in S, 'E' in S]
flg = False
if X[0]==X[1] and Y[0]==Y[1]:
flg = True
print('Yes' if flg 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,664 |
s580539928 | p04019 | u782654209 | 1553051037 | Python | Python (3.4.3) | py | Accepted | 17 | 3064 | 985 | #AGC003 A 22:54 -
'''
問題
座標平面上に家がある
長さNの文字列Sがある
文字列の各文字はNWSEのいずれか
i文字目の示す方向にしたがって任意の距離だけ移動することをNターン繰り返す
うまく移動距離を決めることで,Nターン終了後にふたたび家に戻っていることができるか?
Sの長さは1以上1000以下
各ターンでの移動距離は必ず正にすること
考察
1.NとSのうち両方がSに含まれるか,またはどちらも含まれない
2.WとEのうち両方がSに含まれるか,またはどちらも含まれない
この2つが同時に満たされていればよい
1.は次の条件と同値:
S.count('N')*S.count('S')>0 or
(S.cou... | 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,665 |
s804642287 | p04019 | u280512618 | 1553004346 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 99 | s=set(input())
if s in [{'W','E'},{'N','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,666 |
s703463870 | p04019 | u619197965 | 1552859769 | Python | Python (3.4.3) | py | Accepted | 20 | 3316 | 379 | from collections import Counter
s=input()
cnt=Counter(s)
result=True
if cnt.get("N",False) or cnt.get("S",False):
if cnt.get("N",False) and cnt.get("S",False):
pass
else:
result=False
if cnt.get("E",False) or cnt.get("W",False):
if cnt.get("E",False) and cnt.get("W",False):
pass
... | 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,667 |
s665366023 | p04019 | u118642796 | 1552823965 | Python | Python (3.4.3) | py | Accepted | 17 | 2940 | 196 | T = input()
N = T.count("N")
S = T.count("S")
E = T.count("E")
W = T.count("W")
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,668 |
s713238109 | p04019 | u807772568 | 1552799416 | Python | Python (3.4.3) | py | Accepted | 20 | 3188 | 335 | n = list(input())
a = [0,0,0,0]
for i in range(len(n)):
if n[i] =="W":
a[0] += 1
elif n[i] == "E":
a[1] += 1
elif n[i] == "N":
a[2] += 1
elif n[i] == "S":
a[3] += 1
if a[0]*a[1] * a[2]*a[3] != 0 or (a[0]+a[1] == 0 and (a[2]*a[3]) != 0)or(a[2]+a[3] == 0 and (a[0]*a[1]) != 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,669 |
s910931262 | p04019 | u303059352 | 1552778061 | Python | Python (3.4.3) | py | Accepted | 18 | 2940 | 91 | s = input()
print("Yes" if ('N' in s) == ('S' in s) and ('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,670 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.