POJ 1195 Mobile phones (二維樹狀數組),poj1195DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and columns
HDU-4973-A simple simulation problem.(二分+樹狀數組),hdu-4973-aproblem.Problem DescriptionThere are n types of cells in the lab, numbered from 1 to n. These cells are put in a queue, the i-th cell belongs to type i. Each time I can use mitogen to double
HDU-4937-A simple simulation problem.(線段樹),hdu-4937-aproblem.Problem DescriptionThere are n types of cells in the lab, numbered from 1 to n. These cells are put in a queue, the i-th cell belongs to type i. Each time I can use mitogen to double the
012溫習漢諾塔 (keep it up),012漢諾塔漢諾塔:有三根相鄰的柱子,標號為A,B,C,A柱子上從下到上按金字塔狀疊放著n個不同大小的圓盤,要把所有盤子一個一個移動到柱子B上,並且每次移動同一根柱子上都不能出現大盤子在小盤子上方,應該怎麼移動?漢諾塔是個非常經典的問題,講遞迴時應該都會講到它。如果我們沒有遞迴的先驗知識, 直接去解答這道題,常常會覺得不知道如何下手。用遞迴卻可以非常優美地解決這個問題。使用遞迴的一個關鍵就是,我們先定義一個函數,不用急著去實現它,