题解

132 条题解

  • 0
    @ 2008-11-13 21:31:45

    //双层汉诺塔

    #define MAX 10000

    #include

    int a[MAX+1];

    int n=0, sl=1;

    void high()

    {

    int i;

    for(i=1; i

  • 0
    @ 2008-11-13 08:10:11

    数学+高精度=AC

  • 0
    @ 2008-11-12 10:44:44

    var

    len,n,i:longint;

    a:array[1.. 255] of integer;

    procedure high;

    var i:integer;

    begin

    for i:=1 to len do

    a[i]:=a[i]*2;

    for i:=1 to len do

    if a[i]>=10 then begin a:=a+a[i] div 10;a[i]:=a[i] mod 10;end;

    if a[len+1]>0 then inc(len);

    end;

    begin

    readln(n);

    a[1]:=1;len:=1;

    for i:=1 to n+1 do

    high;

    i:=1;

    a[i]:=a[i]-2;

    for i:=2 to len do

    if a[i]1) do dec(len);

    for i:=len downto 1 do

    write(a[i]);

    end.

  • 0
    @ 2008-11-11 17:45:30

    program a1(input,output);

    var

    n,x,y,z,i,j:integer;

    a:array[1..300,1..3] of integer;

    procedure swap(var a,b:integer); {交换过程}

    var

    s:integer;

    begin

    s:=a;

    a:=b;

    b:=s;

    end;

    begin

    assign(input,'scholar.in');

    assign(output,'scholar.out');

    reset(input);

    rewrite(output);

    readln(n);

    for i:=1 to n do

    begin

    readln(x,y,z);

    a:=i;

    a:=x;

    a:=x+y+z;

    end;

    for i:=1 to n-1 do {选择排序}

    for j:=i+1 to n do

    if (a

  • 0
    @ 2008-11-10 22:49:54

    哈哈,绝对秒杀!

    #include

    int n;

    void init()

    {scanf("%d",&n);}

    void work()

    {int i,t,j,k,l,a[200]={0},x,bj=0;;

    a[1]=2;t=1;

    for(i=2;it){t++;a[j]=x;}

    a[1]+=2;

    while(a[l]>=10){a[l]%=10;a[l+1]+=1;l++;}

    }

    while(a[t]==0)t--;

    for(i=t;i>=1;i--)

    printf("%d",a[i]);

    }

    main()

    {init();

    work();

    return 0;

    }

  • 0
    @ 2008-11-09 16:48:35

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    一提交就AC了。

    参考代码:

    #include

    #include

    char ans[120]={1,0,}, len = 1;

    void db(int t){

    int i, j, r;

    for( i=0; i

  • 0
    @ 2008-11-09 10:20:53

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

  • 0
    @ 2008-11-08 22:55:43

    用高精立刻秒杀

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

  • 0
    @ 2008-11-07 23:12:51

    倒!

    我最大只能做到62!!!

  • 0
    @ 2008-11-03 17:13:29

    晕,我递推没用高精度,没过……

    个人觉得貌似要用高精度才能全过,至少我是这样

  • 0
    @ 2008-11-01 15:33:55

    编译通过...

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

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

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

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

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

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

    ├ 测试数据 07:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 08:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 09:答案错误... ├ 标准行输出

     ├ 错误行输出

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

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

    Unaccepted 有效得分:70 有效耗时:0ms

    var n,t,y:int64;

    procedure hanoi(m:int64);

    begin

    if m=1 then t:=2

    else begin

    hanoi(m-1);

    t:=t+y;

    y:=2*y;

    end;

    end;

    begin

    y:=4;

    read(n);

    hanoi(n);

    writeln(t);

    end.

    Flag    Unaccepted

    题号   P1354

    类型(?)   数论 / 数值

    通过   824人

    提交   1822次

    通过率   45%

    难度   1

    提交 讨论 题解

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

    哪里错了?

  • 0
    @ 2008-10-31 00:01:16

    wa n次后才意识到要用高精度

  • 0
    @ 2008-10-29 21:28:06

    #include

    using namespace std;

    int n,i,a[301],len=1;

    void chen()

    {int m=0,t,j;

    for(j=1;j0)

    a[++len]=m;

    }

    int main()

    {

    cin>>n;

    a[1]=1;

    for(i=1;i=1;i--)

    cout

  • 0
    @ 2008-10-29 21:11:11

    囧了。。

    AC率从26---|-->25

  • 0
    @ 2008-10-29 12:46:15

    program ds;

    var i,n:longint;

    function h(n:longint):longint;

    begin

    if n=1 then h:=2

    else h:=h(n-1)*2+2;

    end;

    begin

    readln(n);

    i:=h(n);

    writeln(i);

    end.

  • 0
    @ 2008-10-26 16:50:01

    标准水题

  • 0
    @ 2008-10-23 21:02:09

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

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

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

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

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

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

    ├ 测试数据 07:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 08:答案错误... ├ 标准行输出

     ├ 错误行输出

    ├ 测试数据 09:答案错误... ├ 标准行输出

     ├ 错误行输出

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

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

    Unaccepted 有效得分:70 有效耗时:0ms

    哭 哭 哭 哭 哭 哭!!!!!!!!!

  • 0
    @ 2008-10-23 14:13:51

    Nov.Demon

  • 0
    @ 2008-10-27 18:39:37

    需要用到高精吗

    program p1354;

    var s:int64;

    n,i:longint;

    begin

    readln(n);

    s:=1;

    for i:=1 to n+1 do s:=s*2;

    s:=s-2;

    writeln(s);

    end.

  • 0
    @ 2008-10-20 23:16:57

    program shuangta;

    var

    n,i:integer;

    c:longint;

    f1,f2:text;

    begin

    assign(f2,'shuangta.in');

    assign(f2,'shuangta.out');

    reset(f1);

    read(f1,n);

    close(f1);

    rewrite(f2);

    i:=0;

    c:=0;

    repeat

    c:=c*2+2;

    i:=i+1;

    until i=n;

    writeln(f2,c);

    close(f2);

    end.

信息

ID
1354
难度
5
分类
动态规划 点击显示
标签
递交数
4925
已通过
1816
通过率
37%
被复制
18
上传者