看板ACMCLUB
标 题Re: 问一下昨天的problem J
发信站批踢踢兔 (Sun Oct 16 20:24:14 2005)
转信站ptt!Group.NCTU!grouppost!Group.NCTU!ptt2
※ 引述《sophialiege (失落)》之铭言:
: → greenoyster:你确定更新的时候不用加复杂度上去吗 推 10/16 17:01
: 牡蛎的更新是指什麽?
: 是说parent的table w要如何从children的table w推出来吗?
: parent [0...10000]
: / |||| \
: chile 1[0...10000] ..... child m[0...10000]
: 1 ....... m
: 0 [] [] [] .... []
: 1 [] [] [] .... []
: .
: .
: .
: 10000 []
: 这样做DP求出parent的table w
: 又因为 summation m = |E|,所以=>
: 修正一下,复杂度是10001*|E|
在填 parent 的时候, 每一格要 O(w_max) 的复杂度吧?
--
n;main(i){return n?i<2?i:main(i-1)+main(i-2):
scanf("%d",&n)&&printf("%d\n",n>0?main(n):0);}
--
※ 发信站: 批踢踢兔(ptt2.cc)
◆ From: 140.112.30.52
1F:→ sophialiege:对,我弄错了...推 10/16 20:23