j1a2c3k4y5 2006-11-29 11:05
Porgramming Problem
I really don't know how to do this question
I feel sorry that i have to post the question to all of you
WOuld somebody help me plz
I only want the algorithm,don't need code.
:'(:'(:'(
hhl 2006-11-29 12:16
嗯嗯嗯.. 有d 難度... 但有得唸有得唸 .. .. 係咪唔想用bute-force? brute-force 應該唔係太難, 我唸 ...
[[i] 本帖最後由 hhl 於 2006-11-29 04:44 AM 編輯 [/i]]
花之慶次 2006-12-4 21:45
喂, 朋友, 可不可以教下我呀!!:hamsup::beer:
jayzhou_2046 2006-12-4 23:55
o係第二度都已經見過呢條題目,
deadline係幾時?
jayzhou_2046 2006-12-5 00:03
對不起, 原來已"過o左廟"!
Rubber 2006-12-6 16:58
回復 #1 j1a2c3k4y5 的帖子
Sorry, just be able to see this today..
I think a very unitelligent algorithm is :
Array of coin = C(1,1) to C(n,n)
for (i=1; i < n; i++) {
for (j=1; j=n; j++) {
if C(i,j) == "T" then Flip(C(i+1,j));
}
}
This algorithm is straight forward and will flip the lowest number column into all heads first, ( by flipping coins in the next higher column ). It then flips the next higher column until all columns are traverse...
Rubber 2006-12-6 17:02
By the way... this only garrantees the first 1..(n-1) column are all heads, is it mathematically fixed that the (n) column must be also all heads if the first n-1 colums are all heads ?