看板 KS97-318 關於我們 聯絡資訊
ACM題目真是機掰難,連一星的我都不太會了...... 大部分都跟數學有關 在此請教一下作法 Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. ``Look, I've built a wall!'', he tells his older sister Alice. ``Nah, you should make all stacks the same height. Then you would have a real wall.'', she retorts. After a little con- sideration, Bob sees that she is right. So he sets out to rearrange the bricks, one by one, such that all stacks are the same height afterwards. But since Bob is lazy he wants to do this with the minimum number of bricks moved. Can you help? 簡單來說鮑伯想要把一堆高低不等的積木堆 在一次只能移動一個的前提下,最後排成等高(還是一樣) 比方 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● => ● ● ● ● ● ● ● ● ● ● ● ● 問最小移動次數 這有數學上的方法計算出來嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.235.107
notebook789:拿樂高來玩一下啊 10/20 18:53
moremore99:我不懂這題目想考啥 總數除四得a 再分開除a 和除二 10/20 19:03
moremore99:不就好了 = = 有難一點的看看嗎 10/20 19:04
moremore99:不然我感覺不出考點 10/20 19:04
moremore99:16/4=4 6/4+2/4+4/4+4/4 的餘數合=2+2+0+0=4 10/20 19:13
moremore99:4/2=2 (4及為所需移動總數 除二是因為移動一個便) 10/20 19:15
moremore99:等同是讓兩個積木到正確位置 10/20 19:15
Latis0274:看在毛怪那麼認真回文的份上幫你推一下好了XD 10/20 19:20
ciffel:真不愧是專業毛怪 另外考點是用程式寫出你想法 10/20 20:30
turkeyonly:我真的覺得數學好很適合唸資工= = 10/21 00:18