Home > OS >  Sorting two arrays
Sorting two arrays

Time:05-27

I am trying to solve one of algorithm problem. The problem looks very challenging. But, I think can solved by shorting the arrays...

Problem Description

Task. You are given a set of points on a line and a set of segments on a line. The goal is to compute, for each point, the number of segments that contain this point.

Input Format. The first line contains two non-negative integers s and p defining the number of segments and the number of points on a line, respectively. The next s lines contain two integers ai, bi defining the i-th segment [ai, bi]. The next line contains p integers defining points x1, x2, . . . , xp.

Constraints. 1 ≤

  • Related