#1133: Two minutes • Two points find K decimal time limit:10000msSingle Point time limit:1000msMemory Limit:256MB
Describe
In the last time we know nettle playing "warship これ", nettle of the garrison has a lot of position, but more is limited. Nettle through the fishing boat and out of a rare ship, but the existing N (1≤n≤1,000,000) has a ship. So nettle had to tear down one of the ships to give way to the new boat. Nettle thought for a long time, decided to randomly select a K, and then remove the rare K small ship. Each ship is known to have its own rarity, and nettle now tells you the rarity of all the ships, hoping you can help him find the target ship.
Hint: Two-part lookup of a non-ordered array
Input
Line 1th: 2 integer n,k. n indicates the length of the array,
Line 2nd: N integers, representing A[1..N], guaranteed not to have duplicate numbers, 1≤a[i]≤2,000,000,000.
Output
Line 1th: an integer t, which indicates that T is a small number of k in the array, and if K is not in the array, output-1.
-
-
Sample input
-
-
10 41732 4176 2602 6176 1303 6207 3125 1 1011 6600
-
-
Sample output
-
-
1732
Sort sorted just look test instructions want me to write a quick line?????
hiho#1133: two points • Two points to find the K decimal