371 条题解

  • 0
    @ 2008-09-15 16:29:59

    #include

    using namespace std;

    main(){

    int x,y,a;

    int n[1001]={0};

    cin>>x;

    int o=x;

    for (y=1;y>a;

    if (n[a]==1) o--;

    n[a]=1;

    }

    cout

  • 0
    @ 2008-09-14 19:49:18

    编译通过...

    ├ 测试数据 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-09-14 10:22:23

    program asdqer;

    var

    i,j,n:longint;

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

    begin

    read(n);

    fillchar(a,sizeof(a),0);

    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.

  • 0
    @ 2008-09-12 19:50:41

    ...水题...

    快排都不用,一个最弱的计数排序就行...

  • 0
    @ 2008-09-12 12:16:30

    编译通过...

    ├ 测试数据 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-09-11 22:10:04

    program mingming;

    var num:array[1..1000]of boolean;

    n,i,cc,t:integer;

    begin

    readln(n);

    for i:=1 to n do begin

    read(cc);

    num[cc]:=true;

    end;

    for i:=1 to 1000 do

    if num[i]=true then inc(t);

    writeln(t);

    for i:=1 to 1000 do

    if num[i]=true then write(i, ' ' );

    end.

  • 0
    @ 2008-09-10 21:08:59

    #include

    using namespace std;

    int main()

    {int a[1001]={0},n,i,j,s=0;

    cin>>n;

    for(i=1;i>j;a[j]++;}

    for(i=1;i

  • 0
    @ 2008-08-31 22:46:01

    先验证,然后QS,之后输出

    最后就是AC

    还是验证的时候花的时间最多,QS基本忽略掉。。。。。。

  • 0
    @ 2008-08-31 16:00:31

    就是一个快排和验证 有什么难的

    又这个算法那个算法的

  • 0
    @ 2008-08-30 09:57:38

    const s=100;

    var

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

    temp,i,j,m,n:integer;

    begin

    m:=0;

    readln(n);

    for i:=1 to n do read(a[i]);

    for i:=1 to n-1 do

    for j:=1 to n-i do

    if a[j]>a[j+1] then

    begin

    temp:=a[j];

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

    a[j+1]:=temp;

    end;

    for i:=1 to n do

    begin

    if (i>1) and (a[i]=a) then

    continue;

    m:=m+1;

    end;

    writeln(m);

    for i:=1 to n do

    begin

    if (i>1) and (a[i]=a) then

    continue;

    write(a[i],' ');

    end;

    end.

  • 0
    @ 2008-08-28 07:58:34

    var i,n,j,k,s,x:integer;

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

    begin

    fillchar(a,sizeof(a),0);

    readln(n);

    for i:=1 to n do read(a[i]);

    for i:=1 to n-1 do

    for j:=i+1 to n do

    if a[i]=a[j] then begin

    for k:=j to n-1 do a[k]:=a[k+1];

    dec(n);

    end;

    for i:=1 to n-1 do

    for j:=i+1 to n do

    if a[i]>a[j] then begin

    x:=a[i];

    a[i]:=a[j];

    a[j]:=x;

    end;

    writeln(n);

    for i:=1 to n do begin

    if i=n then begin write(a[i]); halt; end;

    write(a[i],' ');

    end;

    end.

    为什么只有90分啊,他说程序输出比正确答案长

  • 0
    @ 2008-08-27 19:52:41

    var

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

    a:array[1..101]of longint;

    b:array[1..101]of boolean;

    procedure pai(l,r:longint);

    var i,j,mid,k:longint;

    begin

    mid:=a[(l+r) div 2];

    i:=l;

    j:=r;

    repeat

    while a[i]mid do dec(j);

    if ij;

    if j>l then pai(l,j);

    if i

  • 0
    @ 2008-08-24 17:17:08

    bang mang gai xia ,xie xie !

    var

    a:array[1..101]of longint;

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

    //=======================================

    procedure init;

    begin

    readln(n);

    for i:=1 to n do

    read(a[i]);

    score:=n;

    end;

    //=======================================

    procedure sanshu;

    begin

    for i:=1 to score-1 do

    for j:=i+1 to score do

    if a[i]=a[j]

    then begin

    for k:=j to score-1 do

    a[k]:=a[k+1];

    dec(score);

    end;

    end;

    //=======================================

    procedure paxu;

    begin

    for i:=1 to score-1 do

    for j:=1+i to score do

    if a[i]>a[j]

    then begin

    k:=a[i];

    a[i]:=a[j];

    a[j]:=k;

    end;

    end;

    //=======================================

    procedure outit;

    begin

    writeln(score);

    for i:=1 to score-1 do

    write(a[i],' ');

    write(a[score]);

    end;

    //=======================================

    begin

    init;

    sanshu;

    paxu;

    outit;

    end.

    编译通过...

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

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

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

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

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

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

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

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

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

    ├ 测试数据 10:答案错误...程序输出比正确答案长

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

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

  • 0
    @ 2008-08-16 10:08:23

    编译通过...

    ├ 测试数据 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-08-09 19:46:08

    桶好伟大!

  • 0
    @ 2008-08-08 17:36:50

    BST! SBT! Treap! 都好使!

  • 0
    @ 2007-12-02 13:55:27

    用桶排序就可以了嘛,先排序然后再计算一共有几个。。

  • 0
    @ 2007-11-21 13:14:03

    数据很弱,冒泡都能过- -

  • 0
    @ 2007-11-17 00:28:17

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    类似桶排

  • 0
    @ 2007-11-13 22:39:34

    线性计数排序,1次AC

信息

ID
1316
难度
3
分类
其他 | 排序 点击显示
标签
递交数
9946
已通过
4861
通过率
49%
被复制
29
上传者