记录编号 |
8415 |
评测结果 |
AAAAAAAAAAW |
题目名称 |
[BYVoid S3] 彩色穿孔卡片 |
最终得分 |
90 |
用户昵称 |
chengyang |
是否通过 |
未通过 |
代码语言 |
Pascal |
运行时间 |
0.812 s |
提交时间 |
2008-11-14 08:01:12 |
内存使用 |
0.20 MiB |
显示代码纯文本
program punch;
var
a:array[1..10000,1..2]of longint;
b:array[1..10000]of boolean;
n,t:integer;
procedure go;
var
i,j:longint;
Begin
assign(input,'punch.in');
assign(output,'punch.out');
reset(input); rewrite(output);
t:=0; readln(n);
for i:=1 to n do begin
readln(a[i,1],a[i,2]);
for j:=1 to i-1 do begin
if b[j] then begin
if (a[i,1]<=a[j,1])and(a[i,2]>=a[j,2])then begin
b[j]:=false;
t:=t-1;
end;
if (a[i,1]<a[j,1])and(a[i,2]>a[j,1])and(a[i,2]<a[j,2])then a[j,1]:=a[i,2];
if (a[i,2]>a[j,2])and(a[i,1]>a[j,1])and(a[i,1]<a[j,2])then a[j,2]:=a[i,1];
end;
end;
b[i]:=true;
t:=t+1;
end;
End;
Begin
go;
write(t);
close(input);close(output);
end.