Skip to content

Instantly share code, notes, and snippets.

// https://leetcode.com/problems/lfu-cache/
struct CacheItem;
typedef list<CacheItem *> CounterList;
typedef map<int, CounterList> CounterMap;
struct CacheItem {
int key, value, cnt=1;
typename CounterMap::iterator mapIter;
typename CounterList::iterator listIter;
};
set history save on
set history expansion on
set history size 999
set $perl = 0
set $ctx = 0
define getperl
if $ctx == 0
set $ctx = Perl_get_context()
end
autodetach on # default: on
startup_message off # default: on
multiuser on
defscrollback 16384 # default: 100
silencewait 15 # default: 30
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
caption always "%{cK}%H %{bK}(%d/%m/%Y, %c) %{-}%{bW} %-w%{bW}%50>%{= wb}%n%f %t%{-}%+w%< %{-}"
bind k kill
msgwait 15
defutf8 on