hiho week 224 register

Ended

Participants:153

Verdict:Accepted
Score:100 / 100
Submitted:2018-10-15 23:06:37

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//1: Split Array
// : 10000ms
// : 1000ms
// : 256MB
//
//You are given an sorted integer array A and an integer K.Can you split A into several sub - arrays that each sub - array has exactly K continuous increasing integers.
//
//For example you can split{ 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6 }  into{ 1, 2, 3 }, { 1, 2, 3 }, { 3, 4, 5 }, { 4, 5, 6 }.
//
//
//The first line contains an integer T denoting the number of test cases. (1 <= T <= 5)
//
//Each test case takes 2 lines.The first line contains an integer N denoting the size of array A and an integer K. (1 <= N <= 50000, 1 <= K <= N)
//
//The second line contains N integers denoting array A. (1 <= Ai <= 100000)
//
//
//For each test case output YES or NO in a separate line.
//
//
//3
//12 3
//1 1 2 2 3 3 3 4 4 5 5 6
//12 4
//1 1 2 2 3 3 3 4 4 5 5 6
//12 3
//60001 60001 60002 60002 60003 60003 60003 60004 60004 60005 60005 60005 60006
//
//YES
//NO
//YES
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX