作者numin (numin)
看板Grad-ProbAsk
標題Re: [理工] [離散] 98台大電機
時間Wed Sep 5 23:53:59 2012
※ 引述《Byzantin (拜占庭)》之銘言:
: 假設1為改變status,0為不改變
: locker 1 2 3 4 5 6 7 ‧‧‧
: student1 1 1 1 1 1 1 1 ‧‧‧
: student2 0 1 0 1 0 1 0 ‧‧‧
: student3 0 0 1 0 0 1 0 ‧‧‧
: student4 0 0 0 1 0 0 0 ‧‧‧
: ‧
: ‧
: ‧
: locker還是open的條件是該行為1的bit數有奇數個,
: 每個locker在遇到編號的因數時該列bit會是1
: 所以最後是open的locker它的編號的因數為奇數個
: 即完全平方數,所以是1,4,9,16,25,36,49,64,81,100
問題:
想請問上面黃色部份的意思,有點看不懂。(原題目在下面)
另外在黃子嘉老師課本1-72範例二提到的是正因數個數,不曉得和這個有什麼關係。
感謝各位耐心看完題目及問題,謝謝。
: ※ 引述《ceo890710 (Drinking)》之銘言:
: : ---------------------------------------------------------------------
: : One hundred students enter a locker room that contains 100 lockers.
: : The first student open all the lockers.The second student changes the
: : status(from open to closed, and vice versa) of every other locker,
: : starting with the second locker.The third student then changes the
: : status of every third locker,starting with the third locker.In general,
: : for 1<=K<=100,the kth student changes the status of every kth locker,
: : starting with the kth locker.After the 100th student has gone through
: : the lockers,which lockers are left open?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.193.221.223
推 ddczx:因為第n列 bit為1的行數要是n之倍數 09/06 00:02
推 Bearcome:應該是每個LOCKER在遇到編號跟自己相同的因數時bit=1 09/06 00:08
→ numin:感謝d大,B大的回答。 09/06 00:36
→ numin:想了一下子終於想通了,但想請問d大一下,你說的第n列bit為1 09/06 00:42
→ numin:的行數要是n之倍數,這是觀察出來的嗎? 09/06 00:43
推 ddczx:the kth student changes the status of every kth locker 09/06 01:04
→ numin:謝謝d大,原來之前還不算是想通,不過現在終於知道了,在列 09/06 09:40
→ numin:和行數之間仔細想了一下,並且思考the kth那段話,才完全明 09/06 09:41
→ numin:白,謝謝。 09/06 09:41