回复:早年的第3000名到不了USAMO

回答: 早年的第3000名到不了USAMOBeLe2012-12-07 07:58:27

slow way

Use 1 for house that gets mail. Use letter for number of houses that do not get mail.

1. 5 houses get mail.

     pattern

     a+1+b+1+c+1+d+1+e+1+f=10 (b,c,d,e,at least 1)

       a+b+c+d+e+f=5,  C(6,1)=6

2. 4 house get mail

   pattern

   a+1+b+1+c+1+d+1+e=10  (b,c,d at least 1, a,b,c,d,e all less than 4)

   a+b+c+d+e=6

  total C(7,3)-3=32, remove 3 that are invalid

3. 3 houses get mail

   pattern a+1+b+1+c+1+d

a+b+c+d=7  total c(8,3)-=56-28=28

4  2 houses get mail

       a+1+b+1+c   3

total 3+28+32+6=69

所有跟帖: 

谢谢!答案正确,写了Matlab code验证。 -ca981- 给 ca981 发送悄悄话 ca981 的博客首页 (178218 bytes) () 12/07/2012 postreply 19:11:23

请您先登陆,再发跟帖!