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
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s717115159
p03854
u311636831
1575564471
Python
PyPy3 (2.4.0)
py
Runtime Error
207
43504
774
S=input() lenS=len(S) L=[0]*10000 j=0 i=0 s=0 while(True): if(lenS==i): print("YES") exit() if(S[i:i+7]=="dreamer" and s<1): L[j]=1 j+=1 i+=7 s=0 continue if(S[i:i+5]=="dream" and s<2): L[j]=2 j+=1 i+=5 s=0 continue if(S[i:i+6]=="eraser" and s<3): L[j]=3 j+=1 i+=6 s=0 continue if(S[i:i+5]=="erase" and s<4): L[j]=4 j+=1 i+=5 s=0 continue j-=1 if(j<0): print("NO") exit() if(L[j]==1): i-=7 s=1 elif(L[j]==2): i-=5 s=2 elif(L[j]==3): i-=6 s=3 elif(L[j]==4): i-=5 s=4
s803391479
p03854
u311636831
1575563560
Python
PyPy3 (2.4.0)
py
Runtime Error
277
43248
537
S=input() lenS=len(S) def state(i): if(lenS==i): return True if(S[i:i+7]=="dreamer"): j=state(i+7) if(j==True): return True if(S[i:i+5]=="dream"): j=state(i+5) if(j==True): return True if(S[i:i+6]=="eraser"): j=state(i+6) if(j==True): return True if(S[i:i+5]=="erase"): j=state(i+5) if(j==True): return True return False i=0 if(state(i)): print("YES") else: print("NO")
s560583401
p03854
u838559130
1575485797
Python
Python (3.4.3)
py
Runtime Error
200
134324
526
s = input()[::-1] while True: end_flg = False if s[:5] == "maerd": s = s.replace("maerd", "", 1) end_flg = True print(s) elif s[:5] == "esare": s = s.replace("esare", "", 1) end_flg = True elif s[:7] == "remaerd": s = s.replace("remaerd", "", 1) end_flg = True elif s[:6] == "resare": s = s.replace("resare", "", 1) end_flg = True if end_flg == False: break if s == "": print("YES") else: print("NO")
s575628097
p03854
u838559130
1575485493
Python
Python (3.4.3)
py
Runtime Error
203
134316
557
s = input()[::-1] s = s.replace("maerd", "", 1) while True: end_flg = False if s[:5] == "maerd": s = s.replace("maerd", "", 1) end_flg = True print(s) elif s[:5] == "esare": s = s.replace("esare", "", 1) end_flg = True elif s[:7] == "remaerd": s = s.replace("remaerd", "", 1) end_flg = True elif s[:6] == "resare": s = s.replace("resare", "", 1) end_flg = True if end_flg == False: break if s == "": print("YES") else: print("NO")
s593876777
p03854
u829967775
1575251951
Python
Python (3.4.3)
py
Runtime Error
17
3188
237
# -*- coding: utf-8 -*- #ๆ•ดๆ•ฐใฎๅ…ฅๅŠ› S = input() #็ฝฎๆ› S2 = S1.replace("eraser", "") S4 = S3.replace("erase", "") S1 = S.replace("dreamer", "") S3 = S2.replace("dream", "") if len(S4) >= 1: print("NO") else: print("YES")
s158802430
p03854
u595893956
1575174597
Python
Python (3.4.3)
py
Runtime Error
17
2940
248
import sys s=reverse(input()) l=list(["maerd","remaerd","esare","resare"] for i in range len(s): ok=0 for j in range l: if s[i:len(j)] == j: ok=1 i += len(j) break if ok == 0: print("NO") sys.exit() print("YES")
s886043013
p03854
u871867619
1574723498
Python
Python (3.4.3)
py
Runtime Error
364
134388
409
s = str(input())[::-1] while(len(s) >= 5): print(s) if s[:5] == 'maerd': s = s.replace('maerd', '') elif s[:7] == 'remaerd': s = s.replace('remerd', '') elif s[:5] == 'esare': s = s.replace('esare', '') elif s[:6] == 'resare': s = s.replace('resare', '') else: print('NO') exit() if len(s) == 0: print('YES') else: print('NO')
s624641965
p03854
u871867619
1574723428
Python
Python (3.4.3)
py
Runtime Error
358
134388
416
s = str(input())[::-1] print(s) while(len(s) >= 5): print(s) if s[:5] == 'maerd': s = s.replace('maerd', '') elif s[:7] == 'remaerd': s = s.replace('remerd', '') elif s[:5] == 'esare': s = s.replace('esare', '') elif s[:6] == 'resare': s = s.replace('resare', '') else: print('NO') exit() if len(s) == 0: print('YES') else: print('NO')
s048286581
p03854
u187109555
1574479139
Python
Python (3.4.3)
py
Runtime Error
17
3188
318
S = input() find_flag = 0 rest_S = S while True: if len(rest_S) == 0: find_flag = 1 break elif rest_S[-5:] in candidates: rest_S = rest_S[:-5] elif rest_S[-6:] in candidates: rest_S = rest_S[:-6] else: break if find_flag: print("YES") else: print("NO")
s878404753
p03854
u442810826
1574027880
Python
Python (3.4.3)
py
Runtime Error
17
3188
269
s = input() while(len(s)>0): if s[-5:] == dream or s[-5:] == erase: s = s[:-5] elif s[-7:] == dreamer: s = s[:-7] elif s[-6:] == eraser: s = s[:-6] else: s = "" if len(s) > 0: print("Yes") else: print("No")
s641081833
p03854
u190086340
1573926249
Python
PyPy3 (2.4.0)
py
Runtime Error
296
44784
523
def solve(): S = input() # print(S, len(S)) S = S[::-1] words = ("dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1]) def recur(i): if i >= len(S): return True for word in words: if S[i:i + len(word)] == word: if recur(i + len(word)): return True return False ans = recur(0) return ans if __name__ == '__main__': res = solve() if res: print("YES") else: print("NO")
s901809832
p03854
u557494880
1573786735
Python
Python (3.4.3)
py
Runtime Error
18
3188
540
T = input() S = '' p,q,r,s = 'maerd','esare','remaerd','resare' for i in range(len(T)): S += T[len(T)-i] while len(S) >= 7: x = S[:5] y = S[:6] z = S[:7] if x == p or x == q: if len(S) > 5: S = S[5:] else: S = '' elif y == s: if len(S) > 6: S = S[6:] else: S = '' elif z == r: if len(S) > 7: S = S[7:] else: S = '' else: break ans = 'NO' if len(S) == 0: ans = 'YES' print(ans)
s482442534
p03854
u557494880
1573786715
Python
Python (3.4.3)
py
Runtime Error
17
3188
529
T = input() S = '' p,q,r,s = 'maerd','esare','remaerd','resare' for i in range(len(T)): S += T[len(T)-i] while len(S) >= 7: x = S[:5] y = S[:6] z = S[:7] if x == p or x == q: if len(S) > 5: S = S[5:] else: S = '' elif y == s: if len(S) > 6: S = S[6:] else: S = '' elif z == r: if len(S) > 7: S = S[7:] else: S = '' else: break ans = 'NO' if len(S) == 0: ans = 'YES'
s057863388
p03854
u520276780
1573768906
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
471
s = input() l = len(s) #ๅพŒใ‚ใ‹ใ‚‰่ฆ‹ใŸใ‚‰ไธ€ๆ„ import sys i = l-1 try: while i>0: if s[i]=="r": if s[i-5:i+1]=="eraser": i-=6 elif s[i-6:i+1]=="dremer": i-=7 else: if s[i-4:i+1]=="erase": i-=5 elif s[i-4:i+1]=="dream": i -= 5 else: print("NO")### sys.exit() print("YES") except: print("NO")
s151394732
p03854
u819048695
1573679825
Python
Python (3.4.3)
py
Runtime Error
29
3188
476
s=input() s=s.replace("dream","D") s=s.replace("erase","E") n=len(s) i=0 while i<n: if s[i]=="D": if i+2<n: if s[i:i+3]=="Der": i+=3 else: i+=1 else: i+=1 elif s[i]=="E": if i+1<n: if s[i:i+2]=="Er": i+=2 else: i+=1 else: i+=1 else: break else: print("YES") sys.exit() print("NO")
s655513238
p03854
u531813438
1573619318
Python
PyPy3 (2.4.0)
py
Runtime Error
173
42352
923
import sys from collections import Counter N, K, L = map(int, input().split()) edge1 = [[] for _ in range(N)] edge2 = [[] for _ in range(N)] for _ in range(K): p, q = map(int, sys.stdin.readline().split()) edge1[p-1].append(q-1) edge1[q-1].append(p-1) for _ in range(L): p, q = map(int, sys.stdin.readline().split()) edge2[p-1].append(q-1) edge2[q-1].append(p-1) def dfs(edges): groups = [-1]*N for i in range(N): if groups[i] != -1: continue groups[i] = i stack = [i] while stack: v = stack.pop() for dest in edges[v]: if groups[dest] != -1: continue groups[dest] = i stack.append(dest) return groups g1, g2 = dfs(edge1), dfs(edge2) d = Counter() for i in range(N): d[(g1[i], g2[i])] += 1 print(*(d[(g1[i], g2[i])] for i in range(N)))
s461218214
p03854
u122231433
1573500750
Python
Python (3.4.3)
py
Runtime Error
18
3064
1084
# ๆ–‡ๅญ—ๅˆ—ๅ่ปข def rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can2 = False i= 0 while i < len(S_re): can = False can2 = False for div in name: if len(S_re[i:]) >= len(div): if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True break if can : can2 = True else: can2 = False break if can2: print('YES') else : print('No') coding: utf-8 # ๆ–‡ๅญ—ๅˆ—ๅ่ปข def rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can2 = False i= 0 while i < len(S_re): can = False can2 = False for div in name: if len(S_re[i:]) >= len(div): if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True break if can : can2 = True else: can2 = False break if can2: print('YES') else : print('NO')
s005698108
p03854
u122231433
1573500539
Python
Python (3.4.3)
py
Runtime Error
2104
3956
515
# coding: utf-8 # ๆ–‡ๅญ—ๅˆ—ๅ่ปข def rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can2 = False i= 0 while i < len(S_re): for div in name: if len(S_re[i:]) >= len(div): if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True break if can : can2 = True else: can2 = False break if can2: print('YES') else : print('NO')
s990365945
p03854
u122231433
1573494015
Python
Python (3.4.3)
py
Runtime Error
17
2940
549
coding: utf-8 # ๆ–‡ๅญ—ๅˆ—ๅ่ปข def rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can2 = False i= 0 while i < len(S_re): can = False can2 = False for div in name: if len(S_re[i:]) >= len(div): if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True break if can : can2 = True else: can2 = False break if can2: print('YES') else : print('No')
s589222916
p03854
u122231433
1573490240
Python
PyPy3 (2.4.0)
py
Runtime Error
164
38256
436
ef rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can = False can2 = False for i in range(len(S_re)): for div in name: if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True if can : can2 = True break if not can2 : break if can2 : print('YES') else : print('No')
s211943604
p03854
u122231433
1573489766
Python
Python (3.4.3)
py
Runtime Error
17
3064
436
ef rev (s): _re=''.join(list(reversed(s))) return _re name = ['dream','dreamer','eraser','erase'] S = input() S_re = rev(S) can = False can2 = False for i in range(len(S_re)): for div in name: if S_re[i:i+len(div)]==rev(div) : i+=len(div) can = True if can : can2 = True break if not can2 : break if can2 : print('YES') else : print('No')
s416044423
p03854
u600402037
1573058395
Python
Python (3.4.3)
py
Runtime Error
181
134376
226
S = input() while S: print(S) for x in ['dreamer', 'eraser', 'dream', 'erase']: if S.endswith(x): S = S[:-len(x)] break else: print('NO') exit() print('YES')
s015914471
p03854
u754022296
1573051483
Python
Python (3.4.3)
py
Runtime Error
19
3188
139
if input().replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "") == "": peinr("YES") else: print("NO")
s538712706
p03854
u923659712
1572784440
Python
Python (3.4.3)
py
Runtime Error
17
3188
151
s = input() u=s[::-1] k=[maerd,remaerd,esare,resare] for i in k: if u.find(k): s.strip(k) if u==[]: print("Yes") else: print("No")
s746896668
p03854
u662613022
1572749081
Python
Python (3.4.3)
py
Runtime Error
18
3316
547
S = input() S = S[::-1] le = 0 while le != len(S): le = len(S) if S[0] == 'd' and S[1] == 'r' and S[2] == 'e' and S[3] == 'a' and S[4] == 'm': del S[0:4] if S[0] == 'e' and S[1] == 's' and S[2] == 'a' and S[3] == 'r' and S[4] == 'e': del S[0:4] if S[0] == 'r' and S[1] == 'e' and S[2] == 's' and S[3] == 'a' and S[4] == 'r' and S[5] == 'e': del S[0:5] if S[0] == 'r' and S[1] == 'e' and S[2] == 'm' and S[3] == 'a' and S[4] == 'e' and S[5] == 'r' and S[6] == 'd': del S[0:6] if S == '': print('YES') else: print('NO')
s767637630
p03854
u220612891
1572646844
Python
Python (3.4.3)
py
Runtime Error
17
2940
10
erasedream
s608314836
p03854
u117348081
1572484697
Python
Python (3.4.3)
py
Runtime Error
17
3188
577
s = str(input()) n = len(s) i = 0 d = ["dream", "dreamer"] e = ["erase", "eraser"] while i<n: if s[i]=="d": if s[i:i+5]==d[0]: i+=5 else: break if s[i:i+3]=="era": continue elif s[i:i+2]!="er" and s[i+2]=="e": i+=2 else: break elif s[i]=="e": if s[i:i+5]==e[0]: i+=5 else: break if s[i:i+1]=="r": i+=1 else: continue else: break if i<n: print("NO") else: print("YES")
s432351718
p03854
u022269787
1572383794
Python
Python (3.4.3)
py
Runtime Error
18
2940
191
s = input() while len(s) >= 4: s.replace("eraser", "") s.replace("erase", "") s.replace("dreamer", "") s.replace("dream", "") if len(s) == 0: print('YES') return print('NO')
s204950268
p03854
u022269787
1572383745
Python
Python (3.4.3)
py
Runtime Error
18
2940
191
s = input() while len(s) <= 4: s.replace("eraser", "") s.replace("erase", "") s.replace("dreamer", "") s.replace("dream", "") if len(s) == 0: print('YES') return print('NO')
s717115212
p03854
u238510421
1572039188
Python
PyPy3 (2.4.0)
py
Runtime Error
177
46064
254
s = list(input()) kws = ["dream", "dreamer", "erase", "eraser"] def func(s): bool = False for kw in kws: if s.startswith(kw): bool = bool or func(s[len(kw):]) return bool result = func(s) if result: print("YES") else: print("NO")
s933022973
p03854
u780962115
1571712034
Python
Python (3.4.3)
py
Runtime Error
124
98600
957
def checkcheck(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": s=s[:-5] return checkcheck(s) elif s[-7:]=="dreamer": s=s[:-7] return checkcheck(s) elif s[-6:]=="eraser": s=s[:-6] return checkcheck(s) else: s="WOW" return False elif len(s)==6: if s[-6:]=="eraser": return True else: return False elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False else: return False s=input() if checkcheck(s)==True: print("YES") elif checkcheck(s)==False: print("NO")
s167869250
p03854
u780962115
1571711044
Python
Python (3.4.3)
py
Runtime Error
230
192820
992
def check(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": s=s[:-5] print(s) return check(s) elif s[-7:]=="dreamer": s=s[:-7] print(s) return check(s) elif s[-6:]=="eraser": s=s[:-6] print(s) return check(s) else: return False elif len(s)==6: if s[-6:]=="eraser": return True else: return False elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False else: return False s=input() if check(s): print("Yes") else: print("No")
s621114651
p03854
u780962115
1571710507
Python
Python (3.4.3)
py
Runtime Error
125
98520
910
s=input() def check(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": s=s[:-5] return check(s) elif s[-7:]=="dreamer": s=s[:-7] return check(s) elif s[-6:]=="eraser": s=s[:-6] return check(s) elif len(s)==6: if s[-6:]=="eraser": return True else: return False elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False else: return False if check(s): print("Yes") else: print("No")
s577862922
p03854
u780962115
1571710153
Python
Python (3.4.3)
py
Runtime Error
121
98516
838
s=input() def check(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": return check(s[:-5]) elif s[-7:]=="dreamer": return check(s[:-7]) elif s[-6:]=="eraser": return check(s[:-6]) elif len(s)==6: if s[-6:]=="eraser": return True else: return False elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False else: return False if check(s): print("Yes") else: print("No")
s507684447
p03854
u780962115
1571709979
Python
Python (3.4.3)
py
Runtime Error
17
2940
835
s=input() def check(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": return check(s[:-5]) elif s[-7:]=="dreamer": return check(s[:-7]) elif s[-6:]=="eraser": return check(s[:-6]) elif len(s)==6: if s[-6:]=="eraser": return True else: return False elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False else: return False if check(s): print("Yes") else: print("No")
s917234800
p03854
u780962115
1571709814
Python
Python (3.4.3)
py
Runtime Error
122
98524
646
s=input() def check(s): if s=="": return True else: if len(s)>=7: if s[-5:]=="dream" or s[-5:]=="erase": return check(s[:-5]) elif s[-7:]=="dreamer": return check(s[:-7]) elif s[-6:]=="eraser": return check(s[:-6]) elif len(s)==6: if s[-6:]=="eraser": return True elif len(s)==5: if s[-5:]=="dream" or s[-5:]=="erase": return True else: return False if check(s): print("Yes") else: print("No")
s450337156
p03854
u047816928
1570736170
Python
Python (3.4.3)
py
Runtime Error
125
98480
304
def dividable(S): return ((S[:5]=='dream' and dividable(S[5:])) or (S[:7]=='dreamer' and dividable(S[7:])) or (S[:5]=='erase' and dividable(S[5:])) or (S[:6]=='eraser' and dividable(S[6:])) or (S=='')) print('YES' if dividable(input()) else 'NO')
s866069458
p03854
u494058663
1570478697
Python
Python (3.4.3)
py
Runtime Error
61
4084
676
S = list(input()) tmp = '' L = len(S) S.append('0') S.append('0') ans = 0 for i in range(L): tmp += str(S[i]) if tmp=='dream': if tmp+str(S[i+1])+str(S[i+2])+str(S[i+3])=='dreamera': ans += len(tmp) tmp = '' elif tmp+str(S[i+1])+str(S[i+2])=='dreamer': ans += len(tmp)+2 tmp = '' i+=2 else: ans += len(tmp) tmp = '' if tmp == 'erase': if tmp+str(S[i+1])=='eraser': ans += len(tmp)+1 tmp = '' i+=1 else: ans += len(tmp) tmp = '' if ans == L: print('YES') else: print('NO')
s611539552
p03854
u690781906
1570194452
Python
Python (3.4.3)
py
Runtime Error
17
3188
55
a = input().split() print(a[0][0] + a[1][0] + a[2][0])
s143452273
p03854
u322354465
1570167984
Python
Python (3.4.3)
py
Runtime Error
78
4212
631
def erase_check(i, s): if s[i:i + 5] == 'erase': i_next = erase_check(i + 5, s) if i_next == i + 5 and s[i_next] == 'r': return s_check(i_next + 1, s) else: return s_check(i_next, s) else: return i def s_check(i, s): if s[i:i + 5] == 'dream': i_next = erase_check(i + 5, s) if i_next == i + 5 and s[i_next:i_next + 2] == 'er': return s_check(i_next + 2, s) else: return s_check(i_next, s) else: return erase_check(i, s) s = input() if s_check(0, s) == len(s): print("YES") else: print("NO")
s414597549
p03854
u526459074
1569814353
Python
Python (3.4.3)
py
Runtime Error
125
98648
429
s = input() wordList =[ "eraser", "erase","dreamer", "dream"] ansList = [] def ansFunc(s1, ansList): #ansCount = 0 for w in wordList: #print(s1, w) if s1.startswith(w): s2 = s1.replace(w, "",1) if s2 == '': print("YES") ansList.append(1) else: ansFunc(s2, ansList) ansFunc(s, ansList) if len(ansList) ==0: print("NO")
s727474623
p03854
u526459074
1569814121
Python
Python (3.4.3)
py
Runtime Error
126
98648
429
s = input() wordList =[ "eraser", "erase","dreamer", "dream"] ansList = [] def ansFunc(s1, ansList): #ansCount = 0 for w in wordList: #print(s1, w) if s1.startswith(w): s2 = s1.replace(w, "",1) if s2 == '': print("YES") ansList.append(1) else: ansFunc(s2, ansList) ansFunc(s, ansList) if len(ansList) ==0: print("NO")
s824433738
p03854
u526459074
1569812643
Python
Python (3.4.3)
py
Runtime Error
19
3188
437
s = input() wordList = ['dream', 'dreamer', 'erase', 'eraser'] ansCount = 0 def ansFunc(s1, ansCount): for w in wordList: #print(s1, w) if s1.startswith(w): s2 = s1.replace(w, "") if s2 == '': print("YES") ansCount += 1 return ansCount else: ansCount = ansFunc(s2, ansCount) ansCount=ansFunc(s, ansCount) #print("NO")
s091080225
p03854
u526459074
1569811041
Python
Python (3.4.3)
py
Runtime Error
19
3316
409
s = input() wordList = ['dream', 'dreamer', 'erase', 'eraser'] ansCount = 0 def ansFunc(s1): for w in wordList: if s1.startswith(w): s1 = s1.replace(w, "") print(s1) if s1 == '': print("seikou") ansCount += 1 else: ansFunc(s1) ansFlg = ansFunc(s) if ansFlg != 0: print("YES") else: print("NO")
s290875534
p03854
u297651868
1569550431
Python
Python (3.4.3)
py
Runtime Error
77
4116
360
s=input() d='dream' dr='dreamer' e='erase' er='eraser' l=len(s) def solve(s,end): if end==-1: print('YES') exit(0) if s[end-6:end+1]==dr: end-=7 elif s[end-5:end+1]==er: end-=6 elif s[end-4:end+1]==e or s[end-4:end+1]==d: end-=5 else: print('NO') exit(0) solve(s,end) solve(s,l-1)
s018896937
p03854
u982471399
1569278733
Python
Python (3.4.3)
py
Runtime Error
17
3064
411
s=str(input()) words=["dream", "dreamer", "erase", "eraser"] N=max(len(words[0]),len(words[1]),len(words[2]),len(words[3])) flag=0 while len(s)>=0: pos0=s[-N:].rfind(words[0]) pos1=s[-N:].rfind(words[1]) pos2=s[-N:].rfind(words[2]) pos3=s[-N:].rfind(words[3]) m=max(pos0,pos1,pos2,pos3) if m==-1: flag=1 break else: pos=N-m s=s[:-pos] if flag=1: print("NO") else: print("YES")
s059518882
p03854
u886747123
1568526083
Python
Python (3.4.3)
py
Runtime Error
81
6892
331
S_input = str(input()) add_str_tuple = ("dream", "dreamer", "erase", "eraser") def recur_add(T): if T == S_input: print("YES") exit() else: if S_input.startswith(T): for word in add_str_tuple: recur_add(T+word) else: return recur_add("") print("NO")
s354163692
p03854
u886747123
1568525497
Python
Python (3.4.3)
py
Runtime Error
84
6900
378
S_input = str(input()) add_str_taple = ("dream", "dreamer", "erase", "eraser") def recur_add(T): if T == S_input: print("YES") exit() elif len(T) < len(S_input): if S_input.startswith(T): for word in add_str_taple: recur_add(T+word) else: return else: return recur_add("") print("NO")
s884343881
p03854
u886747123
1568524641
Python
Python (3.4.3)
py
Runtime Error
81
6892
336
S_input = str(input()) add_str_taple = ("dream", "dreamer", "erase", "eraser") def recur_add(T): if T == S_input: print("YES") exit() else: if S_input.startswith(T): for word in add_str_taple: recur_add(T+word) else: return None recur_add("") print("NO")
s846925376
p03854
u886747123
1568523515
Python
Python (3.4.3)
py
Runtime Error
82
6896
331
S_input = str(input()) add_str_taple = ("dream", "dreamer", "erase", "eraser") def recur_add(T): if T == S_input: print("YES") exit() else: if S_input.startswith(T): for word in add_str_taple: recur_add(T+word) else: return recur_add("") print("NO")
s306111782
p03854
u886747123
1568523026
Python
Python (3.4.3)
py
Runtime Error
80
6892
331
S_input = str(input()) add_str_taple = ("dream", "dreamer", "erase", "eraser") def recur_add(T): if T == S_input: print("YES") exit() else: if S_input.startswith(T): for word in add_str_taple: recur_add(T+word) else: return recur_add("") print("NO")
s245360172
p03854
u170324846
1568509836
Python
Python (3.4.3)
py
Runtime Error
123
98608
341
def f(S,L): if not L: return True if L >= 7: if S[-7:] == "dreamer": return f(S[:-7],L-7) if L >= 6: if S[-6:] == "eraser": return f(S[:-6],L-6) if L >= 5: if S[-5:] == "dream" or S[-5:] == "erase": return f(S[:-5],L-5) return False s = input() if f(s, len(s)): print("YES") else: print("NO")
s474974034
p03854
u524870111
1568292353
Python
Python (3.4.3)
py
Runtime Error
131
99232
862
import sys stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] s = ns()[::-1] ans = "YES" def func(spart): if spart[:5] == "maerd": if len(spart) == 5: return "YES" else: return func(spart[5:]) elif spart[:7] == "remaerd": if len(spart) == 7: return "YES" else: return func(spart[7:]) elif spart[:5] == "esare": if len(spart) == 5: return "YES" else: return func(spart[5:]) elif spart[:6] == "resare": if len(spart) == 6: return "YES" else: return func(spart[6:]) else: return "No" print(func(s))
s692225308
p03854
u524870111
1568257630
Python
Python (3.4.3)
py
Runtime Error
126
98512
862
import sys stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] s = ns()[::-1] ans = "YES" def func(spart): if spart[:5] == "maerd": if len(spart) == 5: return "YES" else: return func(spart[5:]) elif spart[:7] == "remaerd": if len(spart) == 7: return "YES" else: return func(spart[7:]) elif spart[:5] == "esare": if len(spart) == 5: return "YES" else: return func(spart[5:]) elif spart[:6] == "resare": if len(spart) == 6: return "YES" else: return func(spart[6:]) else: return "No" print(func(s))
s061306214
p03854
u533039576
1568052435
Python
Python (3.4.3)
py
Runtime Error
126
98632
293
s = input() words = ['dream', 'dreamer', 'erase', 'eraser'] def dfs(t): if t == '': return True ans = False for word in words: if t[:len(word)] == word: ans = ans or dfs(t[len(word):]) return ans if dfs(s): print("YES") else: print("NO")
s728587514
p03854
u869919400
1566745865
Python
Python (3.4.3)
py
Runtime Error
18
2940
246
import re s = input() words = ['dream', 'dreamer', 'erase', 'eraser'] while s != '': tmp = s for word in words: s = re.sub(f'{word}$', '', s) if s == '': print('YES') if tmp == s: print('NO') break
s866789354
p03854
u994988729
1566498108
Python
Python (3.4.3)
py
Runtime Error
121
98512
443
s=input()[::-1] phrase=("dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1]) def dayDream(word): if word[:7] in phrase: return dayDream(word[7:]) elif word[:6] in phrase: return dayDream(word[6:]) elif word[:5] in phrase: return dayDream(word[5:]) if len(word)==0: return True else: return False print("YES") if dayDream(s) else print("NO")
s513022583
p03854
u994988729
1566498007
Python
Python (3.4.3)
py
Runtime Error
130
98512
418
s=input()[::-1] phrase=("dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1]) def dayDream(word): if word[:7] in phrase: return dayDream(word[7:]) elif word[:6] in phrase: return dayDream(word[6:]) elif word[:5] in phrase: return dayDream(word[5:]) if len(word)==0: return True else: return False print(dayDream(s))
s419972803
p03854
u727801592
1566395928
Python
Python (3.4.3)
py
Runtime Error
17
2940
140
s = input() if s.replace('eraser','').replace('erase','').replace('dreamer','').replace('dream','') : print('NO') else: print('YES')
s493233696
p03854
u347640436
1566389248
Python
Python (3.4.3)
py
Runtime Error
17
2940
535
package main import ( "fmt" "strings" ) func main() { var s string fmt.Scanln(&s) r := []rune(s) for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] } words := [][]rune{[]rune("maerd"), []rune("remaerd"), []rune("esare"), []rune("resare")} for { if len(r) == 0 { fmt.Println("YES") return } fail := 0 for _, w := range words { if strings.HasPrefix(r, w) { r = r[len(w):] break } else { fail++ } } if fail == len(words) { fmt.Println("NO") return } } }
s639480122
p03854
u778700306
1566186476
Python
Python (3.4.3)
py
Runtime Error
133
98896
702
import bisect import collections import itertools def getint(): return int(input()) def getints(): return list(map(int, input().split())) def getint2d(rows): return [getints() for _ in range(rows)] def getgrid(rows): return [input() for _ in range(rows)] def array1d(n, value): return [value for _ in range(n)] def array2d(n, m, value): return [array1d(m, value) for _ in range(n)] s=input() words = ["dream","dreamer","erase","eraser"] def solve(s): if not s: return True for w in words: w_len = len(w) if len(s) < w_len: continue if w == s[0:w_len]: if solve(s[w_len:]): return True return False print("YES" if solve(s) else "NO")
s862506504
p03854
u889344512
1565745851
Python
PyPy3 (2.4.0)
py
Runtime Error
287
45040
329
x = input() n = len(x) ans = "NO" def f(i): if n==i: global ans ans = "YES" else: if x[i:i+5] == "dream": f(i+5) if x[i:i+7] == "dreamer": f(i+7) if x[i:i+5] == "erase": f(i+5) if x[i:i+6] == "eraser": f(i+6) f(0) print(ans)
s915403137
p03854
u889344512
1565745558
Python
PyPy3 (2.4.0)
py
Runtime Error
298
45040
329
x = input() n = len(x) ans = "NO" def f(i): if n==i: global ans ans = "YES" else: if x[i:i+5] == "dream": f(i+5) if x[i:i+7] == "dreamer": f(i+7) if x[i:i+5] == "erase": f(i+5) if x[i:i+6] == "eraser": f(i+6) f(0) print(ans)
s911977143
p03854
u925626880
1565744942
Python
PyPy3 (2.4.0)
py
Runtime Error
477
284296
429
s = input() words = {'dream', 'dreamer', 'erase', 'eraser'} def is_prefix_daydream(s, prefix): if s == prefix: return True elif s.startswith(prefix): return is_daydream(s[len(prefix):]) else: return False def is_daydream(s): if s == '': return True else: return any(is_prefix_daydream(s, w) for w in words) if is_daydream(s): print('YES') else: print('NO')
s290354582
p03854
u925626880
1565744830
Python
Python (3.4.3)
py
Runtime Error
94
36236
429
s = input() words = {'dream', 'dreamer', 'erase', 'eraser'} def is_prefix_daydream(s, prefix): if s == prefix: return True elif s.startswith(prefix): return is_daydream(s[len(prefix):]) else: return False def is_daydream(s): if s == '': return True else: return any(is_prefix_daydream(s, w) for w in words) if is_daydream(s): print('YES') else: print('NO')
s496037394
p03854
u360116509
1565639459
Python
Python (3.4.3)
py
Runtime Error
78
4116
264
S = input() targets = ['dream', 'dreamer', 'erase', 'eraser'] def fn(i): if i == 0: print('YES') exit() for tg in targets: if S[i - len(tg):i][::-1] == tg[::-1]: fn(i - len(tg)) print('No') exit() fn(len(S))
s603439475
p03854
u360116509
1565637706
Python
Python (3.4.3)
py
Runtime Error
77
4172
238
S = input() targets = ['dream', 'dreamer', 'erase', 'eraser'] def fn(i): if len(S) == i: print('YES') exit() for tg in targets: if S[i: i + len(tg)] == tg: fn(i + len(tg)) fn(0) print('No')
s392562469
p03854
u092278825
1565620941
Python
Python (3.4.3)
py
Runtime Error
25
4212
1547
s = input() S = [s[i] for i in range(len(s))] a = input() def flag(list_s): flag_yes = True if len(list_s)<=4: flag_yes=False else: flag_dreamer = False while len(list_s)>0 and flag_yes: #listใŒ็ฉบใงใชใใ€ใพใ ๆกไปถใ‚’ๆบ€ใŸใ—ใฆใ„ใ‚‹ๆ™‚ if flag_dreamer and len(list_s)>=4 and list_s[:4]==['a','s','e','r']: #dreameraser list_s = list_s[4:] flag_dreamer=False elif flag_dreamer and len(list_s)>=3 and list_s[:3]==['a','s','e']: #dreamerase list_s = list_s[3:] flag_dreamer=False elif len(list_s)>=5 and list_s[0:5]==['e','r','a','s','e']: #eraseใพใŸใฏeraserใชใ‚‰ๆถˆๅŽปใ—ใฆๅˆๆœŸๅŒ– flag_dreamer=False list_s = list_s[5:] if len(list_s)>0 and list_s[0]=='r': list_s = list_s[1:] elif list_s == ['d', 'r', 'e', 'a', 'm']: #[dream]ใชใ‚‰ๅ…จๆถˆๅŽป flag_dreamer=False list_s = list_s[5:] elif len(list_s)>=6 and list_s[:6]==['d', 'r', 'e', 'a', 'm', 'd']: #dreamdream or dreamdreamerใชใ‚‰ๅ‰ๅŠๆถˆๅŽป flag_dreamer=False list_s = list_s[5:] elif len(list_s)>=7 and list_s[:7]==['d', 'r', 'e', 'a', 'm', 'e', 'r']: #dreamerใŒ้ขๅ€’ flag_dreamer=True list_s = list_s[7:] else: flag_yes = False return flag_yes if flag(S): print('YES') else: print('No')
s188207589
p03854
u092278825
1565620901
Python
Python (3.4.3)
py
Runtime Error
25
4096
1547
s = input() S = [s[i] for i in range(len(s))] a = input() def flag(list_s): flag_yes = True if len(list_s)<=4: flag_yes=False else: flag_dreamer = False while len(list_s)>0 and flag_yes: #listใŒ็ฉบใงใชใใ€ใพใ ๆกไปถใ‚’ๆบ€ใŸใ—ใฆใ„ใ‚‹ๆ™‚ if flag_dreamer and len(list_s)>=4 and list_s[:4]==['a','s','e','r']: #dreameraser list_s = list_s[4:] flag_dreamer=False elif flag_dreamer and len(list_s)>=3 and list_s[:3]==['a','s','e']: #dreamerase list_s = list_s[3:] flag_dreamer=False elif len(list_s)>=5 and list_s[0:5]==['e','r','a','s','e']: #eraseใพใŸใฏeraserใชใ‚‰ๆถˆๅŽปใ—ใฆๅˆๆœŸๅŒ– flag_dreamer=False list_s = list_s[5:] if len(list_s)>0 and list_s[0]=='r': list_s = list_s[1:] elif list_s == ['d', 'r', 'e', 'a', 'm']: #[dream]ใชใ‚‰ๅ…จๆถˆๅŽป flag_dreamer=False list_s = list_s[5:] elif len(list_s)>=6 and list_s[:6]==['d', 'r', 'e', 'a', 'm', 'd']: #dreamdream or dreamdreamerใชใ‚‰ๅ‰ๅŠๆถˆๅŽป flag_dreamer=False list_s = list_s[5:] elif len(list_s)>=7 and list_s[:7]==['d', 'r', 'e', 'a', 'm', 'e', 'r']: #dreamerใŒ้ขๅ€’ flag_dreamer=True list_s = list_s[7:] else: flag_yes = False return flag_yes if flag(S): print('YES') else: print('No')
s770469258
p03854
u087474779
1565492214
Python
Python (3.4.3)
py
Runtime Error
149
160152
487
WORDS = ( "dreamer", "eraser", "dream", "erase" ) s = input() result = "NO" targets = [s] def f(input_targets): global result output_targets = [] if len(input_targets) == 0: return for t in input_targets: if t == "": result = "YES" return for word in WORDS: if t.startswith(word): new_target = t[len(word):] output_targets.append(new_target) del input_targets return f(output_targets) _ = f(targets) print(result)
s429991878
p03854
u087474779
1565491437
Python
Python (3.4.3)
py
Runtime Error
155
160156
467
WORDS = ( "dreamer", "eraser", "dream", "erase" ) s = input() result = "NO" targets = [s] def f(input_targets): global result output_targets = [] if len(input_targets) == 0: return for t in input_targets: if t == "": result = "YES" return for word in WORDS: if t.startswith(word): new_target = t[len(word):] output_targets.append(new_target) return f(output_targets) _ = f(targets) print(result)
s502886780
p03854
u087474779
1565491368
Python
Python (3.4.3)
py
Runtime Error
150
160180
462
WORDS = ( "dreamer", "eraser", "dream", "erase" ) s = input() result = "NO" targets = [s] def f(input_targets): global result output_targets = [] if len(input_targets) == 0: return for t in input_targets: if t == "": result = "YES" return for word in WORDS: if t.startswith(word): new_target = t[len(word):] output_targets.append(new_target) return f(output_targets) f(targets) print(result)
s504922844
p03854
u087474779
1565491084
Python
Python (3.4.3)
py
Runtime Error
236
160284
467
WORDS = ( "dreamer", "eraser", "dream", "erase" ) s = input() result = "NO" targets = set([s]) def f(input_targets): global result output_targets = set() if len(input_targets) == 0: return for t in input_targets: if t == "": result = "YES" return for word in WORDS: if t.startswith(word): new_target = t[len(word):] output_targets.add(new_target) return f(output_targets) f(targets) print(result)
s549955425
p03854
u460878159
1565388659
Python
Python (3.4.3)
py
Runtime Error
43
3316
981
S=input() l=len(S) r=0 list5 = ['dream', 'erase'] list81 = ['dreamdre', 'dreamera', 'erasedre', 'eraseera'] list82 = ['dreamerd', 'dreamere'] list83 = ['eraserdr', 'eraserer'] if l<=4: print(NO) while l>=5: if S[r:r+5] in list5: if r+5==l: print(YES) break elif r+5 == l-1: if S[r:r+6] == 'eraser': print(YES) else: print(NO) break elif r+5 == l-2: if S[r:r+7] == 'dreamer': print(YES) else: print(NO) break elif r+5 == l-3 or r+5 == l-4: print(NO) break else: if S[r:r+8] in list81: r=r+5 elif S[r:r+8] in list82: r=r+7 elif S[r:r+8] in list83: r=r+6 else: print(NO) break else: print(NO) break
s144846030
p03854
u763917092
1565120965
Python
Python (3.4.3)
py
Runtime Error
19
3188
135
S=input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","") if s: print("NO") else: print("YES")
s238692129
p03854
u729217226
1565112898
Python
Python (3.4.3)
py
Runtime Error
33
3188
252
S = str(input()) str_list = ['dream', 'dreamer', 'erase', 'eraser'] dp = [0] * 10000 for i in range(len(S)): for s in str_list: if S[i:i+len(s)] == s: dp[i+len(s)] = 1 if dp[len(S)] == 1: print('YES') else: print('NO')
s508806837
p03854
u729217226
1565112820
Python
Python (3.4.3)
py
Runtime Error
18
3060
235
str_list = ['dream', 'dreamer', 'erase', 'eraser'] dp = [0] * 10000 for i in range(len(S)): for s in str_list: if S[i:i+len(s)] == s: dp[i+len(s)] = 1 if dp[len(S)] == 1: print('YES') else: print('NO')
s912193865
p03854
u729217226
1565112672
Python
Python (3.4.3)
py
Runtime Error
18
3828
236
str_list = ['dream', 'dreamer', 'erase', 'eraser'] dp = [0] * 100000 for i in range(len(S)): for s in str_list: if S[i:i+len(s)] == s: dp[i+len(s)] = 1 if dp[len(S)] == 1: print('YES') else: print('NO')
s423501996
p03854
u427653900
1565105519
Python
Python (3.4.3)
py
Runtime Error
77
4196
296
import sys s = sys.stdin.read().strip() words = ["dream", "dreamer", "erase", "eraser"] def dfs(i): for w in words: if s.startswith(w, i): n = i + len(w) if n == len(s): return True if dfs(n): return True return False print("YES" if dfs(0) else "NO")
s707982319
p03854
u427653900
1565105007
Python
Python (3.4.3)
py
Runtime Error
76
4296
264
import sys s = sys.stdin.read().strip() words = ["dream", "dreamer", "erase", "eraser"] def dfs(i): for w in words: if s.startswith(w, i): n = i + len(w) if n == len(s): print("YES") sys.exit(0) dfs(n) dfs(0) print("NO")
s535027700
p03854
u522375638
1564933057
Python
Python (3.4.3)
py
Runtime Error
17
3188
205
S = input() for k in range(len(S)/5): for word in ["dream", "dreamer", "erase", "eraser"]: if S.endswith(word): S=S.rstrip(word) if len(S)==0: print("YES") else: print("NO")
s523061302
p03854
u027165539
1564765748
Python
Python (3.4.3)
py
Runtime Error
18
3188
367
S = input() words = ['dream', 'dreamer', 'erase', 'eraser'] while len(S) > 0: judge = [S.endwith(w) for w in words] # ้€†ใ‹ใ‚‰่€ƒใˆใ‚‹ใ“ใจใงๅ˜่ชžใฎ้‡่ค‡ใ‚’ใชใใ™ใฎใŒใƒใ‚คใƒณใƒˆ๏ผ if any(judge): hit_word = words[judge.index(True)] S = S[:-len(hit_words)] if len(S) == 0: print('YES') break else: print('NO') break
s990265982
p03854
u727760796
1564765614
Python
Python (3.4.3)
py
Runtime Error
126
98652
647
INPUT_STR = input() match_patterns = [ ''.join(list(reversed('dream'))), ''.join(list(reversed('dreamer'))), ''.join(list(reversed('erase'))), ''.join(list(reversed('eraser'))) ] reversed_input = ''.join(list(reversed(INPUT_STR))) def is_concatted_string(string: str): if len(string) == 0: return True else: for pattern in match_patterns: if string.startswith(pattern): string = string[len(pattern):] return is_concatted_string(string) return False if INPUT_STR != '' and is_concatted_string(reversed_input): print("YES") else: print("NO")
s676670838
p03854
u727760796
1564765409
Python
Python (3.4.3)
py
Runtime Error
125
98652
626
INPUT_STR = input() match_patterns = [ ''.join(list(reversed('dream'))), ''.join(list(reversed('dreamer'))), ''.join(list(reversed('erase'))), ''.join(list(reversed('eraser'))) ] reversed_input = ''.join(list(reversed(INPUT_STR))) def is_concatted_string(string: str): if len(string) == 0: return True else: for pattern in match_patterns: if string.startswith(pattern): string = string[len(pattern):] return is_concatted_string(string) if INPUT_STR != '' and is_concatted_string(reversed_input): print("YES") else: print("NO")
s970381008
p03854
u727760796
1564764814
Python
Python (3.4.3)
py
Runtime Error
123
98648
606
INPUT_STR = input() match_patterns = [ ''.join(list(reversed('dream'))), ''.join(list(reversed('dreamer'))), ''.join(list(reversed('erase'))), ''.join(list(reversed('eraser'))) ] reversed_input = ''.join(list(reversed(INPUT_STR))) def is_concatted_string(string: str): if len(string) == 0: return True else: for pattern in match_patterns: if string.startswith(pattern): string = string[len(pattern):] return is_concatted_string(string) if is_concatted_string(reversed_input): print("YES") else: print("NO")
s152585944
p03854
u677523557
1564626889
Python
PyPy3 (2.4.0)
py
Runtime Error
288
45424
672
S = input() N = len(S) def dream(k): if k == N: return True if S[k] == 'd': if k+7 <= N: if S[k:k+7] == 'dreamer': if dream(k+7): return True if k+5 <= N: if S[k:k+5] == 'dream': if dream(k+5): return True elif S[k] == 'e': if k+6 <= N: if S[k:k+6] == 'eraser': if dream(k+6): return True if k+5 <= N: if S[k:k+5] == 'erase': if dream(k+5): return True return False a = dream(0) if a: print('YES') else: print('NO')
s056627269
p03854
u677523557
1564626432
Python
Python (3.4.3)
py
Runtime Error
76
4068
672
S = input() N = len(S) def dream(k): if k == N: return True if S[k] == 'd': if k+7 <= N: if S[k:k+7] == 'dreamer': if dream(k+7): return True if k+5 <= N: if S[k:k+5] == 'dream': if dream(k+5): return True elif S[k] == 'e': if k+6 <= N: if S[k:k+6] == 'eraser': if dream(k+6): return True if k+5 <= N: if S[k:k+5] == 'erase': if dream(k+5): return True return False a = dream(0) if a: print('YES') else: print('NO')
s175080300
p03854
u074230519
1564090106
Python
Python (3.4.3)
py
Runtime Error
17
2940
195
# -*- coding: utf-8 -*- # ๆ•ดๆ•ฐใฎๅ…ฅๅŠ› S = input() S.replace('dream','') S.replace('dreamer','') S.replace('erase','') S.replace('eraser','') if len(S) = 0: print('YES') else: print('NO')
s628262713
p03854
u201660334
1564089409
Python
Python (3.4.3)
py
Runtime Error
91
3188
394
s = input() flag = True while s: if s[0:5] == "dream": s = s[5:] if s[0:2] == "er": if s[0:5] != "erase": s = s[2:] elif s[0:5] == "erase": s = s[5:] if s[0] == "r": if s[0:5] != "erase": s = s[1:] else: flag = False break if flag == True: print("YES") else: print("NO")
s692170622
p03854
u920391637
1563803896
Python
Python (3.4.3)
py
Runtime Error
17
2940
89
import re print("YES" if re.match("^(dream|dreamer|erase|eraser)+$"), input() else "NO")
s693915852
p03854
u428397309
1563772757
Python
Python (3.4.3)
py
Runtime Error
18
3188
250
# -*- coding: utf-8 -*- N = int(input()) A = list(map(int, input().split())) ans = 0 new_a = A.copy() while 1: new_a = [a // 2 if a % 2 == 0 else -1 for a in new_a] if -1 in new_a: print(ans) exit() ans += 1 print(ans)
s914451446
p03854
u057415180
1563738672
Python
Python (3.4.3)
py
Runtime Error
17
3188
300
daydream = ['reamd','reamerd','rasee','rasere'] S = input() S = strip(S[0]) if 'reamd' in S: S = S.strip('reamed') if 'reamrd' in S: S = S.strip('reamerd') if 'rasee' in S: S = S.strip('rasee') if 'rasere' in S: S = S.strip('rasere') if not str: print('NO') else: print('YES')
s152519289
p03854
u567434159
1563585362
Python
Python (3.4.3)
py
Runtime Error
17
3188
212
suf = ["dream", "dreamer", "erase", "eraser"] s = input() i = 0 while i < len(s): nx = s[i:i+5] if nx != suf[0] and nx != suf[2]: print("NO") exit(0) i += 5 if s[i] == 'r': i += 1 print("YES")
s911769911
p03854
u567434159
1563585313
Python
Python (3.4.3)
py
Runtime Error
18
2940
224
suf = ["dream", "dreamer", "erase", "eraser"] s = input() i = 0 while i < len(s): nx = s[i:i+5] if nx != suf[0] and nx != suf[2]: print("NO") exit(0) i += 5 if s[i] == 'r': i += 1 print("YES")
s724116505
p03854
u921773161
1563247408
Python
Python (3.4.3)
py
Runtime Error
288
3956
643
S = input() S_list = list(S) while len(S_list) >= 5 : if S_list[0:5] == ['e', 'r', 'a', 's', 'e']: if S_list[5] == 'r' and len(S_list) >= 6: del S_list[0:6] else: del S_list[0:5] elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']: if S_list[5:8] == ['e', 'r', 'a'] and len(S_list) >= 8: del S_list[0:5] elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a'] and len(S_list) >= 8: del S_list[0:7] else : del S_list[0:5] else: print('NO') break if len(S_list) == 0: print('YES') elif 0<len(S_list)<5: print('NO')
s107158245
p03854
u921773161
1563247284
Python
Python (3.4.3)
py
Runtime Error
286
3956
580
S = input() S_list = list(S) while len(S_list) >= 5 : if S_list[0:5] == ['e', 'r', 'a', 's', 'e']: if S_list[5] == 'r': del S_list[0:6] else: del S_list[0:5] elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']: if S_list[5:8] == ['e', 'r', 'a']: del S_list[0:5] elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a']: del S_list[0:7] else : del S_list[0:5] else: print('NO') break if len(S_list) == 0: print('YES') elif 0<len(S_list)<5: print('NO')
s004774439
p03854
u921773161
1563247209
Python
Python (3.4.3)
py
Runtime Error
286
3956
580
S = input() S_list = list(S) while len(S_list) >= 5 : if S_list[0:5] == ['e', 'r', 'a', 's', 'e']: if S_list[5] == 'r': del S_list[0:6] else: del S_list[0:5] elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']: if S_list[5:8] == ['e', 'r', 'a']: del S_list[0:5] elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a']: del S_list[0:7] else : del S_list[0:5] else: print('No') break if len(S_list) == 0: print('Yes') elif 0<len(S_list)<5: print('No')
s518736764
p03854
u646130340
1563072362
Python
Python (3.4.3)
py
Runtime Error
17
2940
14
print("No")
s638167093
p03854
u646130340
1563072093
Python
Python (3.4.3)
py
Runtime Error
178
134580
356
S = input() r_S = S[::-1] devide = ["dream", "dreamer", "erase", "eraser"] r_devide = [d[::-1] for d in devide] string = r_S while string != '': can = False for d in r_devide: if string[:len(d)] == d: can = True string = string[len(d):] print(string) if can == False: break if can: print("Yes") else: print("No")
s449234738
p03854
u083195091
1562544158
Python
Python (3.4.3)
py
Runtime Error
186
134368
547
import sys msg = str(input()) # ้€†ใ‹ใ‚‰ใ€ๅคงใใ„ๆ–‡ๅญ—ๆ•ฐใ‹ใ‚‰ใ€่ฆ‹ใฆใ„ใ‘ใฐ้‡่ค‡ใฏ็”Ÿใ˜ใชใ„ len_l1 = 0 while len(msg) != len_l1: len_l1 = len(msg) print(msg) # dreamer if msg[-7:] == "dreamer": msg = msg[:-7] # eraser if msg[-6:] == "eraser": msg = msg[:-6] # dreame if msg[-5:] == "dream": msg = msg[:-5] # erase if msg[-5:] == "erase": msg = msg[:-5] if len(msg) == 0: print('YES') sys.exit() print('NO')