Board logo

標題: Porgramming Problem [打印本頁]

作者: 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 應該唔係太難, 我唸 ...

[ 本帖最後由 hhl 於 2006-11-29 04:44 AM 編輯 ]
作者: 花之慶次    時間: 2006-12-4 21:45

喂, 朋友, 可不可以教下我呀!!
作者: 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 ?




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0