505 条题解
-
0c569139242 LV 3 @ 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;
beginreadln(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 -
02008-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 -
02008-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;
beginreadln(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 -
02008-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 -
02008-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;
beginreadln(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 -
02008-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;
} -
02008-11-01 19:00:58@
简单!!!!!!!!!!!!!!!!!!!!!!!!!!!
一步一步判断 -
02008-11-01 14:21:15@
改变
-
02008-11-01 12:46:48@
水题。。
打错了一个变量,交了2次。 -
02008-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!!!! -
02008-10-30 21:35:46@
编译通过...
├ 测试数据 01:运行超时|无输出...
├ 测试数据 02:运行超时|无输出...
├ 测试数据 03:运行超时|无输出...
├ 测试数据 04:运行超时|无输出...
├ 测试数据 05:运行超时|无输出...
├ 测试数据 06:运行超时|无输出...
├ 测试数据 07:运行超时|无输出...
├ 测试数据 08:运行超时|无输出...
├ 测试数据 09:运行超时|无输出...
├ 测试数据 10:运行超时|无输出...
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:0 有效耗时:0ms这种题目竟然也能超时???
-
02008-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;
} -
02008-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 -
02008-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
-
02008-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. -
02008-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. -
02008-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. -
02008-10-26 16:53:17@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms -
02008-10-23 19:17:59@
program ex;
var
n,i,j,k,step,step1:longint;
pinjun,pinyi,lunwen:longint;
st:string;
a:array[1..108,1..6]of string;
b:array[1..108,1..2]of longint;
//=====================================
procedure init;
begin
readln(n);
fillchar(b,sizeof(b),0);
for i:=1 to n do
begin
readln(st);
step:=0;
step1:=1;
for j:=1 to length(st) do
if st[j]=' '
then begin
inc(step);
a:=copy(st,step1,j-step1);
step1:=j+1;
end;
a:=copy(st,step1,j-step1+1);
end;
{ for i:=1 to n do
begin
for j:=1 to 6 do
write(a,' ');
writeln;
end; }
end;
//======================================
procedure jisuan;
begin
for i:=1 to n do
begin
b:=i;
val(a,pinjun);
val(a,pinyi);
val(a,lunwen);
if (pinjun>80)and(lunwen>=1)
then inc(b,8000);
if (pinjun>85)and(pinyi>80)
then inc(b,4000);
if (pinjun>90)
then inc(b,2000);
if (pinjun>85)and(a='Y')
then inc(b,1000);
if (pinyi>80)and(a='Y')
then inc(b,850);
end;
end;
//======================================
procedure pa;
begin
for i:=1 to n-1 do
for j:=i+1 to n do
if b -
02008-10-22 19:49:05@
#include
using namespace std;
long n,sum,i,j,k,t,map[100]={0};
char name[100][20],ins,sur;
int main(){
cin>>n;
sum=0;
for(i=0;i>name[i]>>j>>k>>ins>>sur>>t;
if(j>80&&t>=1) map[i]+=8000;
if(j>85&&k>80) map[i]+=4000;
if(j>90) map[i]+=2000;
if(j>85&&sur=='Y') map[i]+=1000;
if(k>80&&ins=='Y') map[i]+=850;
sum+=map[i];
}
j=0;
for(i=1;imap[j]) j=i;
cout