看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) linux 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) g++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) bits/stdc++.h 問題(Question): 學校作業實作LFU 我是用set維護reference count最小值的資料結構 Hash 儲存reference count 餵入的資料(Input): 較長不知道怎麼提供 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 一千萬筆資料多了二十萬筆miss 程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔) https://ideone.com/GejpWw 補充說明(Supplement): 有用double hash維護最小reference做是正確的 但是不太清楚為什麼用set的結果會有錯誤 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.231.50 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1637743882.A.61B.html
gogogofuxk: 需要移除元素時,有多個元素的頻率皆為最小值的預期 11/24 18:24
gogogofuxk: 行為是? 11/24 18:24
ars0921: 對寫到page number小優先了 11/24 20:47
ars0921: 剛剛自訂set多加sequence number就過了 感謝 11/24 20:48