515 条题解
-
0
Will~骷髅 LV 3 @ 2008-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 -
02008-10-22 19:23:36@
type
rec=record
name:string;
qm:longint;
bj:longint;
xg:boolean;
xb:boolean;
lw:boolean;
so:longint;
end;
var
r:array [1..1000] of rec;
max:rec;
n,i,j:integer;
m:longint;
str:string;
begin
readln(n);
for i:=1 to n do
begin
readln(str);
r[i].name:=copy(str,1,pos(' ',str)-1);
delete(str,1,pos(' ',str));
while str[1]' ' do begin r[i].qm:=r[i].qm*10+ord(str[1])-ord('0');delete(str,1,1);end;
delete(str,1,1);
while str[1]' ' do begin r[i].bj:=r[i].bj*10+ord(str[1])-ord('0');delete(str,1,1);end;
delete(str,1,1);
if str[1]='Y' then r[i].xg:=true else r[i].xg:=false;
if str[3]='Y' then r[i].xb:=true else r[i].xb:=false;
delete(str,1,4);
if (ord(str[1])-ord('0')>=1) then r[i].lw:=true else r[i].lw:=false;
r[i].so:=0;
end;
m:=0;
max:=r[1];
for i:=1 to n do
begin
r[i].so:=0;
if (r[i].bj>80) and (r[i].xg) then inc(r[i].so,850);
if (r[i].qm>85) and (r[i].xb) then inc(r[i].so,1000);
if r[i].qm>90 then inc(r[i].so,2000);
if (r[i].qm>85) and (r[i].bj>80) then inc(r[i].so,4000);
if (r[i].qm>80) and (r[i].lw) then inc(r[i].so,8000);
if (r[i].so)>max.so then max:=r[i];
inc(m,r[i].so);
end;
writeln(max.name);
writeln(max.so);
writeln(m);
end.
用记录数组不就OK了....麻烦个啥 -
02008-10-19 21:18:18@
program vp1001;
type
student=record
name:string[20];
sorce:integer;
pi:integer;
xg:string;
xs:string;
lw:integer;
jj:integer
end;
var
st:array [1..100] of student;
i,n,max,j,t:integer;
begin
read(n);
for i:=1 to n do
begin
readln(st[i].name);
readln(st[i].sorce,st[i].pi);
readln(st[i].xg);
readln(st[i].xs);
readln(st[i].lw)
end;
{with st[i] do
begin
readln(name);
readln(sorce,pi);
readln(xg);
readln(xs);
readln(lw)
end; }
for i:=1 to n do
st[i].jj:=0;
for i:=1 to n do
begin
if (st[i].sorce>80) and (st[i].lw>=1)
then
st[i].jj:=8000+st[i].jj;
if (st[i].sorce>85) and (st[i].pi>80)
then
st[i].jj:=4000+st[i].jj;
if st[i].sorce>90
then
st[i].jj:=st[i].jj+2000;
if (st[i].sorce>85) and (st[i].xs='y')
then
st[i].jj:=st[i].jj+1000;
if (st[i].pi>80) and (st[i].xs='y')
then
st[i].jj:=st[i].jj+850
end;
for i:=1 to n-1 do
for j:=2 to n do
if st[i].jj>st[j].jj
then
begin
t:=st[j].jj;
st[j].jj:=st[i].jj;
st[i].jj:=t
end;
writeln(st[n].name);
writeln(st[n].jj);
max:=0;
for i:=1 to n do
max:=max+st[i].jj;
writeln(max)
end.
真是搞不懂 如此天书式解题竟然通不过 -
02008-10-19 11:52:18@
这里涉及到的就是记录不用也可以,输入数据的字符串处理,求最大值。
-
02008-10-19 08:27:54@
Program P1001;
Type rec=record
all,name,w,c:string;
s,e,p:integer;
end;
Var
n,i,j,maxN,money,total:longint;
cop,maxP:string;
a:array[1..100] of rec;Begin
maxN:=0;
total:=0;
j:=0;readln(n);
For i:=1 to n do begin
readln(a[i].all);
while pos(' ',a[i].all)0 do begin
j:=j+1;
cop:=copy(a[i].all,1,pos(' ',a[i].all)-1);
case j of
1: a[i].name:=cop;
2: val(cop,a[i].s);
3: val(cop,a[i].e);
4: a[i].c:=cop;
5: a[i].w:=cop;
end;
delete(a[i].all,1,pos(' ',a[i].all));
if pos(' ',a[i].all)=0 then val(a[i].all,a[i].p);
end;j:=0;
If (a[i].s>80) and (a[i].p>=1) then money:=8000;
If (a[i].s>85) and (a[i].e>80) then money:=money+4000;
If (a[i].s>90) then money:=money+2000;
If (a[i].s>85) and ((a[i].w='Y') or (a[i].w='y')) then money:=money+1000;
If (a[i].e>80) and ((a[i].c='Y') or (a[i].c='y')) then money:=money+850;
If (MaxN=0) or (money>MaxN) then begin
MaxN:=money;
MaxP:=a[i].name;
end;
Total:= Total + money ;
money:=0;
End;Writeln(Maxp);
Writeln(Maxn);
Writeln(total);
End. -
02008-10-15 21:16:04@
#include
using namespace std;struct stu
{
char name[25];
int final;
int group;
char leader;
char west;
int acd;
int scol;
};stu scolar[100];
int main()
{
int n;
cin>>n;
stu max;
max.scol=-1;
double total=0;
int i;
for(i=0;i>scolar[i].name>>scolar[i].final>>scolar[i].group>>scolar[i].leader>>scolar[i].west>>scolar[i].acd;
scolar[i].scol=0;
if(scolar[i].final>80&&scolar[i].acd>=1)
{
scolar[i].scol+=8000;
}
if(scolar[i].final>85&&scolar[i].group>80)
scolar[i].scol+=4000;
if(scolar[i].final>90)
scolar[i].scol+=2000;
if(scolar[i].final>85&&scolar[i].west=='Y')
scolar[i].scol+=1000;
if(scolar[i].group>80&&scolar[i].leader=='Y')
scolar[i].scol+=850;if(scolar[i].scol>max.scol)
{
max.scol=scolar[i].scol;
strcpy(max.name,scolar[i].name);
}
total+=scolar[i].scol;}
printf("%s\n%d\n%.0lf",max.name,max.scol,total);}
-
02008-10-15 15:47:29@
编译通过...
├ 测试数据 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-14 20:27:33@
注意如果最大值不唯一只输出第一个
汗~~
死在这里了 -
02008-10-11 13:36:49@
编译通过...
├ 测试数据 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-11 11:20:51@
type rec=record
name:string;
m1,m2,sum:longint;
c1,c2:char;
m:byte;
end;
var
a:array[1..100] of rec;
i,j,k,n,ans,max:longint;
c:char;
begin
readln(n);
for i:=1 to n do begin
read(c);
while c' ' do begin
a[i].name:=a[i].name+c;
read(c)
end;
read(a[i].m1);
read(a[i].m2);
read(c);
read(a[i].c1);
read(c);
read(a[i].c2);
read(a[i].m);
readln;
end;
for i:=1 to n do begin
if (a[i].m1>80) and (a[i].m>0) then begin
a[i].sum:=a[i].sum+8000;
ans:=ans+8000;
end;
if (a[i].m1>85) and (a[i].m2>80) then begin
a[i].sum:=a[i].sum+4000;
ans:=ans+4000;
end;
if a[i].m1>90 then begin
a[i].sum:=a[i].sum+2000;
ans:=ans+2000;
end;
if (a[i].m1>85) and (a[i].c2='Y') then begin
a[i].sum:=a[i].sum+1000;
ans:=ans+1000;
end;
if (a[i].m2>80) and (a[i].c1='Y') then begin
a[i].sum:=a[i].sum+850;
ans:=ans+850;
end;
end;
max:=0;
for i:=1 to n do
if a[i].sum>max then begin
k:=i;
max:=a[i].sum;
end;
writeln(a[k].name);
writeln(max);
writeln(ans);
end. -
02008-10-10 21:59:15@
Program P1001;
Type rec=record
all,name,w,c:string;
s,e,p:integer;
end;
Var
n,i,j,maxN,money,total:longint;
cop,maxP:string;
a:array[1..100] of rec;Begin
maxN:=0;
total:=0;
j:=0;readln(n);
For i:=1 to n do begin
readln(a[i].all);
while pos(' ',a[i].all)0 do begin
j:=j+1;
cop:=copy(a[i].all,1,pos(' ',a[i].all)-1);
case j of
1: a[i].name:=cop;
2: val(cop,a[i].s);
3: val(cop,a[i].e);
4: a[i].c:=cop;
5: a[i].w:=cop;
end;
delete(a[i].all,1,pos(' ',a[i].all));
if pos(' ',a[i].all)=0 then val(a[i].all,a[i].p);
end;j:=0;
If (a[i].s>80) and (a[i].p>=1) then money:=8000;
If (a[i].s>85) and (a[i].e>80) then money:=money+4000;
If (a[i].s>90) then money:=money+2000;
If (a[i].s>85) and ((a[i].w='Y') or (a[i].w='y')) then money:=money+1000;
If (a[i].e>80) and ((a[i].c='Y') or (a[i].c='y')) then money:=money+850;
If (MaxN=0) or (money>MaxN) then begin
MaxN:=money;
MaxP:=a[i].name;
end;
Total:= Total + money ;
money:=0;
End;Writeln(Maxp);
Writeln(Maxn);
Writeln(total);
End.好像我方法有点不一样~~~