比赛 NOIP模拟赛1 评测结果 AAAAAATTTTTTTTTTTTTT
题目名称 天天爱射击 最终得分 30
用户昵称 AHOI_Captain 运行时间 14.062 s
代码语言 Pascal 内存使用 2.09 MiB
提交时间 2018-02-08 21:29:36
显示代码纯文本
Program Captain;
Var a,b,c:array[0..200001]of longint;
n,m,i,j,x,sum:longint;
Begin
Assign(input,'shooting.in');Assign(output,'shooting.out');
Reset(input);Rewrite(output);
	Readln(n,m);
	For i:=1 to n do read(a[i],b[i],c[i]);
	For j:=1 to m do begin
		Readln(x);sum:=0;
		For i:=1 to n do If (((x<b[i])and (x>a[i]))or (x=b[i])or (x=a[i]))and (c[i]>0)then begin 
			dec(c[i]);
			If c[i]<1 then inc(sum);
		End;
		Writeln(sum);
	End;
Close(input);Close(output);
End.