372 条题解

  • 0
    @ 2008-11-23 11:56:44

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    一次AC啦!!!

    诸位的代码太长了。。。。。

  • 0
    @ 2008-11-12 20:24:47

    program ex(input,output);

    var

    n,i,j,o,m:longint;

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

    procedure ch(x:longint);

    var

    min:longint;

    begin

    for i:=1 to x-1 do

    begin

    min:=i;

    for j:=i+1 to x do

    if a[j]0 then

    for j:=i+1 to n do

    if a[i]=a[j] then a[j]:=-a[j];

    ch(n);

    m:=0;

    for i:=1 to n do

    if a[i]>0 then

    m:=m+1;

    writeln(m);

    for i:=1 to n do

    if a[i]>0 then

    write(a[i]:3);

    end.

  • 0
    @ 2008-11-12 12:53:31

    program lyc(input,output);

    var

    b,n,i,j,x:integer;

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

    begin

    x:=0;

    readln(n);

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

    readln;

    for i:=1 to n do

      for j:=i+1 to n do

      if a[i]>a[j] then begin b:=a[i];a[i]:=a[j];a[j]:=b end;

      for i:=1 to n do

       for j:=i+1 to n do

       if a[i]=a[j] then a[j]:=-1;

      for i:=1 to n do

       if (a[i]>0) or (a[i]=0) then x:=x+1;

       writeln(x);

       for i:=1 to n do

       if (a[i]>0) or (a[i]=0) then write(a[i],' ')

    end.

  • 0
    @ 2008-11-12 09:27:28

    program tx;

    var n,m,i,j,l:integer;

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

    begin

    readln(n);

    for i:=1 to n do

    a[i]:=0;

    for i:=1 to n do

    read(a[i]);

    readln;

    l:=0;

    for i:=1 to n-1 do

    for j:=i+1 to n do

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

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

    end;

    for i:=1 to n-1 do

    begin j:=i+1;

    if a[i]=a[j] then a[j]:=10000;

    end;

    m:=0;l:=0;

    for i:=1 to n do

    if a[i]10000 then m:=m+1;

    for i:=1 to n do

    for j:=i+1 to n do

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

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

    end;

    writeln(m);

    for i:=1 to m do

    write(a[i],' ');

    end.

  • 0
    @ 2008-11-12 09:13:15

    program lyc(input,output);

    var

    b,n,i,j,x:integer;

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

    begin

    x:=0;

    readln(n);

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

    readln;

    for i:=1 to n do

    for j:=i+1 to n do

    if a[i]>a[j] then begin b:=a[i];a[i]:=a[j];a[j]:=b end;

    for i:=1 to n do

    for j:=i+1 to n do

    if a[i]=a[j] then a[j]:=-1;

    for i:=1 to n do

    if (a[i]>0) or (a[i]=0) then x:=x+1;

    writeln(x);

    for i:=1 to n do

    if (a[i]>0) or (a[i]=0) then write(a[i],' ')

    end.

  • 0
    @ 2008-11-11 19:29:46

    又秒杀……Accepted 有效得分:100 有效耗时:0ms

    /*random.c by Tydus*/

    int main(){

    static int flag[1001],m,i=1,tmp;

    for(scanf("%d",&m);i1000?printf("%d\n",tmp),0:1;i++) if(flag[i]) tmp++;

    for(i=1;i>1000?exit(0),0:1;i++) if(flag[i]) printf("%d ",i);

    }

    楼下的,这个够短了吧?

  • 0
    @ 2008-11-10 15:39:07

    没想到……第100题是这种水题……下午真的是没什么做题的激情…………不过……貌似楼下的代码都太长了……

  • 0
    @ 2008-11-10 13:35:02

    #include

    main()

    {

    int i,n,b=0,t,j;

    int static a[1001];

    int static c[1001];

    scanf("%d",&n);

    for(i=0;i

  • 0
    @ 2008-11-07 22:13:04

    program mmdsjs;

    var

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

    n,i,j,p,s,t:longint;

    begin

    read(n);

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

    for i:= 1 to n-1 do

    begin

    p:=i;

    for j:= i+1 to n do

    if a[j]

  • 0
    @ 2008-11-05 19:31:09

    var a:array[1..1001] of boolean;

    n,m,i,p:longint;

    begin

    fillchar(a,sizeof(a),false);

    readln(n);

    for i:=1 to n do

    begin

    read(p);

    a[p]:=true;

    end;

    for i:=1 to 1000 do

    if a[i]=true then inc(m);

    writeln(m);

    for i:=1 to 1000 do

    if a[i]=true then begin write(i);break;end;

    for i:=i+1 to 1001 do

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

    end.

  • 0
    @ 2008-11-05 16:53:29

    编译通过...

    ├ 测试数据 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-04 21:31:12

    终于碰上用桶排的了 囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧囧

  • 0
    @ 2008-11-04 13:57:21

    program suiji;

    var

    n,m,i:integer;

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

    begin

    readln(n);

    for i:=1 to 1000 do

    begin

    read(m);

    a[m]:=m;

    end;

    n:=0;

    for i:=1 to 1000 do

    if a[i]0 then inc(n);

    writeln(n);

    for i:=1 to 1000 do

    if a[i]0 then write(a[i],' ');

    end.

    用不了那么麻烦!

  • 0
    @ 2008-11-04 13:49:41

    var

      i,j,n,temp,b:longint;

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

    procedure sb(l,r:integer);

      var i,j,mid:integer;

      begin

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

       repeat

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

         if ij;

       if l

  • 0
    @ 2008-11-03 18:27:19

    w

  • 0
    @ 2008-11-02 22:01:23

    谁能告诉我一下数据,为什么我最后一个数据总是过不了?

  • 0
    @ 2008-11-02 14:47:15

    #include

    int main ()

    {

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

    scanf ("%d",&n);

    for (i=1;i

  • 0
    @ 2008-11-02 12:57:00

    var

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

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

    temp,n,i,j:integer;

    begin

    fillchar(a,sizeof(a),false);

    readln(n);

    j:=1;

    for i:=1 to n do

    begin

    read(temp);

    a[temp]:=true;

    end;

    for i:= 1 to 1000 do

    if (a[i]=true) then begin a2[j]:=i; inc(j);end;

    j:=j-1;

    writeln(j);

    for i:= 1 to j do

    write(a2[i],' ');

    end.

    美丽的代码……

  • 0
    @ 2008-11-02 09:43:39

    PROGRAM random;

    VAR

    i,j,s,n,t:integer;

    a:array[0..2000,1..2]of integer;

    BEGIN

    readln(n);

    for i:=1 to n do

    read(a);

    s:=n;

    for i:=1 to n-1 do

    for j:=1 to n-i do

    if a[j,1]>=a[j+1,1] then begin

    t:=a[j,1];

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

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

    end;

    for i:=1 to n-1 do

    a:=i+1;

    a[n,2]:=0;

    a[0,2]:=1;

    for i:=1 to n do

    while a=a[a,1] do begin

    a:=a[a,2];

    end;

    for i:=1 to n-1 do

    if a=a then dec(s);

    writeln(s);

    i:=1;

    write(a[1,1]);

    while a0 do begin

    write(' ',a[a,1]);

    i:=a;

    end;

    END.

    用了仿链表...好像小题大做了...AC...

  • 0
    @ 2008-10-31 22:09:42

    超级水的题...3分钟1次AC.

    #include "stdio.h";

    int main(){

    int s[105],a[105],i,j,k,p,m,n;

    scanf("%d",&n);

    for(i=1;i

信息

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