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
s087632913
p04019
u416223629
1578047905
Python
Python (3.4.3)
py
Accepted
17
3064
450
S=input() flag=[] if 'N' in S: if 'S' in S: flag.append(True) else: flag.append(False) if 'S' in S: if 'N' in S: flag.append(True) else: flag.append(False) if 'W' in S: if 'E' in S: flag.append(True) else: flag.append(False) if 'E' in S: if ...
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,471
s813347535
p04019
u079022693
1577912747
Python
Python (3.4.3)
py
Accepted
18
3064
389
S=input() Nflag=False Wflag=False Sflag=False Eflag=False if "N" in S: Nflag=True if "W" in S: Wflag=True if "S" in S: Sflag=True if "E" in S: Eflag=True if Nflag and Wflag and Sflag and Eflag: print("Yes") elif Nflag and Sflag and Wflag==False and Eflag==False: print("Yes") elif Nflag==False and 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,472
s721581016
p04019
u580697892
1577655136
Python
Python (3.4.3)
py
Accepted
17
3064
305
# coding: utf-8 S = input() l = {"E":0, "W":0, "S":0, "N":0} for i in range(len(S)): l[S[i]] += 1 f1, f2 = False, False if (l["W"] != 0 and l["E"] != 0) or l["W"] == l["E"] == 0: f1 = True if (l["N"] != 0 and l["S"] != 0) or l["N"] == l["S"] == 0: f2 = True print("Yes" if f1 and f2 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,473
s944913753
p04019
u186838327
1577437083
Python
Python (3.4.3)
py
Accepted
17
3060
130
s = set(list(str(input()))) if s == {'N', 'S', 'E', '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,474
s343213555
p04019
u102461423
1577381852
Python
Python (3.4.3)
py
Accepted
17
3060
274
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = set(read().rstrip().decode('utf-8')) answer = 'Yes' for x,y in ['EW','NS','WE','SN']: if x in S and y 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,475
s965576009
p04019
u540761833
1577376609
Python
Python (3.4.3)
py
Accepted
17
2940
118
S = input() if not (('W' in S) ^ ('E' in S)) and not (('N' in S) ^ ('S' 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,476
s208068125
p04019
u225388820
1577375444
Python
Python (3.4.3)
py
Accepted
17
3064
275
S=input() n,w,s,e=0,0,0,0 for i in range(len(S)): if S[i]=="N": n=1 elif S[i]=="W": w=1 elif S[i]=="S": s=1 else: e=1 if n*w*s*e==1 or n*s==1 and w==0 and e==0 or w*e==1 and n==0 and s==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,477
s432833348
p04019
u984276646
1577343915
Python
Python (3.4.3)
py
Accepted
17
3060
234
S = input() n, e, w, s = 0, 0, 0, 0 for i in range(len(S)): if S[i] == 'N': n = 1 elif S[i] == 'E': e = 1 elif S[i] == 'W': w = 1 elif S[i] == 'S': s = 1 if n == s and 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,478
s509932241
p04019
u994988729
1577132914
Python
Python (3.4.3)
py
Accepted
17
3060
321
def main(S): d = {x: 0 for x in "NWES"} for s in S: d[s] += 1 if d["N"] * d["S"] == 0 and d["N"] + d["S"] != 0: return "No" if d["E"] * d["W"] == 0 and d["E"] + d["W"] != 0: return "No" return "Yes" if __name__ == "__main__": S = input() ans = main(S) 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,479
s122218952
p04019
u905582793
1577034699
Python
Python (3.4.3)
py
Accepted
17
3060
214
s=input() N = s.count("N") E = s.count("E") W = s.count("W") S = s.count("S") if ((N==S==0 and E>0 and W>0) or (E==W==0 and N>0 and S>0) or (N>0 and S>0 and E>0 and 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,480
s931607310
p04019
u896741788
1576798412
Python
Python (3.4.3)
py
Accepted
17
2940
109
s=input() l=[x in s for x in list("NEWS")] if (l[-1]==l[0]) and (l[1]==l[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,481
s298736641
p04019
u709304134
1576730883
Python
Python (3.4.3)
py
Accepted
21
3316
228
#coding:utf-8 from collections import defaultdict S = input() dd = defaultdict(int) for s in S: dd[s]+=1 if ((dd['S']>0)^(dd['N']>0)): print ("No") elif((dd['E']>0)^(dd['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,482
s149622664
p04019
u598229387
1576561025
Python
Python (3.4.3)
py
Accepted
17
3064
173
s=input() N=0 S=0 E=0 W=0 for i in s: if i=="N": N=1 if i=="S": S=1 if i=="E": E=1 if i=="W": W=1 if N+S==1 or E+W==1: ans="No" else: ans="Yes" 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,483
s538773661
p04019
u591016708
1576518848
Python
Python (3.4.3)
py
Accepted
17
2940
111
S =input() if (('N' in S) == ('S' in S)) and (('W' in S) == ('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,484
s792632551
p04019
u475503988
1576275125
Python
Python (3.4.3)
py
Accepted
19
3060
157
S = input() d = {'N': 0, 'S': 0, 'W': 0, 'E': 0} for s in S: d[s] = 1 ans = "Yes" if (d['N'] ^ d['S']) or (d['W'] ^ d['E']): 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,485
s388617529
p04019
u824237520
1576261664
Python
Python (3.4.3)
py
Accepted
17
3064
202
a = list(input()) n = a.count('N') s = a.count('S') w = a.count('W') e = a.count('E') if n * s == 0 and n + s > 0: print('No') elif e * w == 0 and e + 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,486
s630385187
p04019
u815878613
1576180459
Python
Python (3.4.3)
py
Accepted
21
3316
271
from collections import Counter S = list(set(list(input()))) x = [0, 0] for s in S: if s == "E": x[0] += 1 elif s == "W": x[0] -= 1 elif s == "N": x[1] += 1 elif s == "S": x[1] -= 1 print('Yes' if x == [0, 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,487
s280217285
p04019
u183896397
1576125686
Python
Python (3.4.3)
py
Accepted
17
2940
197
s = input() if (('N' in s and 'S' not in s) or ('S' in s and 'N' not in s) or ('E' in s and 'W' not in s) or ('W' in s and 'E' 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,488
s929059746
p04019
u989345508
1575988436
Python
Python (3.4.3)
py
Accepted
17
3060
251
s=input() x=[0,0,0,0] for i in s: if i=="N": x[0]=1 elif i=="S": x[1]=1 elif i=="W": x[2]=1 else: x[3]=1 #print(x) if x==[1,1,1,1] or x==[0,0,1,1] or x==[1,1,0,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,489
s892563251
p04019
u252828980
1575638865
Python
Python (3.4.3)
py
Accepted
17
3060
205
s = input() set1 = {"W","N","S","E"} set2 = {"W","E"} set3 = {"N","S"} if set(s) == set1: print("Yes") elif set(s) == set2: print("Yes") elif set(s) == set3: 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,490
s031546889
p04019
u762420987
1575555325
Python
Python (3.4.3)
py
Accepted
17
3064
186
S = set(input()) if (("W" in S and "E" in S) or ("W" not in S and "E" not in S)) and (("S" in S and "N" in S) or ("S" not in S and "N" not 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,491
s798944760
p04019
u987164499
1575526778
Python
Python (3.4.3)
py
Accepted
17
3060
206
from sys import stdin s = stdin.readline().rstrip() s = [str(i) for i in s] s = list(set(s)) s.sort() if s == ["N","S"] or s == ["E","W"] or s == ["E","N","S","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,492
s235118225
p04019
u386819480
1575522108
Python
Python (3.4.3)
py
Accepted
17
3060
496
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10000000) INF = 1<<32 YES = "Yes" # type: str NO = "No" # type: str def solve(S: str): print(YES if (('W' in S) == ('E' in S)) and (('N' in S) == ('S' in S)) else NO) return def main(): def iterate_tokens(): for line in sys.stdin: ...
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,493
s358933431
p04019
u094191970
1575481283
Python
Python (3.4.3)
py
Accepted
20
3316
216
from collections import Counter s=input() c=Counter(s) if ((c['N']==0 and c['S']==0) or (c['N']!=0 and c['S']!=0)) and ((c['W']==0 and c['E']==0) or (c['W']!=0 and c['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,494
s912855832
p04019
u864197622
1575354957
Python
Python (3.4.3)
py
Accepted
17
2940
160
S = input() N = S.count("N") W = S.count("W") E = S.count("E") S = S.count("S") if N+S and N*S == 0 or E+W and E*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,495
s987991022
p04019
u488127128
1575152412
Python
Python (3.4.3)
py
Accepted
18
3060
310
# coding: utf-8 def main(): s = set(input()) l = len(s) if l % 2 != 0: print('No') else: if 'N' in s and 'S' in s: print('Yes') elif 'W' in s and 'E' in s: 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,496
s476679554
p04019
u113971909
1575144433
Python
Python (3.4.3)
py
Accepted
17
3060
131
S = set(list(input())) NS = ("N" in S) == ("S" in S) WE = ("W" in S) == ("E" in S) if NS and 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,497
s015711799
p04019
u597455618
1574912674
Python
Python (3.4.3)
py
Accepted
17
2940
152
s = input() if len(set(s))%2 == 0 and ((s.count("N") and s.count("S")) != 0 or (s.count("W") and 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,498
s650909719
p04019
u073852194
1574903442
Python
Python (3.4.3)
py
Accepted
17
2940
175
S = input() if ('N' in S and 'S' not in S) or ('S' in S and 'N' not in S) or ('E' in S and 'W' not in S) or ('W' in S and 'E' 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,499
s001970397
p04019
u746419473
1574894003
Python
Python (3.4.3)
py
Accepted
17
2940
203
s = set(input()) t = 0 for _s in s: if _s == "N": t += 1 if _s == "S": t -= 1 if _s == "E": t += 2 if _s == "W": t -= 2 print("Yes" if t == 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,500
s072670170
p04019
u754022296
1574741859
Python
Python (3.4.3)
py
Accepted
17
2940
140
s = input() if (-1) ** (int("N" in s) + int("S" in s))==1 and (-1) ** (int("E" in s) + int("W" in s))==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,501
s534868268
p04019
u357630630
1574631984
Python
Python (3.4.3)
py
Accepted
17
2940
222
S = list(set(list(input()))) c = 0 for i in S: if i == "N": c += 1 elif i == "W": c += 2 elif i == "S": c -= 1 else: c -= 2 if c == 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,502
s453661753
p04019
u936985471
1574616545
Python
Python (3.4.3)
py
Accepted
18
3060
110
dic={"W":1,"E":-1,"N":10,"S":-10} ans=0 for c in set(list(input())): ans+=dic[c] print(("No","Yes")[ans==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,503
s290090489
p04019
u276115223
1574361496
Python
Python (3.4.3)
py
Accepted
17
2940
194
# AGC 003: A – Wanna go back home s = input() print('No' if ('N' in s and 'S' not in s) or ('N' not in s and 'S' in s) or ('E' in s and 'W' not in s) or ('E' not in s and '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,504
s847457422
p04019
u828766688
1574094932
Python
Python (3.4.3)
py
Accepted
17
2940
218
S = input() dic = {} for i in S: dic[i] = 1 if len(dic) == 4: print ("Yes") elif len(dic) == 2 and (("N" in dic and "S" in dic) or ("W" in dic and "E" in dic)) : 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,505
s407719525
p04019
u089032001
1574019419
Python
Python (3.4.3)
py
Accepted
17
3060
369
def inpl(): return list(map(int, input().split())) def f(a, b): if a == 0 and b == 0: return True elif a * b == 0: return False else: return True S = input() # print(S) cN = S.count('N') cW = S.count('W') cS = S.count('S') cE = S.count('E') if f(cN, cS) is True and f(cW, cE)...
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,506
s191705525
p04019
u376099073
1573867276
Python
Python (3.4.3)
py
Accepted
17
3060
248
s = list(input()) N = s.count("N") W = s.count("W") S = s.count("S") E = s.count("E") ans = "Yes" if N>=1 and S==0: ans = "No" elif N==0 and S>=1: ans = "No" if W>=1 and E==0: ans = "No" elif W==0 and E>=1: 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,507
s341518839
p04019
u469063372
1573698159
Python
Python (3.4.3)
py
Accepted
19
3064
357
s = [c for c in input()] a = [0, 0, 0, 0] for c in s: if c == 'N': a[0] += 1 elif c == 'S': a[1] += 1 elif c == 'E': a[2] += 1 elif c == 'W': a[3] += 1 if (a[0] != 0 and a[1] == 0 or a[0] == 0 and a[1] != 0) \ or (a[2] != 0 and a[3] == 0 or a[2] == 0 and a[3] != 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,508
s068141707
p04019
u727787724
1573633184
Python
Python (3.4.3)
py
Accepted
17
3064
358
# coding: utf-8 # Your code here! s=list(input()) if s.count('N')>0 and s.count('S')>0 and s.count('E')>0 and s.count('W')>0: print('Yes') elif s.count('N')>0 and s.count('S')>0 and s.count('E')==0 and s.count('W')==0: print('Yes') elif s.count('N')==0 and s.count('S')==0 and s.count('E')>0 and s.count('W')>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,509
s724691804
p04019
u721316601
1573620378
Python
Python (3.4.3)
py
Accepted
17
3060
247
pos = {'N':0, 'W':0, 'S':0, 'E':0} for s in input(): pos[s] += 1 ans = 'Yes' if not (pos['N'] and pos['S'] or not pos['N'] and not pos['S']): ans = 'No' if not (pos['W'] and pos['E'] or not pos['W'] and not pos['E']): 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,510
s688951458
p04019
u346395915
1573618391
Python
Python (3.4.3)
py
Accepted
19
3064
396
s = list(input()) north = s.count("N") west = s.count("W") south = s.count("S") east = s.count("E") if north == 0: if south > 0: print("No") exit() if south == 0: if north > 0: print("No") exit() if west == 0: if east > 0: print("No") exit() if east == 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,511
s490687695
p04019
u897328029
1573506496
Python
Python (3.4.3)
py
Accepted
20
3316
260
#!/usr/bin/env python3 import collections S = input() c = collections.Counter(S) ans = "No" if (c["N"] > 0 and c["S"] > 0) or (c["N"] == 0 and c["S"] == 0): if (c["W"] > 0 and c["E"] > 0) or (c["W"] == 0 and c["E"] == 0): ans = "Yes" 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,512
s269603483
p04019
u311379832
1573443981
Python
Python (3.4.3)
py
Accepted
20
3316
426
from collections import defaultdict S = input() d = defaultdict(int) for i in S: d[i] += 1 if len(d) == 1 or len(d) == 3: print('No') else: if len(d) == 4: print('Yes') elif 'N' in d: if 'S' in d: print('Yes') else: print('No') elif 'W' in d: ...
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,513
s431357427
p04019
u379959788
1573078773
Python
Python (3.4.3)
py
Accepted
18
3064
431
S = input() cnt_n = 0 cnt_w = 0 cnt_s = 0 cnt_e = 0 for i in S: if i == "N": cnt_n += 1 elif i == "W": cnt_w += 1 elif i == "S": cnt_s += 1 else: cnt_e += 1 if cnt_n * cnt_w * cnt_s * cnt_e > 0: print("Yes") elif (cnt_n == 0 and cnt_s == 0) and cnt_e * cnt_w > 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,514
s825006572
p04019
u948524308
1573010459
Python
Python (3.4.3)
py
Accepted
17
2940
313
S=input() if "W" in S: if not "E" in S: print("No") exit() if "E" in S: if not "W" in S: print("No") exit() if "N" in S: if not "S" in S: print("No") exit() if "S" in S: if not "N" 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,515
s476809171
p04019
u374531474
1572063175
Python
Python (3.4.3)
py
Accepted
21
3316
151
from collections import Counter S = input() c = Counter(S) print('No' if bool(c['N']) ^ bool(c['S']) | bool(c['W']) ^ bool(c['E']) 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,516
s622172689
p04019
u390883247
1571651861
Python
Python (3.4.3)
py
Accepted
17
3060
218
S = input() n = False s = False e = False w = False if 'N' in S: n = True if 'S' in S: s = True if 'E' in S: e = True if 'W' in S: w = True if n == s and 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,517
s332141323
p04019
u945181840
1571596543
Python
Python (3.4.3)
py
Accepted
17
3060
205
S = set(list(input())) if len(S) == 4: print('Yes') elif len(S) == 1 or len(S) == 3: print('No') else: if {'N', 'S'} == S or {'W', 'E'} == 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,518
s655934000
p04019
u105124953
1570845133
Python
Python (3.4.3)
py
Accepted
17
3064
269
src = input() a = False b = False c = False d = False for s in src: if s == 'N': a = True elif s == 'W': b = True elif s == 'S': c = True elif s == 'E': d = True if a != c or b != d: 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,519
s698722802
p04019
u042802884
1570670410
Python
Python (3.4.3)
py
Accepted
17
3064
332
S=input() [fN,fS,fE,fW]=[False]*4 for c in S: if fN and fS and fE and fW: break if c=='N': fN=True if c=='S': fS=True if c=='E': fE=True if c=='W': fW=True if (fN and not fS) or (not fN and fS) or (fE and not fW) or (not fE and fW): print('No') 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,520
s124315169
p04019
u392319141
1570632092
Python
Python (3.4.3)
py
Accepted
17
3060
221
T = input() N = T.count('N') S = T.count('S') W = T.count('W') E = T.count('E') if N > 0 and S == 0 or S > 0 and N == 0: print('No') elif 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,521
s580998573
p04019
u937642029
1570542363
Python
Python (3.4.3)
py
Accepted
17
2940
192
s=list(input()) if ("N" not in s and "S" in s) or ("N" in s and "S" not in s) or ("E" not in s and "W" 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,522
s346157041
p04019
u322354465
1570308183
Python
Python (3.4.3)
py
Accepted
22
2940
111
s = set(input()) if s in [{"N", "W", "S", "E"}, {"N", "S"}, {"W", "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,523
s693307496
p04019
u625963200
1570235957
Python
Python (3.4.3)
py
Accepted
17
3064
230
S=list(input()) S.sort() e,w,n,s=S.count('E'),S.count('W'),S.count('N'),S.count('S') flag=True if max(e,w)>0 and min(e,w)==0: flag=False if max(n,s)>0 and min(n,s)==0: 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,524
s607841233
p04019
u183840468
1570230017
Python
Python (3.4.3)
py
Accepted
18
2940
175
n = input() sets = set(n) flg = False for i in [{'N','S','W','E'},{'N','S'},{'W','E'}]: if sets == i: flg = True break 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,525
s269113519
p04019
u377989038
1570178413
Python
Python (3.4.3)
py
Accepted
18
2940
226
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 "E" in s and "W" not in s: print("No") elif "W" in s and "E" 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,526
s264541482
p04019
u814986259
1570153876
Python
Python (3.4.3)
py
Accepted
17
3064
411
S = input() nwse = [0, 0, 0, 0] for x in S: if x == "N": nwse[0] += 1 elif x == "W": nwse[1] += 1 elif x == "S": nwse[2] += 1 elif x == "E": nwse[3] += 1 if nwse[0] > 0 and nwse[2] > 0 or nwse[0] == 0 and nwse[2] == 0: if nwse[1] > 0 and nwse[3] > 0 or nwse[1] == 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,527
s712157680
p04019
u941438707
1569956548
Python
Python (3.4.3)
py
Accepted
17
3060
116
s=set(list(input())) print("Yes" if len(s)%2==0 and (("N" in s and "S" in s) or ("E" in s and "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,528
s951982916
p04019
u396495667
1569946958
Python
Python (3.4.3)
py
Accepted
17
2940
214
s = input() ans =0 if 'N' in s and 'S' not in s: ans =1 elif 'S' in s and 'N' not in s: ans =1 elif 'W' in s and 'E' not in s: ans =1 elif 'E' in s and 'W' not in s: ans =1 print('No' if ans ==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,529
s888348924
p04019
u296518383
1569590878
Python
Python (3.4.3)
py
Accepted
25
3316
212
import collections S=input() S=collections.Counter(S) if (S["N"]>0 and S["S"]>0) or (S["N"]==0 and S["S"]==0): if (S["E"]>0 and S["W"]>0) or (S["E"]==0 and S["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,530
s120823327
p04019
u668503853
1569464913
Python
Python (3.4.3)
py
Accepted
18
2940
74
S=input() print(['No','Yes'][('W'in S)==('E'in S)and('N'in S)==('S'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,531
s772204885
p04019
u668503853
1569464794
Python
Python (3.4.3)
py
Accepted
17
3064
503
S=list(input()) ans="Yes" n=S.count("N") e=S.count("E") w=S.count("W") s=S.count("S") if n>0 and s>0: if e>0 and w>0: pass elif e==0 and w==0: pass else: ans="No" elif n==0 and s==0: if e>0 and w>0: pass elif e==0 and w==0: pass else: ans="No" elif e>0 and w>0: if n>0 and s>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,532
s792060239
p04019
u879309973
1568981514
Python
Python (3.4.3)
py
Accepted
18
3060
307
def solve(s): s = set(s) if ("N" in s) and (not "S" in s): return "No" if ("S" in s) and (not "N" in s): return "No" if ("W" in s) and (not "E" in s): return "No" if ("E" in s) and (not "W" in s): return "No" return "Yes" s = input() print(solve(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,533
s696909085
p04019
u571969099
1568837395
Python
Python (3.4.3)
py
Accepted
17
2940
108
s = input() if ("N" in s) == ("S" in s) and ("W" in s) == ("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,534
s241506663
p04019
u792670114
1568666772
Python
Python (3.4.3)
py
Accepted
17
3060
292
S = input() nN = 0 nW = 0 nS = 0 nE = 0 for c in S: if c == "N": nN += 1 if c == "W": nW += 1 if c == "S": nS += 1 if c == "E": nE += 1 if (nN > 0 and nS == 0) or (nS > 0 and nN == 0) or (nW > 0 and nE == 0) or (nE > 0 and nW == 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,535
s288969390
p04019
u787456042
1568472304
Python
Python (3.4.3)
py
Accepted
17
2940
80
S=set(input());print("YNeos"[S!=set("NEWS")and S!={"N","S"}and S!={"E","W"}::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,536
s833162813
p04019
u347640436
1568434469
Python
Python (3.4.3)
py
Accepted
17
2940
102
S = 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,537
s685193961
p04019
u993622994
1568410720
Python
Python (3.4.3)
py
Accepted
17
3060
302
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 'E' in S: if 'W' not in S: print('No') exit() if 'W' in S: if 'E' 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,538
s735026887
p04019
u403301154
1568174152
Python
Python (3.4.3)
py
Accepted
21
3316
282
s = input() from collections import Counter c = Counter(s) flag = True if c["S"]>0 and c["N"]==0: flag = False if c["N"]>0 and c["S"]==0: flag = False if c["W"]>0 and c["E"]==0: flag = False if c["E"]>0 and c["W"]==0: 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,539
s125184004
p04019
u802963389
1568112052
Python
Python (3.4.3)
py
Accepted
17
2940
135
s = set(input()) ALL = set("NSWE") NS = set("NS") EW = set("EW") if s == ALL or s == NS or s == 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,540
s505366541
p04019
u396495667
1568046533
Python
Python (3.4.3)
py
Accepted
18
2940
205
s = input() hor = ('W' in s and 'E' in s) or ('W' not in s and 'E' not in s) ver = ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s) ans = hor and ver if ans: 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,541
s236663273
p04019
u296150111
1567963344
Python
Python (3.4.3)
py
Accepted
17
3060
208
s=input() S=s.count("S") E=s.count("E") N=s.count("N") W=s.count("W") a=0 b=0 if S>0 and N>0: a+=1 elif S==N==0: a+=1 if E>0 and W>0: b+=1 elif E==W==0: b+=1 if a==b==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,542
s439789207
p04019
u777283665
1567962665
Python
Python (3.4.3)
py
Accepted
17
3060
273
s = set(list(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,543
s317726243
p04019
u410118019
1567655541
Python
Python (3.4.3)
py
Accepted
17
3060
271
s = set(list(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,544
s714915915
p04019
u794250528
1567614880
Python
Python (3.4.3)
py
Accepted
21
3316
248
import collections s = input() c = collections.Counter(s) ok1 = (c['N'] == 0 and c['S'] == 0) or (c['N'] > 0 and c['S'] > 0) ok2 = (c['E'] == 0 and c['W'] == 0) or (c['E'] > 0 and c['W'] > 0) if ok1 and ok2: 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,545
s448417258
p04019
u131634965
1567611765
Python
Python (3.4.3)
py
Accepted
17
3060
111
s=input() if (('N' in s) == ('S' in s)) and (('E' in s) == ('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,546
s481983375
p04019
u396391104
1567545445
Python
Python (3.4.3)
py
Accepted
17
2940
172
s = input() ans = "Yes" if ("N" in s) ^ ("S" in s): print("No") exit() else: ans = "Yes" if ("W" in s) ^ ("E" in s): ans = "No" else: ans = "Yes" 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,547
s789896207
p04019
u116002573
1567107916
Python
Python (3.4.3)
py
Accepted
19
3060
243
def main(): S = input() lc = list(set(list(S))) lc.sort() # print(lc) if lc == ["E", "N", "S", "W"] or lc == ["E", "W"] or lc == ["N", "S"]: return "Yes" return "No" if __name__ == '__main__': print(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,548
s853433431
p04019
u430223993
1566996264
Python
Python (3.4.3)
py
Accepted
18
3060
294
s = input() flag = 1 if s.count('N'): if not s.count('S'): flag = 0 if s.count('S'): if not s.count('N'): flag = 0 if s.count('E'): if not s.count('W'): flag = 0 if s.count('W'): if not s.count('E'): flag = 0 print('Yes') if flag 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,549
s746022759
p04019
u298297089
1566424788
Python
Python (3.4.3)
py
Accepted
18
3060
158
dire = [0,0,0,0] d = {c:i for i,c in enumerate('WENS')} for c in input(): dire[d[c]] = 1 print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) 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,550
s377591412
p04019
u266874640
1566312669
Python
Python (3.4.3)
py
Accepted
17
2940
225
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 'E' in S and 'W' not in S: print('No') elif 'W' in S and 'E' 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,551
s820565888
p04019
u333190709
1566134417
Python
Python (3.4.3)
py
Accepted
36
5076
818
#!/usr/bin/env python3 import sys, math, fractions, itertools, collections, copy, heapq YES = "Yes" # type: str NO = "No" # type: str def solve(s: str): N = s.count('N') S = s.count('S') E = s.count('E') W = s.count('W') if (N == 0 and S != 0) or (N != 0 and S == 0) or (E == 0 and W != 0) or (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,552
s630755260
p04019
u503228842
1566074917
Python
Python (3.4.3)
py
Accepted
21
3316
257
from collections import Counter S = list(input()) s = set(Counter(S).keys()) if len(s) == 4: print("Yes") elif len(s) == 2 and "E" in s and "W" in s: print("Yes") elif len(s) == 2 and "N" in s and "S" 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,553
s136093681
p04019
u076917070
1565998933
Python
Python (3.4.3)
py
Accepted
17
3060
250
import sys input=sys.stdin.readline S = input().strip() n = S.count("N") > 0 w = S.count("W") > 0 e = S.count("E") > 0 s = S.count("S") > 0 if (n and not s) or (not n and s) or (w and not e) or (not w 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,554
s510509376
p04019
u076917070
1565998700
Python
Python (3.4.3)
py
Accepted
18
3060
268
import sys input=sys.stdin.readline S = input().strip() n = S.count("N") w = S.count("W") e = S.count("E") s = S.count("S") if (n == 0 and s == 0) or (n > 0 and s > 0): if (w == 0 and e == 0) or (w > 0 and e > 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,555
s081047106
p04019
u328364772
1565991870
Python
Python (3.4.3)
py
Accepted
17
3060
190
s = input() ns, ew = 0, 0 if "N" in s: ns += 1 if "S" in s: ns -= 1 if "E" in s: ew += 1 if "W" in s: ew -= 1 if ns == 0 and ew == 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,556
s460063975
p04019
u670180528
1565918041
Python
Python (3.4.3)
py
Accepted
17
2940
74
a=input();f=lambda x:x in a;print("YNeos"[f("N")^f("S")|f("W")^f("E")::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,557
s072740202
p04019
u670180528
1565917609
Python
Python (3.4.3)
py
Accepted
17
2940
68
a=input();print("YNeos"[("N"in a)^("S"in a)|("W"in a)^("E"in a)::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,558
s202093848
p04019
u263830634
1565886271
Python
Python (3.4.3)
py
Accepted
17
3060
232
S = list(input()) S = set(S) if len(S) == 4: print ('Yes') exit() if 'N' in S and 'S' in S and len(S) == 2: print ('Yes') exit() if 'E' in S and 'W' in S and len(S) == 2: 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,559
s987075278
p04019
u919633157
1565838240
Python
Python (3.4.3)
py
Accepted
20
2940
199
# 2019/08/14 s=set(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,560
s035299668
p04019
u753803401
1565729754
Python
Python (3.4.3)
py
Accepted
17
3060
290
s = input() ls =[False] * 4 for i in range(len(s)): if s[i] == "N": ls[0] = True elif s[i] == "W": ls[1] = True elif s[i] == "S": ls[2] = True elif s[i] == "E": ls[3] = True print("Yes" if not(ls[0] ^ ls[2]) and not(ls[1] ^ ls[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,561
s248411821
p04019
u256868077
1565475941
Python
Python (3.4.3)
py
Accepted
17
3064
259
s=input() l=len(s) a=[0,0,0,0] for i in range(l): if(s[i]=='N'): a[0]=1 elif(s[i]=='W'): a[1]=1 elif(s[i]=='S'): a[2]=1 else: a[3]=1 if(a[0]*a[2]==0 and a[0]+a[2]!=0 or a[1]*a[3]==0 and a[1]+a[3]!=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,562
s084117218
p04019
u007550226
1565190250
Python
Python (3.4.3)
py
Accepted
17
3060
171
s = input() if len(set(s)) % 2 == 1:print('No') else: if (('N' in s) and ('S' in s)) or (('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,563
s320346838
p04019
u800258529
1565117025
Python
Python (3.4.3)
py
Accepted
17
2940
89
s=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,564
s365208760
p04019
u921773161
1565099841
Python
Python (3.4.3)
py
Accepted
18
3060
375
S = list(input()) check = 0 if 'E' in S : if 'W' in S: pass else: check = 1 if 'W' in S : if 'E' in S: pass else: check = 1 if 'N' in S : if 'S' in S: pass else: check = 1 if 'S' in S : if 'N' in S: pass else: check = 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,565
s506692329
p04019
u941753895
1565066116
Python
Python (3.4.3)
py
Accepted
17
3060
136
s=list(input()) sets=list(set(s)) sets.sort() l=sets x=''.join(l) if x=='ENSW' or x=='EW' or x=='NS': 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,566
s831846642
p04019
u231685196
1565060335
Python
Python (3.4.3)
py
Accepted
17
3064
356
s = input() d = {"N":0,"W":0,"S":0,"E":0} for c in s: d[c] += 1 flag = True if d["N"] > 0: if d["S"] <= 0: flag = False if d["S"] > 0: if d["N"] <= 0: flag = False if d["W"] > 0: if d["E"] <= 0: flag = False if d["E"] > 0: if d["W"] <= 0: flag = False if flag: ...
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,567
s316024086
p04019
u393512980
1564616405
Python
Python (3.4.3)
py
Accepted
17
2940
122
S = set(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,568
s418843782
p04019
u350248178
1564371980
Python
Python (3.4.3)
py
Accepted
17
3064
335
s=input() l=list(s) N=l.count("N") W=l.count("W") S=l.count("S") E=l.count("E") if N*S!=0 and E*W!=0: print("Yes") elif N*S==0 and E*W!=0: if N==0 and S==0: print("Yes") else: print("No") elif E*W==0 and N*S!=0: if E==0 and W==0: print("Yes") else: print("No") 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,569
s338110802
p04019
u927534107
1564005655
Python
Python (3.4.3)
py
Accepted
18
3060
165
def check(a,b,l): return(any([a in l and b not in l,b in l and a not in l])) s=input() if any([check("N","S",s),check("E","W",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,570