508 条题解

  • 0
    @ 2008-11-07 17:04:11

    编译通过...

    ├ 测试数据 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-06 16:16:54

    program money;

    var N,i,j,l,x,y:longint;

    code:integer;

    t:string;

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

    b:array[1..100,1..2] of longint;

    c:array[1..100,1..2] of string;

    d:array[1..100] of longint;

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

    max:array[1..2] of longint;

    begin

    readln(N);

    for i:=1 to N do

    begin

    readln(a[i]);

    l:=pos(' ',a[i]);

    if a[i][l+3]='0' then x:=1 else x:=0;

    if a[i][l+x+6]='0' then y:=1 else y:=0;

    if x=0 then t:=copy(a[i],l+1,2) else t:='100';

    val(t,b,code);

    if x=0 then

    begin

    if y=0 then t:=copy(a[i],l+4,2) else t:='100';

    end

    else

    if y=0 then t:=copy(a[i],l+5,2) else t:='100';

    val(t,b,code);

    c:=copy(a[i],l+7+x+y,1);

    c:=copy(a[i],l+9+x+y,1);

    t:=copy(a[i],l+11+x+y,1);

    val(t,d[i],code);

    a[i]:=copy(a[i],1,l-1);

    end;

    for i:=1 to N do s[i]:=0;

    for i:=1 to N do

    begin

    if ((b>80) and (d[i]>=1)) then s[i]:=s[i]+8000;

    if ((b>85) and (b>80)) then s[i]:=s[i]+4000;

    if b>90 then s[i]:=s[i]+2000;

    if ((b>85) and (c='Y')) then s[i]:=s[i]+1000;

    if ((b>80) and (c='Y')) then s[i]:=s[i]+850;

    end;

    s[N+1]:=0;

    for i:=1 to N do s[N+1]:=s[N+1]+s[i];

    max[1]:=-1;

    for i:=1 to N do

    if s[i]>max[1] then begin

    max[1]:=s[i];

    max[2]:=i;

    end;

    writeln;

    write(a[max[2]]);

    writeln;

    write(max[1]);

    writeln;

    write(s[N+1]);

    end.

  • 0
    @ 2008-11-05 12:41:21

    var

    s:array[1..101] of string;

    a,q,b,f:array[1..101] of longint;

    x,xb:array[1..101] of char;

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

    t:string;

    begin

    readln(n);

    for i:=1 to n do

    begin

    readln(t);

    for j:=1 to length(t) do

    if t[j]=' ' then begin s[i]:=copy(t,1,j-1);break;end;

    for k:=j+1 to length(t) do

    if t[k]=' ' then

    begin for l:=j+1 to k-1 do q[i]:=q[i]*10+ord(t[l])-ord('0');break;end;

    for j:=k+1 to length(t) do

    if t[j]=' ' then

    begin for l:=k+1 to j-1 do b[i]:=b[i]*10+ord(t[l])-ord('0');break;end;

    x[i]:=t[j+1];xb[i]:=t[j+3];

    for k:=j+5 to length(t) do

    f[i]:=f[i]*10+ord(t[k])-ord('0');

    end;

    for i:=1 to n do

    begin

    if (q[i]>80)and(f[i]>=1) then a[i]:=a[i]+8000;

    if (q[i]>85)and(b[i]>80) then a[i]:=a[i]+4000;

    if (q[i]>90) then a[i]:=a[i]+2000;

    if (q[i]>85)and(xb[i]='Y') then a[i]:=a[i]+1000;

    if (b[i]>80)and(x[i]='Y') then a[i]:=a[i]+850;

    tot:=tot+a[i];

    end; j:=1;

    for i:=1 to n do if a[i]>a[j] then j:=i;

    writeln(s[j]);writeln(a[j]);write(tot);

    end.

  • 0
    @ 2008-11-04 12:41:32

    const maxn=1005;

    var

    s:string;

    mingzi:array[1..maxn]of string;

    qimo,fuping,lunwen,qian:array[1..maxn]of longint;

    ganbu,xibu:string;

    sol,i,j,k,n,temp,t2:longint;

    begin

    readln(n);

    fillchar(ganbu,sizeof(ganbu),'{');

    fillchar(xibu,sizeof(xibu),'{');

    fillchar(lunwen,sizeof(lunwen),0);

    fillchar(qian,sizeof(qian),0);

    for i:=1 to n do begin

    readln(s);

    for j:=1 to maxn do

      if s[j]=' ' then

       begin

       mingzi[i]:=copy(s,1,j-1);

        break;

       end;

    if s[j+2]=' ' then

      begin qimo[i]:=ord(s[j+1])-ord('0'); j:=j+2;

      end else if s[j+3]=' ' then

      begin qimo[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

       j:=j+3;

      end else begin qimo[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

       j:=j+4;   end;

    if s[j+2]=' ' then

      begin fuping[i]:=(ord(s[j+1])-ord('0'));

       j:=j+2;

      end else if s[j+3]=' ' then

      begin fuping[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

       j:=j+3;

      end else begin fuping[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

       j:=j+4; end;

    ganbu[i]:=s[j+1];

    xibu[i]:=s[j+3];

    lunwen[i]:=ord(s[j+5])-ord('0');

    end;

    for i:=1 to n do begin

      if (qimo[i]>80) and (lunwen[i]>=1) then qian[i]:=qian[i]+8000;

      if (qimo[i]>85) and (fuping[i]>80) then qian[i]:=qian[i]+4000;

      if (qimo[i]>90) then qian[i]:=qian[i]+2000;

      if (qimo[i]>85) and (xibu[i]='Y') then qian[i]:=qian[i]+1000;

      if (fuping[i]>80) and (ganbu[i]='Y') then qian[i]:=qian[i]+850;

    end;

    temp:=0;t2:=0;

    for i:=1 to n do        begin

    if temp

  • 0
    @ 2008-11-03 19:41:35

    编译通过...

    ├ 测试数据 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-03 16:49:25

    const maxn=1005;

    var

    s:string;

    mingzi:array[1..maxn]of string;

    qimo,fuping,lunwen,qian:array[1..maxn]of longint;

    ganbu,xibu:string;

    sol,i,j,k,n,temp,t2:longint;

    begin

    readln(n);

    fillchar(ganbu,sizeof(ganbu),'{');

    fillchar(xibu,sizeof(xibu),'{');

    fillchar(lunwen,sizeof(lunwen),0);

    fillchar(qian,sizeof(qian),0);

    for i:=1 to n do begin

    readln(s);

    for j:=1 to maxn do

      if s[j]=' ' then

       begin

       mingzi[i]:=copy(s,1,j-1);

        break;

       end;

    if s[j+2]=' ' then

      begin qimo[i]:=ord(s[j+1])-ord('0'); j:=j+2;

      end else if s[j+3]=' ' then

      begin qimo[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

       j:=j+3;

      end else begin qimo[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

       j:=j+4;   end;

    if s[j+2]=' ' then

      begin fuping[i]:=(ord(s[j+1])-ord('0'));

       j:=j+2;

      end else if s[j+3]=' ' then

      begin fuping[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

       j:=j+3;

      end else begin fuping[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

       j:=j+4; end;

    ganbu[i]:=s[j+1];

    xibu[i]:=s[j+3];

    lunwen[i]:=ord(s[j+5])-ord('0');

    end;

    for i:=1 to n do begin

      if (qimo[i]>80) and (lunwen[i]>=1) then qian[i]:=qian[i]+8000;

      if (qimo[i]>85) and (fuping[i]>80) then qian[i]:=qian[i]+4000;

      if (qimo[i]>90) then qian[i]:=qian[i]+2000;

      if (qimo[i]>85) and (xibu[i]='Y') then qian[i]:=qian[i]+1000;

      if (fuping[i]>80) and (ganbu[i]='Y') then qian[i]:=qian[i]+850;

    end;

    temp:=0;t2:=0;

    for i:=1 to n do        begin

    if temp

  • 0
    @ 2008-11-02 15:06:41

    ac% 60啦

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    type rec=record

    name:string;

    qimo,banji:longint;

    ganbu,west,lunwen:boolean;

    end;

    var a:array[1..10000] of rec;

    b:array[1..10000] of longint;

    i,max,n,lunwen,total:longint;

    s:char;

    begin

    max:=1;

    readln(n);

    for i:=1 to n do

    begin

    repeat

    read(s);

    if s=' ' then break;

    a[i].name:=a[i].name+s;

    until 11;

    read(a[i].qimo);

    read(a[i].banji);

    read(s);

    read(s);

    if s='Y' then a[i].ganbu:=true

    else a[i].ganbu:=false;

    read(s);

    read(s);

    if s='Y' then a[i].west:=true

    else a[i].west:=false;

    read(s);

    read(lunwen);

    if lunwen>0 then a[i].lunwen:=true

    else a[i].lunwen:=false;

    end;

    fillchar(b,sizeof(b),0);

    for i:=1 to n do

    begin

    if (a[i].qimo>80) and a[i].lunwen then b[i]:=b[i]+8000;

    if (a[i].qimo>85) and (a[i].banji>80) then b[i]:=b[i]+4000;

    if (a[i].qimo>90) then b[i]:=b[i]+2000;

    if (a[i].qimo>85) and a[i].west then b[i]:=b[i]+1000;

    if (a[i].banji>80) and a[i].ganbu then b[i]:=b[i]+850;

    if b[i]>b[max] then max:=i;

    total:=total+b[i];

    end;

    writeln(a[max].name);

    writeln(b[max]);

    writeln(total);

    end

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

    program scholar;

    const maxn=1005;

    var

    s:string;

    mingzi:array[1..maxn]of string;

    qimo,fuping,lunwen,qian:array[1..maxn]of longint;

    ganbu,xibu:string;

    sol,i,j,k,n,temp,t2:longint;

    begin

    readln(n);

    fillchar(ganbu,sizeof(ganbu),'{');

    fillchar(xibu,sizeof(xibu),'{');

    fillchar(lunwen,sizeof(lunwen),0);

    fillchar(qian,sizeof(qian),0);

    for i:=1 to n do begin

    readln(s);

    for j:=1 to maxn do

    if s[j]=' ' then

    begin

    mingzi[i]:=copy(s,1,j-1);

    break;

    end;

    if s[j+2]=' ' then

    begin qimo[i]:=ord(s[j+1])-ord('0'); j:=j+2;

    end else if s[j+3]=' ' then

    begin qimo[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

    j:=j+3;

    end else begin qimo[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

    j:=j+4; end;

    if s[j+2]=' ' then

    begin fuping[i]:=(ord(s[j+1])-ord('0'));

    j:=j+2;

    end else if s[j+3]=' ' then

    begin fuping[i]:=(ord(s[j+1])-ord('0'))*10+ord(s[j+2])-ord('0');

    j:=j+3;

    end else begin fuping[i]:=(ord(s[j+1])-ord('0'))*100+(ord(s[j+2])-ord('0'))*10+ord(s[j+3])-ord('0');

    j:=j+4; end;

    ganbu[i]:=s[j+1];

    xibu[i]:=s[j+3];

    lunwen[i]:=ord(s[j+5])-ord('0');

    end;

    for i:=1 to n do begin

    if (qimo[i]>80) and (lunwen[i]>=1) then qian[i]:=qian[i]+8000;

    if (qimo[i]>85) and (fuping[i]>80) then qian[i]:=qian[i]+4000;

    if (qimo[i]>90) then qian[i]:=qian[i]+2000;

    if (qimo[i]>85) and (xibu[i]='Y') then qian[i]:=qian[i]+1000;

    if (fuping[i]>80) and (ganbu[i]='Y') then qian[i]:=qian[i]+850;

    end;

    temp:=0;t2:=0;

    for i:=1 to n do begin

    if temp

  • 0
    @ 2008-11-01 22:44:04

    include

    struct stu

    {

    char Name[20];

    char Gan,West;

    int Class;

    int Passage,Trem;

    int Sm;

    }Student[100];

    main()

    {

    int n,i,j,Max=0;

    unsigned int ss=0;

    scanf("%d",n);

    for(i=0;i=1))

       Student[i].Sm+=8000;

      

       if((Student[i].Trem>85)&&(Student[i].Class>80))

       Student[i].Sm+=4000;

      

       if(Student[i].Trem>90)

       Student[i].Sm+=2000;

      

       if((Student[i].Trem>85)&&(Student[i].West=='Y'))

       Student[i].Sm+=1000;

      

       if((Student[i].Gan=='Y')&&(Student[i].Class>80))

       Student[i].Sm+=8000;

      

       if(Student[i].Sm>Max)

       {

           Max=Student[i].Sm;

           j=i;

       }

       ss+=Student[i].Sm;

    }

    printf("%s\n%d\n%d",Student[i].Name,Max,ss);

    return 0;

    }

  • 0
    @ 2008-11-01 19:00:58

    简单!!!!!!!!!!!!!!!!!!!!!!!!!!!

    一步一步判断

  • 0
    @ 2008-11-01 14:21:15

    改变

  • 0
    @ 2008-11-01 12:46:48

    水题。。

    打错了一个变量,交了2次。

  • 0
    @ 2008-11-01 11:26:11

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    找道水题

    AC50!!!!

    YEAR!!!!

  • 0
    @ 2008-10-30 21:35:46

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    这种题目竟然也能超时???

  • 0
    @ 2008-10-30 19:26:53

    #include

    struct stu

    {

    char Name[20];

    char Gan,West;

    int Class;

    int Passage,Trem;

    int Sm;

    }Student[100];

    main()

    {

    int n,i,j,Max=0;

    unsigned int ss=0;

    scanf("%d",n);

    for(i=0;i=1))

    Student[i].Sm+=8000;

    if((Student[i].Trem>85)&&(Student[i].Class>80))

    Student[i].Sm+=4000;

    if(Student[i].Trem>90)

    Student[i].Sm+=2000;

    if((Student[i].Trem>85)&&(Student[i].West=='Y'))

    Student[i].Sm+=1000;

    if((Student[i].Gan=='Y')&&(Student[i].Class>80))

    Student[i].Sm+=8000;

    if(Student[i].Sm>Max)

    {

    Max=Student[i].Sm;

    j=i;

    }

    ss+=Student[i].Sm;

    }

    printf("%s\n%d\n%d",Student[i].Name,Max,ss);

    return 0;

    }

  • 0
    @ 2008-10-31 20:49:30

    #include "stdio.h"

    struct S

    {

    char name[30];

    long money;

    }a[101],t;

    long Sum=0;

    void work(int i,int pj,int py,char gb,char xb,int lw)

    {

    if(pj>80&&lw)

    a[i].money+=8000;

    if(pj>85&&py>80)

    a[i].money+=4000;

    if(pj>90)

    a[i].money+=2000;

    if(pj>85&&xb=='Y')

    a[i].money+=1000;

    if(py>80&&gb=='Y')

    a[i].money+=850;

    }

    int main()

    {

    int N,pj,py,lw,i,j;

    char xb,gb;

    scanf("%d",&N);

    for(i=1;i

  • 0
    @ 2008-10-29 23:09:26

    (Invalid img)不难,蛮烦人

    编译通过...

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

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

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

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

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

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

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

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

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

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

    Accepted 有效得分:1 有效耗时:ms

  • 0
    @ 2008-10-28 12:48:15

    program aa;

    var temp,a,b,n,m,c,d:int64;

    begin

    readln(a,b);

    if b>a then begin

      n:=b;

      m:=a;

      c:=b;

      d:=a;

    end

    else begin

      n:=a;

      m:=b;

      c:=a;

      d:=b;

    end;

    while true do begin

      if n mod m=0 then break;

      temp:=n;

      n:=m;

      m:=temp mod m;

    end;

    writeln((c div m) *d);

    end.

  • 0
    @ 2008-10-27 21:53:11

    var

    a,b,l,n,i:integer;

    name,name1:string;

    sum,money,max:longint;

    west,gan,temp:char;

    begin

    max:=0;

    sum:=0;

    readln(n);

    for i:=1 to n do

    begin

      name:='';

      money:=0;

      read(temp);

      repeat

       name:=name+temp;

       read(temp)

      until temp=' ';

      read(a); read(b);

      repeat

       read(temp)

      until temp' ';

      gan:=temp;

      repeat

       read(temp)

      until temp' ';

      west:=temp;

      read(l);

      readln;

      if (a>80)and(l>0)then money:=money+8000;

      if (a>85)and(b>80)then money:=money+4000;

      if a>90 then money:=money+2000;

      if (a>85)and(west='Y')or(west='y')then money:=money+1000;

      if (b>80)and(gan='Y')or(gan='y')then money:=money+850;

      sum:=sum+money;

      if money>max then

      begin

       name1:=name;

       max:=money

      end;

    end;

    writeln(name1);

    writeln(max);

    writeln(sum)

    end.

  • 0
    @ 2008-10-27 21:34:10

    不用数组,超短代码,排列整齐。

    var

    a,b,l,n,i:integer;

    name,name1:string;

    sum,money,max:longint;

    west,gan,temp:char;

    begin

    max:=0;

    sum:=0;

    readln(n);

    for i:=1 to n do

    begin

    name:='';

    money:=0;

    read(temp);

    repeat

    name:=name+temp;

    read(temp)

    until temp=' ';

    read(a); read(b);

    repeat

    read(temp)

    until temp' ';

    gan:=temp;

    repeat

    read(temp)

    until temp' ';

    west:=temp;

    read(l);

    readln;

    if (a>80)and(l>0)then money:=money+8000;

    if (a>85)and(b>80)then money:=money+4000;

    if a>90 then money:=money+2000;

    if (a>85)and(west='Y')or(west='y')then money:=money+1000;

    if (b>80)and(gan='Y')or(gan='y')then money:=money+850;

    sum:=sum+money;

    if money>max then

    begin

    name1:=name;

    max:=money

    end;

    end;

    writeln(name1);

    writeln(max);

    writeln(sum)

    end.

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
39260
已通过
12791
通过率
33%
被复制
130
上传者