why_always_japan @ 2015-08-26 10:39:42
我这么和(diao)谐(zha)化(tian)的代码哪里错了
program stop;
var a:array[1..1000] of integer;
b:array[1..1000] of boolean;
n,m,k,s,i,max,min,p,j,l,r:integer;
d:boolean;
begin
read(n,m);
for i:=1 to m do
begin
fillchar (b,sizeof(b),false);
max:=1000;
d:=true;
read(s);
for j:=1 to s do
begin
read(p);
if j=1 then l:=p;
if j=s then r:=p;
b[p]:=true;
if a[i]<max then max:=a[i];
end;
for k:=l to r do
begin
if not(b[k]) then d:=false;
if (a[k]>=max)and(not(b[k])) then max:=a[k]+1;
end;
if d then continue;
for k:=l to r do
if b[k] then a[k]:=max;
end;
max:=0;
min:=1001;
for i:=1 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
writeln(max-min+1);
end.
by why_always_china @ 2015-08-26 11:15:52
测一下这组数据:
4 3 2 1 4 3 1 3 4
4 1 2 3 4
其实我已经帮你测过了,你输出2,但是标程应为3
by why_always_china @ 2015-08-26 17:32:47
测一下这组数据:
4 3 2 1 4 3 1 3 4
4 1 2 3 4
其实我已经帮你测过了,你输出2,但是标程应为3
by Slience_K @ 2015-10-26 09:52:07
@[url=/space/show?uid=6553]why_always_china[/url] 你这组数据不合法吧 , 如果分成3个等级 , 第一条线路怎么不在3 , 4号停啊。。。
by why_always_china @ 2015-10-26 20:43:51
@[url=/space/show?uid=8480]Slience_K[/url]
1级车站:2
2级车站:3
3级车站:1 4
还有什么分法?
by why_always_china @ 2015-10-26 20:45:04
从高级车站到低级车站是不受限制的
by why_always_china @ 2015-10-26 21:12:48
@[url=/space/show?uid=8480]Slience_K[/url]
1级车站:2
2级车站:3
3级车站:1 4
还有什么分法?
by 1jia1 @ 2016-10-07 10:52:37
by ezoiHQM @ 2017-08-09 15:53:19
c党表示看不懂