Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
区间覆盖问题
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 18, Accepted users: 15
Problem 11115 : No special judgement
Problem description
  设x1,x2,x3...,xn是实直线上的n个点。用固定长度的闭区间覆盖这n个点,至少需要多少个这样的固定长度闭区间?

Input
  第一行有2 个正整数n和 k,表示有 n个点,且固定长度闭区间的长度为k。接下来的 1行中,有n个整数,表示 n个点在实直线上的坐标(可能相同)。(n < 10000)

Output
  计算出的最少区间数输出。

Sample Input
7 3 
1 2 3 4 5 -2 6 
Sample Output
3
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:18391 today,16241382 total, since 2010-05-07