cswork / OA打开练习工作台

其他OA #13

Get Minimum Number of Routes

估计中等评测数据准备中,可先阅读题面

考点(AI 标注)位运算哈希计数

The first line of the input consists of two space-separated integers - num and numCord, representing the number of pickup locations (N) and number of coordinates for a pick up location (numCord (P) is always equal to two), respectively. The next N lines consist of P space-separated integers - pickX and pickY, representing the X and Y coordinates of a pickup location, respectively. The next line consists of an integer - baseXₒ representing the X coordinate of the base location. The next line consists of an integer - baseYₒ representing the Y coordinate of the base location. Print an integer representing the minimum number of routes connecting all the pickup locations to the base location. Thanks a bazillion, spike!

Constraints

  • 1 ≤ num ≤ 10⁵
  • -10³ ≤ pickX, pickY, baseXₒ, baseYₒ ≤ 10³

Example 1

Input:

pickupLocations = [[1, 1], [-1, 1], [2, 3]]
baseX = 0
baseY = 0

Output:

3

Explanation: From the base coordinate (0,0) three different routes will cover all the pickup locations.