Переведите из PascalABC в C++

var p3,h,p,p1: array[1..2000000] of int64;

i,n,j,u,l,kf,x,o,p2:int64;

begin

u:=0;

read(n,x);p2:=0;

for i:=1 to n do read(h[i]);

read(kf);

i:=1;

for i:=1 to kf do begin read(p[i]);

if p[i]=1 then begin n:=n+1;read(h[n]);end;


if p[i]=2 then p2:=p2+1;

if p[i]=3 then begin

u:=u+1;

read(p3[u]);

p3[u]+=1+p2;

l:=0;

for j:=1+p2 to (p3[u]-1) do begin if h[j]>=x then l:=l+1;end;

writeln(l);

end;

end;

end.
Ввод:
1 2
3
5
1 2
1 1
3 0
3 1
3 2
вывод:
0
1
2
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.