// Design Log Storage System class LogSystem { unordered_map a; public: void put(int id, string timestamp) { a[id] = timestamp; } vector retrieve(string s, string e, string gra) { vector gs{"Year", "Month", "Day", "Hour", "Minute", "Second"}; int i = find(gs.begin(), gs.end(), gra)-gs.begin(); s = s.substr(0, 4+3*i); e = e.substr(0, 4+3*i); for (; i < 5; i++) s += ":00", e += ":99"; vector r; for (auto& x: a) if (s <= x.second && x.second <= e) r.push_back(x.first); return r; } };