Buggy python submission (verdict: Time Limit Exceeded):
import queue
divide=["dream","dreamer","erase","eraser"]
S=input()
q=queue.Queue()
q.put(0)
can=False
while not q.empty():
        t=q.get()
        q.get()
        if t==len(S): 
                can=True
                break
        for s in divide:
                if S[t:t+len(S)]==s:
                        q.put(t+len(s))
print("YES") if can else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
def dfs(n):
        divide=["dream","dreamer","erase","eraser"]
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if s[n:n+len(i)]==i:
                                if dfs(n+len(i)):
                                        return True

        return False
s=input()
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
def dfs(n):
        divide=["dream","erase","eraser","dreamer"]
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if s[n:n+len(i)]==i:
                                if dfs(n+len(i)):
                                        return True

        return False
s=input()
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
def dfs(n):
        divide=["dream","erase","eraser","dreamer"]
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)])==i:
                                if dfs(n+len(i)):
                                        return True

        return False
s=list(input())
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)])==i:
                                if dfs(n+len(i)):
                                        return True

        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)]):
                                if dfs(n+len(i)):return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)]):
                                if dfs(n+len(i)):
                                        return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):
                return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)])==i:
                                if dfs(n+len(i)):
                                        return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):
                return True
        for i in divide:
                tmp="".join(s[n:n+len(i)])
                if n+len(i)<=len(s) and tmp==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                tmp="".join(s[n:n+len(i)])
                if n+len(i)<=len(s) and tmp==i:
                        if dfs(n+len(i)):
                                return True
        return False
if dfs(0):
        print("YES")
else:
        print("NO")
#print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                tmp="".join(s[n:n+len(i)])
                if n+len(i)<=len(s) and tmp==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=input()
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                if n+len(i)<=len(s) and "".join(s[n:n+len(i)])==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                if n+len(i)<=len(s) and "".join(s[n:n+len(i)])==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                if n+len(i)<=len(s) and "".join(s[n:n+len(i)])==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                if n+len(i)<=len(s) and "".join(s[n:n+len(i)])==i:
                        if dfs(n+len(i)):
                                print(n)
                                return True
        return False
print("YES") if dfs(0) else print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")

Buggy python submission (verdict: Runtime Error):
s=input().replace("erase","").replace("dream",""),replace("eraser","").replace("dreamer","")
if s in "":
    print("YES")
else:
    print("NO")


Fixed submission:
s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")