|
|
вернуться в форумcan anyone tell me why WA var n:integer; total:real; t:array[1..5000]of shortint; v:array[1..5000]of real; procedure init; var I,b,j:integer; a:char; c:real; begin readln(N); for i:=1 to n do begin read(a); while a<>' ' do read(a); read(b); if b=1 then begin read(c); v[i]:=c; t[i]:=1; for j:=1 to i-1 do if t[j]=0 then begin total:=total+c; t[j]:=1; v[j]:=c; end else if t[j]=1 then begin if c>v[j] then begin write('NO'); halt; end; end; total:=total+c; end else t[i]:=0; readln; end; end; begin init; if total>100 then write('NO') else write('YES'); end. |
|
|