谁拿了最多的奖学金-pascal
2012-03-15 11:22
211 查看
题目描述略,巨水无比
View Code
Runtimeerror了N次,快排打错了,哎,这都能错
还有就是双关键字排序第二关键字按字符串大小写了一个。。没看题阿。。。。
就这样吧。。。
View Code
program sky; 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 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); end.
Runtimeerror了N次,快排打错了,哎,这都能错
还有就是双关键字排序第二关键字按字符串大小写了一个。。没看题阿。。。。
就这样吧。。。
相关文章推荐
- 【NOIP2005】谁拿了最多奖学金
- tyvj 1002 谁拿了最多奖学金
- 百练_2715:谁拿了最多奖学金
- Q11_最多奖学金 字符串数组
- luogu1051 谁拿了最多奖学金(NOIP2005提高组第1题)
- 【排序+模拟】谁拿了最多奖学金 luogu-1051
- 【NOIP提高组2005】谁拿了最多奖学金
- 谁拿了最多奖学金
- NOIP2005 提高组 复赛 scholar 谁拿了最多奖学金
- codeves天梯 谁拿了最多奖学金
- 排序ex——谁拿了最多奖学金
- 04:谁拿了最多奖学金
- 第2章练习题--7--谁拿了最多奖学金--2715
- Vijos 1001题:谁拿了最多奖学金
- 普及练习场 排序Ex 谁拿了最多奖学金
- tyvj P1002 谁拿了最多奖学金
- P1001 谁拿了最多奖学金
- HUNAN UNIVERSITY ACM/ICPC Judge Online —— Problem 10026 谁拿了最多奖学金
- 谁拿了最多奖学金
- 谁拿了最多奖学金