比赛 |
20091110 |
评测结果 |
WWWWWWWWWW |
题目名称 |
股票收益 |
最终得分 |
0 |
用户昵称 |
bly1991 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2009-11-10 09:20:00 |
显示代码纯文本
- program bly(input,output);
- var
- data:array[1..1000] of real;
- f:array[1..1000,1..1000] of real;
- i,j:integer;
- ans,ans0,max:real;
- x0,y0,n,x,m,y:integer;
- f1,f2:text;
- begin
- assign(f1,'stock.in');
- reset(f1);
- readln(f1,n);
- for i:=1 to n do read(f1,data[i]);
- readln(f1,m);
- close(f1);
-
- for i:=1 to n-1 do begin
- for j:=i+1 to n do begin
- inc(y);
- f[i,j]:=data[j]-data[i];
- if f[i,j]>0 then inc(x);
- if f[i,j]>max then begin
- x0:=i;
- y0:=j;
- max:=f[i,j];
- end;
- end;
- end;
-
- assign(f2,'stock.out');
- rewrite(f2);
- ans:=(m/data[x0])*(data[y0]-data[x0]);
- ans0:=x/y;
- writeln(f2,ans:0:3);
- writeln(f2,ans0:0:3);
- close(f2);
- end.
-
-
-
-
-
-