tju1004
曹天齐吧
全部回复
仅看楼主
level 6
soso9spikear 楼主
program p1004;const m=20;var a,b:array[1..m] of integer; c:array[1..m] of boolean; d,i,j,n,w,max:integer; function ok:boolean; var tt:boolean; begin tt:=true; for i:=1 to w do if c[i] then tt:=false; ok:=tt; end;begin assign(input,'D:/tongji/input.txt');reset(input); i:=0; repeat inc(i); read(a[i]); until seekeof; w:=i; for i:=1 to w do b[i]:=1; for i:=w downto 1 do begin max:=0; for j:=i to w do if (a[j]<=a[i]) and (b[j]>max) then max:=b[j]; b[i]:=b[i]+max; end; max:=0; for i:=1 to w do if b[i]>max then max:=b[i]; write(max,' '); for i:=1 to w do c[i]:=true; d:=0; repeat inc(d); for i:=1 to w do if c[i] then begin c[i]:=false; for j:=i to w do if (a[j]<=a[i]) and (a[j]>max) then max:=a[j]; j:=1; while a[j]<>max do inc(j); i:=j; c[j]:=false end; until ok; writeln(d); close(input);end.
2006年05月21日 09点05分 1
level 6
soso9spikear 楼主
没有文件的哦
2006年05月21日 09点05分 2
level 6
soso9spikear 楼主
防御导弹Time Limit:1s Memory Limit:1000k Total Submit:8163 Accepted:2596 下载样例程序(PE) --------------------------------------------------------------------------------Problem某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够达到任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在使用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。 Input最多20个整数,分别表示导弹依次飞来的高度(雷达给出高度数据是不大于30000的正整数) Output两个整数M和N。表示:这套系统最多能拦截 M 枚导弹,如果要拦截所有导弹最少要配备 N 套这种导弹系统。 Sample Input300 250 275 252 200 138 245Sample Output5 2
2006年07月20日 12点07分 3
1