比赛 NOIP2008集训模拟4 评测结果 AEAAAAEEEE
题目名称 彩色穿孔卡片 最终得分 50
用户昵称 zxc111 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-13 11:10:22
显示代码纯文本
program ooo;
var
i,j,k,n,m:longint;
a:array[1..1000,1..2] of longint;
f:array[0..100001] of longint;
q:array[0..100001] of boolean;
t:Text;
begin
assign(t,'punch.in');
reset(t);
readln(t,n);
fillchar(a,sizeof(a),0);
fillchar(f,sizeof(f),0);
fillchar(q,sizeof(q),false);
for i:=1 to n do
 begin
  readln(t,a[i,1],a[i,2]);
  for j:=a[i,1]+1 to a[i,2] do
   f[j]:=i;
  if m<a[i,2] then m:=a[i,2];
 end;
close(t);
for i:=1 to m do
 q[f[i]]:=true;
k:=0;
for i:=1 to m do
if q[i]=true then inc(k);
assign(t,'punch.out');
rewrite(t);
write(t,k);
close(t);
end.