题解

237 条题解

  • 0
    @ 2009-09-03 17:55:01

    f[2*i]与f[2*i+1]的结果是一样的............

    水..........

    if i=偶数 then f[i]:=f+f[i shr 1]

    else f[i]:=f;

  • 0
    @ 2009-09-02 20:13:19

    program Pdd;

    const maxn= 1000;

    var n,i,j: longint;

    h: array[1..maxn] of longint;

    begin

    read(n);

    for i:= 1 to n do

    begin

    h[i]:= 1;

    for j:= 1 to i div 2 do inc(h[i],h[j]);

    end;

    writeln(h[n]);

    end.

  • 0
    @ 2009-09-02 20:04:14

    program a556;

    const maxn= 1000;

    var n,i,j:longint;

    h:array[1..maxn] of longint;

    begin

    read(n);

    for i:=1 to n do

    begin

    h[i]:=1;

    for j:=1 to i div 2 do inc(h[i],h[j]);

    end;

    writeln(h[n]);

    readln;

    readln;

    end.

  • 0
    @ 2009-08-29 21:57:48

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    #include

    using namespace std;

    int main(){

    int a[10001],i,j;

    a[0]=1;

    a[1]=1;

    int n;

    cin>>n;

    for (i=2;i

  • 0
    @ 2009-08-20 13:26:09

    var n,w:int64;

    a:array[0..1000] of integer;

    procedure find(m:integer);

    var i:integer;

    begin

    w:=w+1;

    if a[m] div 2

  • 0
    @ 2009-08-19 17:05:20

    program p_1;

    var n:int64;

    i:longint;

    a:array[0..1001] of longint;

    begin

    read(n);

    a[0]:=1;

    a[1]:=1;

    a[2]:=2;

    a[3]:=2;

    for i:= 1 to n do

    begin

    if i mod 2=1 then a[i]:=a;

    if i mod 2=0 then a[i]:=a[i div 2]+a;

    end;

    writeln(a[n]);

    end.

    这才是对的

  • 0
    @ 2009-09-20 10:55:50

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    var

    s:array[1..1000] of longint;

    n,b,j:integer;

    begin

    read(n);

    for b:=1 to n do

    s:=1;

    for b:=2 to n do

    for j:=1 to b div 2 do

    s:=s+s[j];

    writeln(s[n]);

    readln;

    end.

    好水。。。

  • 0
    @ 2009-08-11 08:34:19

    CONST

    maxn=1000;

    var

    n,i:longint;

    h,sum:array[0..maxn]of longint;

    begin

    read(n);

    for i:=1 to n do

    begin

    h[i]:=1+sum[i div 2];

    sum[i]:=sum+h[i];

    end;

    writeln(h[n]);

    end.

  • 0
    @ 2009-08-10 14:10:21

    var

    s:array[1..1000] of integer;

    i,j,n:longint;

    begin

    readln(n);

    for i:=1 to n do s[i]:=1;

    for i:=2 to n do

    for j:=1 to i div 2 do

    s[i]:=s[i]+s[j];

    writeln(s[n]);

    end.

    为什么最后的数据过不去???

  • 0
    @ 2009-08-09 10:44:15

    3种动归

    1.f[n]=f[n]+f[i](i=1 to n div 2);

    2.f[n]=f[n-1]+g[n div 2] (g[n]=g[n-1]+f[n]);

    3.{f[n]=f[n-1] (odd(n)=true;) f[n]=f[n-1]+f[n div 2] (odd(n)=false;)}

  • 0
    @ 2009-08-08 22:28:38

    本题没有作说明应不应该重复,两种考虑都有道理,但是按题意还是不考虑重复了.(ps:毕竟没说明...)

  • 0
    @ 2009-08-08 22:17:52

    MS这个题的数据有问题,如果是48,直接产生24 48,也可能先产生4 48,再产生2 4 48,但是测试数据没考虑,造成这样的想法不能AC...

    program asd;

    var

    f:array[1..1000]of longint;

    i,n,j:integer;

    begin

    readln(n);

    fillchar(f,sizeof(f),0);

    f[1]:=1;

    for i:=2 to n do

    begin

    for j:=1 to i div 2 do

    begin

    f[i]:=f[i]+f[j];

    if (j>10)and(2*(j div 10)

  • 0
    @ 2009-08-07 13:15:54

    var

    s:array[1..1000] of longint;

    i,j,n:longint ;

    begin

    readln(n);

    for i:=1 to n do s[i]:=1;

    for i:=2 to n do

    for j:=1 to i div 2 do

    s[i]:=s[i]+s[j];

    writeln(s[n]);

    readln;

    end.

  • 0
    @ 2009-08-07 09:00:11

    说实话

    看了题解后才看懂题,我汗!

    好水的题呀

  • 0
    @ 2009-08-04 18:22:00

    var

    n :longint;

    function f(x:longint):longint;

    var

    i,y :longint;

    begin

    y:=0;

    if x=1 then exit(1);

    if x=0 then exit(1);

    for i:=0 to trunc(x/2) do

    y:=y+f(i);

    f:=y;

    end;

    begin

    readln(n);

    writeln(f(n));

    end.

  • 0
    @ 2009-08-03 10:29:50

    program p1130;

    var i,j,n:longint;

    f:array[0..100000]of longint;

    begin

    readln(n);

    f[1]:=1;

    for i:=2 to n do f[i]:=1;

    for i:=2 to n do

    for j:=1 to trunc(i/2) do

    f[i]:=f[i]+f[j];

    writeln(f[n]);

    end.

  • 0
    @ 2009-07-26 22:37:01

    念此咒语一百遍,必AC

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    DPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDPDP~~~~~~~~~~~~~

    ---|---|---|---|---|---|---|---|---|-

    以下DP:

    begin

    inc(count);

    if n>1 then

    begin

    for i:=m div 2 downto 1 do

    find(i);

    end;

    end;

  • 0
    @ 2009-07-26 21:04:09

    看了题目半天,居然发现了递推公式。。。。。。

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    program count;

    var ip,op:text;

    n,s,k,i,j:longint;

    a:array[1..1000] of int64;

    begin

    readln(n);

    for i:=1 to n do begin

    a[i]:=1;

    k:=i div 2;

    for j:=1 to k do inc(a[i],a[j]);

    end;

    writeln(a[i]);

    end.

  • 0
    @ 2009-07-24 16:00:45

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    program p1130(input,output);

    var i,a,n:longint;

    ab:array [0..1001] of longint;

    begin

    readln(n);

    ab[1]:=1;

    for i:=2 to n do

    ab[i]:=1;

    for i:=2 to n do

    for a:=1 to trunc(i/2) do

    ab[i]:=ab[i]+ab[a];

    writeln(ab[n]);

    end.

  • 0
    @ 2009-07-23 15:46:49

    除了看不懂之外没什么难的..........-_-#

信息

ID
1130
难度
2
分类
递推 点击显示
标签
递交数
7079
已通过
4174
通过率
59%
被复制
30
上传者