记录编号 |
260215 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2005]谁拿了最多奖学金 |
最终得分 |
100 |
用户昵称 |
Ten.X |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.004 s |
提交时间 |
2016-05-12 21:10:48 |
内存使用 |
0.21 MiB |
显示代码纯文本
var s,name:array[1..100]of string;
job,west,wenzhang:array[1..100]of boolean;
money:array[1..100] of longint;
fenshu,ping:array[1..100]of integer;
i,j,n:integer;l:string;he:longint;max:integer;
procedure deal(a:string);
begin
i:=pos(' ',a);
name[j]:=copy(a,1,i-1);
delete(a,1,i);
i:=pos(' ',a);
l:=copy(a,1,i-1);
if length(l)=3 then fenshu[j]:=100 else
fenshu[j]:=10*(ord(l[1])-48)+(ord(l[2])-48);delete(a,1,i);
i:=pos(' ',a);l:=copy(a,1,i-1);
if length(l)=3 then ping[j]:=100 else
ping[j]:=10*(ord(l[1])-48)+(ord(l[2])-48);delete(a,1,i);
i:=pos(' ',a);l:=copy(a,1,i-1);
if l='Y' then job[j]:=true else job[j]:=false;delete(a,1,i);
i:=pos(' ',a);l:=copy(a,1,i-1);
if l='Y' then west[j]:=true else west[j]:=false;delete(a,1,i);
if a<>'0' then wenzhang[j]:=true else wenzhang[j]:=false;
end;
procedure jisuan;
begin
if (fenshu[j]>80) and (wenzhang[j]) then money[j]:=money[j]+8000;
if (fenshu[j]>85) and (ping[j]>80) then money[j]:=money[j]+4000;
if (fenshu[j]>90) then money[j]:=money[j]+2000;
if (fenshu[j]>85) and (west[j]) then money[j]:=money[j]+1000;
if (ping[j]>80) and (job[j]) then money[j]:=money[j]+850;
end;
begin
assign(input,'scholar.in');reset(input);
assign(output,'scholar.out');rewrite(output);
readln(n);fillchar(money,sizeof(money),0);
for i:=1 to n do readln(s[i]);
for j:=1 to n do begin deal(s[j]);jisuan;end;
he:=0;max:=money[1]; for i:=1 to n do he:=he+money[i];
for i:=2 to n do
if money[i]>max then begin max:=money[i];j:=i;end;
writeln(name[j]);writeln(max);write(he);
close(input);close(output);
end.