求问大神是什么地方出错

只过了9个点……同一页有多个脚注应该没有问题,请大神看看是什么情况?

编译成功

测试数据 #0: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #7: WrongAnswer, time = 0 ms, mem = 812 KiB, score = 0
测试数据 #8: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 820 KiB, score = 10
WrongAnswer, time = 0 ms, mem = 820 KiB, score = 90

###Block Code
var
a:array[1..1000] of longint;
n,k,f,i,pg,ft,more,x,num:longint;

begin
readln(n,k);
readln(f);
pg:=0; ft:=0;
for i:= 1 to f do
begin
readln(x,num);
inc(pg,(x-ft-1) div k);
more:=(x-ft-1) mod k;
if more+num+1>k then begin
inc(pg);
ft:=x-num-1;
end
else ft:=x-more-num-1;
end;
inc(pg,(n-ft) div k);
more:=(n-ft) mod k;
if more>0 then inc(pg);
writeln(pg);
end.

2 条评论

  • 1

信息

ID
1203
难度
4
分类
贪心 点击显示
标签
递交数
2180
已通过
859
通过率
39%
被复制
7
上传者