第一題說明

來源: 亂彈 2009-05-09 17:15:29 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (233 bytes)
應該是假定有個 map < int, bool > 來表示房間的狀態,這個 map 是由別的程序建立和修改的。 問題的要求是輸出所有沒打掃房間的號碼。這個工作要做很多次,所以要設法降低平均運算時間。

題目都是很簡單的,高手應該立馬就有比較好的方法。

所有跟帖: 

還是這個難阿。水平很差,想不到好辦法 -feicen- 給 feicen 發送悄悄話 (296 bytes) () 05/09/2009 postreply 17:42:01

你功底蠻好的。這個 map 可以認為是每天早上建立的,這樣就簡單了。 -亂彈- 給 亂彈 發送悄悄話 亂彈 的博客首頁 (0 bytes) () 05/09/2009 postreply 17:44:28

回複:第一題說明 -GoldIsGold- 給 GoldIsGold 發送悄悄話 (165 bytes) () 05/09/2009 postreply 17:52:05

不錯不錯。 -feicen- 給 feicen 發送悄悄話 (0 bytes) () 05/09/2009 postreply 17:54:16

能否詳細說明一下,或者給出偽代碼?學習學習 -feicen- 給 feicen 發送悄悄話 (0 bytes) () 05/09/2009 postreply 17:56:43

回複:能否詳細說明一下,或者給出偽代碼?學習學習 -GoldIsGold- 給 GoldIsGold 發送悄悄話 (449 bytes) () 05/09/2009 postreply 18:28:15

有待仔細考慮。尤其是對"big hotel"的case,有huge number of rooms. -戲雨飛鷹- 給 戲雨飛鷹 發送悄悄話 戲雨飛鷹 的博客首頁 (66 bytes) () 05/10/2009 postreply 11:48:07

樓上2位好厲害!PF:)。 -戲雨飛鷹- 給 戲雨飛鷹 發送悄悄話 戲雨飛鷹 的博客首頁 (0 bytes) () 05/09/2009 postreply 17:58:30

yeah, this is good -hello2- 給 hello2 發送悄悄話 hello2 的博客首頁 (0 bytes) () 05/09/2009 postreply 18:40:40

回複:回複:第一題說明 -spear123- 給 spear123 發送悄悄話 (216 bytes) () 05/10/2009 postreply 18:06:06

能給個具體的算法嗎?(或是map,或是array都可以) -戲雨飛鷹- 給 戲雨飛鷹 發送悄悄話 戲雨飛鷹 的博客首頁 (0 bytes) () 05/10/2009 postreply 11:43:24

Just a sample -亂彈- 給 亂彈 發送悄悄話 亂彈 的博客首頁 (499 bytes) () 05/10/2009 postreply 12:37:42

need to add "++iter" in the second case -亂彈- 給 亂彈 發送悄悄話 亂彈 的博客首頁 (0 bytes) () 05/10/2009 postreply 12:39:09

xiexie. -戲雨飛鷹- 給 戲雨飛鷹 發送悄悄話 戲雨飛鷹 的博客首頁 (0 bytes) () 05/10/2009 postreply 13:59:08

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”