作者gn00618777 (123)
看板Grad-ProbAsk
標題[理工] [離散]-台大
時間Sun Feb 28 22:26:13 2010
A classroom contain 25 minicomupter that must be connected to a wall
socket that has four outlets. Connections are made by using extension
cords that have four outlets each. What is the least number of cords needed
to get these computers set up for each classes?
○
/ / \ \
0 0 0 0
/ /\\.........
0 0 0 0
n <= 4i+1(root)
n=L(葉子個數)+i(內點個數)
L+i <= 4i+1 -->i>=8
為何要8-1=7?
我算出i至少要8,本來就沒包括root了,位啥要減一呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.124.202.33
推 degia220:4i+1的1就是指root 所以最後要減掉 02/28 22:36
推 assassin88:這題用 m-ary tree 去想最快。 02/28 22:41
→ gn00618777:我的i本來就沒算root了阿= = 02/28 22:42
→ gn00618777:阿 喔 我懂了 = = 沒事 感恩 02/28 22:43