Submission #2202464


Source Code Expand

Copy
#include <iomanip>
#include <random>
#include <time.h>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <cstdlib>
#include <typeinfo>
#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int main() {
	string s, a, b, c, d, e, f;
	cin >> s;
	ll cnt = 0, i = 0;
	a = "dream", b = "dreamer", c = "erase", d = "eraser", e = "dreameraser", f = "dreamerase";
	while (1) {
		if (i == s.size()) {
			cout << "YES" << endl;
			return 0;
		}
		if (s.substr(i, 11) == e) i += 11;
		else if (s.substr(i, 10) == f) i += 10;
		else if (s.substr(i, 7) == b) i += 7;
		else if (s.substr(i, 5) == a) i += 5;
		else if (s.substr(i, 6) == d) i += 6;
		else if (s.substr(i, 5) == c) i += 5;
		else {
			cout << "NO" << endl;
			return 0;
		}
	}
	return 0;
}

Submission Info

Submission Time
Task ABC049C - 白昼夢 / Daydream
User littlegirl112
Language C++14 (GCC 5.4.1)
Score 300
Code Size 898 Byte
Status
Exec Time 12 ms
Memory 512 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 1 ms 256 KB
subtask0_1.txt 1 ms 256 KB
subtask0_2.txt 1 ms 256 KB
subtask1_0.txt 5 ms 512 KB
subtask1_1.txt 7 ms 512 KB
subtask1_10.txt 8 ms 512 KB
subtask1_11.txt 12 ms 512 KB
subtask1_12.txt 8 ms 512 KB
subtask1_13.txt 8 ms 512 KB
subtask1_14.txt 6 ms 512 KB
subtask1_15.txt 6 ms 512 KB
subtask1_2.txt 9 ms 512 KB
subtask1_3.txt 8 ms 512 KB
subtask1_4.txt 5 ms 512 KB
subtask1_5.txt 8 ms 512 KB
subtask1_6.txt 4 ms 512 KB
subtask1_7.txt 5 ms 512 KB
subtask1_8.txt 8 ms 512 KB
subtask1_9.txt 8 ms 512 KB