推介:| 網頁寄存 | 網頁設計 | 開網店 | 電郵申請 | Wordpress Hosting | 外賣平台 | 英語課程推薦 | 風水屋 | 房間風水懷孕 | Timway Testimonial | Wedding Planner | Wedding MC |

發新話題
打印

Porgramming Problem

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.
附件: 您所在的用戶組無法下載或查看附件, 請嘗試多貼文章獲取積分,積分超過 120 或特定用戶組方可查看.

TOP

嗯嗯嗯.. 有d 難度... 但有得唸有得唸 .. .. 係咪唔想用bute-force? brute-force 應該唔係太難, 我唸 ...

[ 本帖最後由 hhl 於 2006-11-29 04:44 AM 編輯 ]

TOP

喂, 朋友, 可不可以教下我呀!!

TOP

o係第二度都已經見過呢條題目,
deadline係幾時?

TOP

對不起, 原來已"過o左廟"!

TOP

回復 #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...
The unexamined life is not worth living - Socrates
以銅為鏡,可以正衣冠,以史為鏡,可以知興替,以人為鏡,可以明得失 - 唐太宗

TOP

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 ?
The unexamined life is not worth living - Socrates
以銅為鏡,可以正衣冠,以史為鏡,可以知興替,以人為鏡,可以明得失 - 唐太宗

TOP

發新話題


重要聲明:本討論區是以即時上載留言的方式運作,本網站對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。本討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。


Copyright 1997- Xocat. All Right Reserved.