SHARE
TWEET

Untitled

a guest Jul 17th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a,b:array [1..1010] of longint;
  2.      max,s,n,j:longint;
  3.      i,x,y:longint;
  4.  
  5. begin
  6.  readln(n);
  7.  for i:=1 to n do begin
  8.    readln(x,y);
  9.    inc(a[x]);
  10.    dec(a[y+1]);
  11.  end;
  12.  s:=0; max:=0;
  13.  for i:=1 to 1010 do begin
  14.    s:=s+a[i];
  15.    if s>max then max:=s;
  16.  end;
  17.  writeln(max);
  18. end.
RAW Paste Data
Top