社区讨论
存程序、
P2278[HNOI2003] 操作系统参与者 6已保存回复 22
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 22 条
- 当前快照
- 1 份
- 快照标识符
- @mi4ef5de
- 此快照首次捕获于
- 2025/11/18 17:56 4 个月前
- 此快照最后确认于
- 2025/11/18 17:59 4 个月前
CPP
program aaa;
type process=record
ar,ti,im:longint;
end;
var heap:array[1..15001] of process;
i,j,x,a,t,imp,sum,t0:longint;
procedure put(da:longint);
var fa,son:longint;
begin
inc(sum);
heap[sum].ar:=a;
heap[sum].ti:=t;
heap[sum].im:=da;
son:=sum;
while (heap[son div 2].im<heap[son].im) and (son>1) do
begin
exchange(heap[son div 2].ar,heap[son].ar);
exchange(heap[son div 2].ti,heap[son].ti);
exchange(heap[son div 2].im,heap[son].im);
son:=son div 2;
end;
end;
function
CPPbegin
sum:=0;
while not(eof) do
begin
readln(x,a,t,imp);
if (sum=0) or (imp<=heap[1].im) then
begin
put(t);
if x=1 then t0:=t;
else begin
while a+t>=heap[1].t+t0 then
end;
end;
end.
回复
共 22 条回复,欢迎继续交流。
正在加载回复...