Submission #2202670


Source Code Expand

Copy
S = input()[::-1]
pu = "dreamer"[::-1]
po = "eraser"[::-1]
word = list(map(lambda s:s[::-1], ["dream", "erase"]))

ans = True
i = 0
while i < len(S):
    if S[i:i+7] == pu:
        i += 7
    elif S[i:i+6] == po:
        i += 6
    elif S[i:i+5] in word:
        i += 5
    else:
        ans = False
        break

print("YES") if ans else print("NO")

Submission Info

Submission Time
Task ABC049C - 白昼夢 / Daydream
User xecua
Language Python3 (3.4.3)
Score 300
Code Size 371 Byte
Status
Exec Time 31 ms
Memory 3188 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
All 300 / 300 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt
Case Name Status Exec Time Memory
subtask0_0.txt 17 ms 3064 KB
subtask0_1.txt 17 ms 3060 KB
subtask0_2.txt 17 ms 3064 KB
subtask1_0.txt 25 ms 3188 KB
subtask1_1.txt 26 ms 3188 KB
subtask1_10.txt 31 ms 3188 KB
subtask1_11.txt 28 ms 3188 KB
subtask1_12.txt 28 ms 3188 KB
subtask1_13.txt 28 ms 3188 KB
subtask1_14.txt 22 ms 3188 KB
subtask1_15.txt 25 ms 3188 KB
subtask1_2.txt 19 ms 3188 KB
subtask1_3.txt 29 ms 3188 KB
subtask1_4.txt 27 ms 3188 KB
subtask1_5.txt 28 ms 3188 KB
subtask1_6.txt 30 ms 3188 KB
subtask1_7.txt 27 ms 3188 KB
subtask1_8.txt 28 ms 3188 KB
subtask1_9.txt 30 ms 3188 KB