题解

163 条题解

  • 0
    @ 2008-11-13 19:19:34

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    饿饿饿饿饿。。。我居然硬生生的被DOLPHIN卡爆了两个点。。。

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

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    第50T,庆祝一下

  • 0
    @ 2008-11-11 10:01:07

    PROGRAM scramble;

    TYPE

    re=record

    wt:longint;

    tot:longint;

    num:longint;

    end;

    a1=array[0..100000]of longint;

    rea=array[0..100000]of re;

    VAR

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

    a:a1;

    w:rea;

    t1:re;

    PROCEDURE qqsort(l,r:longint;var c:a1);

    var

    i,j,t:longint;

    begin if l>=r then exit;

    i:=l-1;

    for j:=l to r-1 do

    if c[j]=r then exit;

    i:=l-1;

    for j:=l to r-1 do

    if (c1[j].wt)=r then exit;

    i:=l-1;

    for j:=l to r-1 do

    if (c1[j].num)

  • 0
    @ 2008-11-10 20:35:43

    我三遍快排算了算应该不超时啊,为什么后三个过不了???

  • 0
    @ 2008-11-10 17:53:18

    请各位大侠指点!!!!!!!

    急急急急!!!!!!!!!!

    :(

    program l1;

    var

    a,b:array[1..100000]of longint;

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

    begin

    readln(n,m);

    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

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

    end;

    for i:=1 to m do begin

    d:=n-(m+1-i)+1;

    repeat

    b[i]:=b[i]+a[d];

    dec(d,m);

    until d

  • 0
    @ 2008-11-10 13:46:15

    var

    n,m,i:longint;

    a,b,s:array[1..32767]of integer;

    procedure qshort(x,y:integer);

    var i,j,t:integer;

    begin

    if x>=y then exit;i:=x;j:=y;

    repeat

    while(a[i]

  • 0
    @ 2008-11-08 17:43:47

    program P1445;

    type

    arr=array[1..100000]of longint;

    var

    a,b,c,sum:arr;

    n,m,i,j:longint;

    procedure sort(var a:arr;s,t:longint);

    var

    i,j,k,x:longint;

    begin

    i:=s; j:=t; k:=random(t-s+1)+s; x:=a[k];

    repeat

    while a[i]>x do inc(i);

    while a[j]

  • 0
    @ 2008-11-08 17:26:28

    很水很水的题目嘛!

  • 0
    @ 2008-11-08 09:00:58

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    尴尬的数据范围

    我按照他给的范围,结果90分

    在范围后加个0 ,结果ac 鄙视这水题,靠这个阴人

  • 0
    @ 2008-11-07 11:46:03

    var i,j,l,r,m,n,k,temp:longint;

    a,b,c:array[1..500000] of longint;

    procedure quick(l,r:longint);

    var i,j,k,temp:longint;

    begin

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

    repeat

    while a[i]>k do inc(i);

    while a[j]temp then

    begin temp:=b[j]; k:=j; end;

    end;

    c[i]:=k;

    b[k]:=0

    end;

    for i:=1 to n do

    begin

    k:=i;

    if k>m then k:=k mod m;

    b[c[k]]:=b[c[k]]+a[i];

    end;

    for i:= 1 to m do

    write(b[i],' ');

    end.

    各位大哥大姐 帮忙 看看 哪里错了 谢谢啦

    我都快受不了了啊 啊 啊啊 啊 a~~~~~~

  • 0
    @ 2008-11-04 08:51:27

    #include

    #define maxn 100000

    #define maxm 100000

    typedef struct Taotao{long num;long weight;long gotcha;} Taotao;

    long n,m,apple[maxn+10];

    Taotao taotao[maxm+10];

    void quicksort1(long low,long high)

    {

    long l=low,r=high,x=apple[low];

    while(l

  • 0
    @ 2008-11-02 13:46:16

    阿东VS燕麦:哦,快排+递归,水题还交了2遍,真是785人啊,75(气我)

    var

    a,b,c,f:array[1..500000]of longint;

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

    procedure sort(l,r: longint);

    var

    i,j,x,y: longint;

    begin

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

    repeat

    while a[i]>x do inc(i);

    while x>a[j] do dec(j);

    if not(i>j) then

    begin

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

    inc(i); dec(j);

    end;

    until i>j;

    if lb[j] do dec(j);

    if not(i>j) then

    begin

    y:=b[i]; b[i]:=b[j]; b[j]:=y;

    y:=c[i]; c[i]:=c[j]; c[j]:=y;

    inc(i); dec(j);

    end;

    until i>j;

    if l

  • 0
    @ 2008-11-02 12:29:09

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    看来数据不是很强大啊~写了100+行,0ms秒杀..

    PS: 我不会快排……没办法

  • 0
    @ 2008-10-29 22:51:32

    编译通过...

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

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

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

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

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

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

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

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

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

     ├ 错误行输出

    ├ 测试数据 10:运行超时|无输出...

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

    Unaccepted 有效得分:80 有效耗时:4862ms

    哪位大牛帮忙看看问题出在哪。

    万分感激啊。

    #include

    using namespace std;

    int tt[50001],ap[50001],t[50001];

    int qiang[50001]={0},f[50001];

    void qs(int data[],int low,int high){

      long i,x,j;

      if(lowtt[i];t[i]=tt[i];}

      qs(ap,1,n);

      qs(tt,1,n);

      i=j=1;

      while(im)j=1;

      }

      for(i=1;i

  • 0
    @ 2008-10-28 20:57:35

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    果然是748人通过啊= = ~~~ 真要74了

    program c1445;

    var n,m:longint;

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

    b,c:array [1..100002,1..2] of int64;

    procedure kp1(ii,jj:longint);

    var l,r:longint; x,mid:int64;

    begin

    l:=ii;

    r:=jj;

    x:=a[(ii+jj) shr 1];

    repeat

    while a[l]>x do inc(l);

    while a[r]x do inc(l);

    while b[r,1]

  • 0
    @ 2008-10-23 19:30:47

    哪位大牛帮我看看怎么回事啊,救命啊

    编译通过...

    ├ 测试数据 01:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 02:运行时错误...| 错误号: 202 | 堆栈溢出错

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

     ├ 错误行输出

    ├ 测试数据 04:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 05:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 06:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 07:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 08:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 09:运行时错误...| 错误号: 202 | 堆栈溢出错

    ├ 测试数据 10:运行时错误...| 错误号: 202 | 堆栈溢出错

    type

    mainstyle=record

    w,m:longint;

    o:qword;

    end;

    var

    t,n,m:longint;

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

    man:array[1..500000] of mainstyle;

    Procedure Init;

    var

    i:longint;

    begin

    readln(n,m);

    for i:= 1 to n do

    read(a[i]);

    for i:= 1 to m do

    read(man[i].w);

    for i:= 1 to m do

    begin

    man[i].m:=i;

    man[i].o:=0;

    end;

    end;

    Procedure Qsort1(k1,k2:longint);

    var

    head,vet,t,mid:longint;

    begin

    head:=k1; vet:=k2; mid:=a[(head+vet) div 2];

    while headmid do Inc(head);

    while a[vet]

  • 0
    @ 2008-10-14 11:10:26

    50行程序..

    注意是一轮一轮的上.

    注意是按顺序输出.然后其他没什么难的..[什么你不会快排...!?@#\(#\)^#\(%&\)%&]

  • 0
    @ 2008-10-06 12:11:21

    var a,b,wz,c:array[1..100000]of longint;

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

    procedure kp1(t,w:longint);

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

    begin

    if ta[w] then

    begin inc(i);k:=a[i];a[i]:=a[j];a[j]:=k;end;

    inc(i);k:=a[i];a[i]:=a[w];a[w]:=k;

    kp1(t,i-1);kp1(i+1,w);

    end;

    end;

    procedure kp2(t,w:longint);

    var i,j,tp,n,m:longint;

    begin

    if tb[w] then

    begin

    inc(i);tp:=b[i];b[i]:=b[j];b[j]:=tp;tp:=wz[i];wz[i]:=wz[j];wz[j]:=tp;

    end;

    inc(i);tp:=b[i];b[i]:=b[w];b[w]:=tp;tp:=wz[i];wz[i]:=wz[w];wz[w]:=tp;

    kp2(t,i-1);kp2(i+1,w);

    end;

    end;

    begin

    readln(n,m);

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

    for i:=1 to m do begin read(b[i]);wz[i]:=i;end;

    //for i:=1 to n-1 do for j:=i+1 to n do if a[j]>a[i] then begin tp:=a[i];a[i]:=a[j];a[j]:=tp;end;

    kp1(1,n);

    {for i:=1 to m-1 do

    for j:=i+1 to m do if b[j]>b[i] then

    begin

    tp:=b[i];b[i]:=b[j];b[j]:=tp;tp:=wz[i];wz[i]:=wz[j];wz[j]:=tp;

    end; }

    kp2(1,m);

    j:=1;

    for i:=1 to n do

    begin

    c[wz[j]]:=c[wz[j]]+a[i];if j=m then j:=1 else inc(j);

    end;

    for i:=1 to m do write(c[i],' ');

    end.

  • 0
    @ 2008-10-05 12:24:37

    lora templer 的确速度快,TIGER给我个77ms,不过我是2快排+模拟,但是用记录类型模拟起来很HAPPY哦

    RAY ALAN 是牛人哦!不是加空格,跟USACO一样,最后要writeln

    0ms是堆排序的结果,但是桶排?……

  • 0
    @ 2008-10-04 23:25:51

    无语。。。2个快排加模拟就过了,但是原来我的错误在哪里还是不知道。

    附上我原来的程序和AC的程序唯一不同的地方:

    for i:= 1 to m do

    begin

    re:=0; j:=0;

    while j*m+c[i]

信息

ID
1445
难度
5
分类
模拟 点击显示
标签
递交数
2844
已通过
879
通过率
31%
被复制
6
上传者