solution to that "difficult question"
所在版块:求学狮城 发贴时间:2003-02-12 14:36  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
"最后一道题目非常难,题目的意思是,24=2*12=3*8=4*6=2*2*6=...
{2, 12}是24的一个set,{3,8}也是24的一个set,{2,12}和{12, 2}算同一个set,{24}也是{24}的一个set。24有7个这样的set。要你算出若干数的set的个数,并且把最大的那个数以及它的set数找出来。"

really?

Here is a possible way:

Firstly, use recursion to get the factoriazation of the number, say 24 = 2^3*3
N=p1^e1*p2^e2*p3^e3...*(pn^en)
p1^e1 means p1 tp the power of e1.

Then, use this formula:
number of different set=(e1+1)*(e2+1)*...(en+1)-1, here minus 1 is to remove {1, N} and {N, 1} duplication.

So surprise, a TA says such question is "very difficult". Do you think you are disappointing the students?

Shamed, shamed, shamed......

:D Kidding.
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
CS1102 Lab2a, Qn3, Qn4-答重生 duck   (1169 bytes , 1428reads )
有没有好的方法解决time问题? 原著   (112 bytes , 269reads )
迟些时候吧 duck   (53 bytes , 224reads )
好,谢谢!^_^ 原著   (0 bytes , 213reads )
太神奇了!多谢了。不然还不知道要想多久 我的牛逼   (0 bytes , 230reads )
我这个帖子申请置顶一周,到下周二放下去 duck   (0 bytes , 207reads )
哇,当TA好了不起呀! 我想我是海   (119 bytes , 280reads )
solution to that "difficult question" 花露水   (708 bytes , 417reads )
this way, most possibly, will get time out" error. Climbing   (0 bytes , 238reads )
aiya 花露水   (102 bytes , 309reads )
If so, you are not able to get it duck   (605 bytes , 335reads )
qie~~ 花露水   (102 bytes , 369reads )
btw 花露水   (105 bytes , 272reads )
哈哈,我Forward我组的人这个post了 Climbing   (0 bytes , 229reads )
太过分了吧!!! duck   (134 bytes , 261reads )
争斗的后面 mean   (29 bytes , 238reads )
偶是forward这个LINK呀,你,不要激动嘛 Climbing   (0 bytes , 201reads )
~ 没落书童   (0 bytes , 203reads )