Re: [理工] [離散] 98台大電機

看板Grad-ProbAsk作者 (拜占庭)時間14年前 (2011/08/01 15:08), 編輯推噓4(400)
留言4則, 4人參與, 最新討論串3/5 (看更多)
假設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 ※ 引述《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: 1.174.0.123

08/01 18:36, , 1F
08/01 18:36, 1F

08/02 00:06, , 2F
推!只有在完全平方時,自己沒辦法乘自己,其它都可成pair
08/02 00:06, 2F

08/02 08:16, , 3F
08/02 08:16, 3F

08/03 20:27, , 4F
我懂了~!!謝謝!!
08/03 20:27, 4F
文章代碼(AID): #1EDb3bUT (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1EDb3bUT (Grad-ProbAsk)