class Solution { private: int capacity; // 双向链表存储键值对,保持访问顺序,O(1) 时间插入删除 // int key, int value list<pair<int, int>> items; // 哈希表 O(1) 时间快速访问 // int key, iterator value unordered_map<int, list<pair<int, int>>::iterator> cache; public: Sol...