题解

237 条题解

  • 0
    @ 2008-11-03 19:21:15

    编译通过...

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

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

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

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

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

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

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

    数据太小,可以直接搜一遍,如果再大许多,就要用DP了

    var

    n,i,t,j:longint;

    procedure find(x:longint);

    var

    l:longint;

    begin

    inc(t);

    for l:=1 to x div 2 do find(l);

    end;

    begin

    readln(n);

    for j:=1 to n div 2 do

    find(j);

    writeln(t+1);

    end.

  • 0
    @ 2008-10-30 18:55:34

    #include

    #define maxn 1000

    long n;

    int main()

    {

    long i,j,f[maxn+10];

    scanf("%ld",&n);

    for(i=1;i

  • 0
    @ 2008-10-29 07:00:41

    C语言动规解决方案……

    据估测大概能算到n=100000左右……不过懒得编高精

    #include

    double a[1001]={0};

    main()

    {

    int n;

    int i,j;

    scanf("%d",&n);

    a[1]=1;

    for(i=2;i

  • 0
    @ 2008-10-27 16:35:14

    设f[i]表示以i开头的扩展出来的数字有多少个

    则f[i]=sum{f[j]}(i*2

  • 0
    @ 2008-10-22 21:48:54

    编译通过...

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

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

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

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

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

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

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

    var

    max:longint;

    i,j,n:integer;

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

    begin

    readln(n);

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

    f[n]:=1;

    for i:=n div 2 downto 1 do

    begin

    for j:=i*2 to n do

    if f[j]0 then f[i]:=f[i]+f[j];

    end;

    max:=0;

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

    writeln(max);

    end.

    快速过10000

  • 0
    @ 2008-10-20 23:02:32

    var n,j,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,s:longint;

    begin

    readln(n);

    for i1:=1 to n div 2 do

    begin

    inc(s);

    for i2:=1 to i1 div 2 do

    begin

    inc(s);

    for i3:=1 to i2 div 2 do

    begin

    inc(s);

    for i4:=1 to i3 div 2 do

    begin

    inc(s);

    for i5:=1 to i4 div 2 do

    begin

    inc(s);

    for i6:=1 to i5 div 2 do

    begin

    inc(s);

    for i7:=1 to i6 div 2 do

    begin

    inc(s);

    for i8:=1 to i7 div 2 do

    begin

    inc(s);

    for i9:=1 to i8 div 2 do

    begin

    inc(s);

    for i10:=1 to i9 div 2 do

    inc(s);

    end;

    end;

    end;

    end;

    end;

    end;end;

    end;end;

    writeln(s+1);

    end.

  • 0
    @ 2008-10-19 17:58:42

    测试数据太弱

    编译通过...

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

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

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

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

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

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

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

    编译通过...

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

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

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

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

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

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

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

    var n:integer;

    all:longint;

    procedure search(m:integer);

    var i,j:integer;

    begin

    all:=all+1;

    for i:= m div 2 downto 1 do search(i);

    end;

    begin

    readln(n);

    all:=0;

    search(n);

    writeln(all)

    end.

    14行搞定

  • 0
    @ 2008-10-08 17:09:08

    递推公式

    if odd(i) then d[i]:=d

    else d[i]:=d + d[i div 2];

  • 0
    @ 2008-10-04 21:41:58

    递归竟然能过啊

    我输了1000,好久不出解,竟然过了!Yeah

    编译通过...

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

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

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

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

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

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

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

  • 0
    @ 2008-10-04 13:37:42

    dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp dp

  • 0
    @ 2008-09-29 16:06:34

    懒得找规律,用递归。输1000,N久没出来。提交一下看?AC了!O(∩_∩)O哈哈~

  • 0
    @ 2008-09-24 09:59:20

    #include

    int main(){

    int i,j,n,x[1000]={0};

    scanf("%d",&n);

    x[0]=1;

    x[1]=1;

    for (i=2;i

  • 0
    @ 2008-09-23 21:20:34

    就是不DP 就是用DFS辱。。。

  • 0
    @ 2008-09-23 18:14:44

    简单

  • 0
    @ 2008-09-10 19:53:27

    #include

    #include

    int main()

    {

    int m,i,j;

    int dp[1001]={0};

    scanf("%d",&m);

    for(i=1;i

  • 0
    @ 2008-09-01 21:29:01

    var

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

    i,j,k,l,n,m,s,t:longint;

    begin

    readln(n);

    for i:=1 to n do

    a[i]:=1;

    for i:=1 to n do

    for j:=1 to i div 2 do

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

    writeln(a[n]);

    end.

    DP???

  • 0
    @ 2008-08-28 14:42:43

    编译通过...

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

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

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

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

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

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

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

    找关系式 a[i]:=a+a[i div 2] 这样就很简单了啦 一次AC

    begin

    read(n);

    if n=1 then write(1)

    else

    begin

    a[1]:=1;

    for i:=2 to n do

    if odd(i) then a[i]:=a

    else a[i]:=a+a[i div 2];

    write(a[n]);

    end;

    end.

  • 0
    @ 2008-08-27 15:23:11

    dp

  • 0
    @ 2008-08-26 11:25:36

    编译通过...

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

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

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

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

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

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

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

    var n,js:longint;

    procedure try(nb:integer);

    var oi:integer;

    begin

    if nb=1 then exit;

    js:=js+nb div 2;

    for oi:=nb div 2 downto 1 do

    try(oi)

    end;

    begin

    readln(n);

    js:=1;

    try(n);

    writeln(js);

    end.

    DFS

  • 0
    @ 2008-08-25 16:51:16

    编译通过...├ 测试数据 01:答案正确... 0ms├ 测试数据 02:答案正确... 0ms├ 测试数据 03:答案正确... 0ms├ 测试数据 04:答案正确... 0ms├ 测试数据 05:答案正确... 0ms-------------------------Accepted 有效得分:100 有效耗时:0ms

    DFS我试了1000,10S过谁知。。。。。。。。。。数据IS TOO MUCH 弱

    AC35耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶耶

信息

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