比赛 |
NOIP2015普及组练习 |
评测结果 |
AAAAAAAAAA |
题目名称 |
谁拿了最多奖学金 |
最终得分 |
100 |
用户昵称 |
lyl610 |
运行时间 |
0.005 s |
代码语言 |
Pascal |
内存使用 |
0.10 MiB |
提交时间 |
2015-11-04 14:01:08 |
显示代码纯文本
var
n,i,k,kk,lun,ans : longint;
c : char;
s : string;
f,q : array[0..1000] of longint;
a : array[0..1000] of string[25];
bj,bjj : boolean;
procedure qs(l,r : longint );
var
i,j,z,zz : longint;
tp,tpp,kk : longint;
tps : string[25];
begin
i:=l; j:=r; kk:=random(r-l+1)+l;
z:=f[kk]; zz:=q[kk];
repeat
while ((f[i]>z) or ((f[i]=z) and (q[i]<zz))) do inc(i);
while ((f[j]<z) or ((f[j]=z) and (q[j]>zz))) do dec(j);
if i<=j then
begin
tp:=f[i]; f[i]:=f[j]; f[j]:=tp;
tpp:=q[i]; q[i]:=q[j]; q[j]:=tpp;
tps:=a[i]; a[i]:=a[j]; a[j]:=tps;
inc(i); dec(j);
end;
until i>j;
if i<r then qs(i,r);
if l<j then qs(l,j);
end;
begin
assign(input,'scholar.in');reset(input);
assign(output,'scholar.out');rewrite(output);
readln(n);
randomize;
for i:=1 to n do q[i]:=i;
for i:=1 to n do
begin
read(c);
s:=c;
while c<>' ' do begin read(c); s:=s+c; end;
delete(s,length(s),1);
a[i]:=s;
read(k,kk);
read(c); read(c);
if c='Y' then bj:=true;
read(c); read(c);
if c='Y' then bjj:=true;
readln(lun);
if (k>80) and (lun<>0) then inc(f[i],8000);
if (k>85) and (kk>80) then inc(f[i],4000);
if (k>90) then inc(f[i],2000);
if bjj and (k>85) then inc(f[i],1000);
if bj and (kk>80) then inc(f[i],850);
inc(ans,f[i]);
bj:=false; bjj:=false;
end;
qs(1,n);
writeln(a[1]);
writeln(f[1]);
writeln(ans);
close(input);close(output);
end.