比赛 |
20091110 |
评测结果 |
WWWWWWWWWW |
题目名称 |
股票收益 |
最终得分 |
0 |
用户昵称 |
rottenwood |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2009-11-10 10:13:39 |
显示代码纯文本
- program stock;
- var
- w:array[1..1000] of real;
- i,j,k,m,n,t1,tol,c:longint;
- min,max,temp,ans,ans1:real;
- flag:boolean;
- begin
- assign(input,'stock.in');reset(input);
- assign(output,'stock.out');rewrite(output);
- readln(n);
- for i:=1 to n do
- read(w[i]);
- readln(m);
- min:=maxlongint;
- for i:=1 to n-1 do
- for j:=i+1 to n do
- begin
- inc(tol);
- if w[i]<m then flag:=true;
- t1:=trunc(m/w[i]);temp:=t1*w[j];ans:=temp-m;
- if ans>max then max:=ans;
- end;
- if not flag then ans:=0 else ans:=max;
- writeln(ans:0:3);
- for i:=1 to n-1 do
- for j:=i+1 to n do
- if w[i]<w[j] then inc(c);
- ans1:=c/tol;
- writeln(ans1:0:3);
- close(output);
- end.