Acdream 1099 —————— "quick platoon half, input plug-in"

Source: Internet
Author: User

Yao Yao's K-daTime limit:2000MS Memory Limit:128000KB 64bit IO Format:%lld &%llu SubmitStatusPracticeacdream 1099

Description

One day, the sister of Meng-Yao (Tsyao) is very boring, come to you to play. But you don't even know what to play. Embarrassed for a while, the witty Yao Yao proposed: "So, you say N integer XI, and then at random to say a number K, I can quickly say the numbers inside the K large number." ”

Input

Line 1th Two integer N, K separated by a space;

The 2nd line has N integers (which can appear the same number, all randomly generated), also separated by a space.

0 < N≤5*10^6, 0 < K≤n

1≤xi≤10^8

Output

Output section kThe big numbers.

Sample Input

5 25 4 1 3 1

Sample Output

4

Hint

In the case of 2,2,1, the first of the three numbers is 2, the second is 2, and the third is 1. Problem-solving ideas: hand-beating fast platoon, directional, purposeful selection of interval division, input plug optimization.

#include <stdio.h> #include <algorithm> #include <string.h>using namespace Std;const int Maxn=1e7;int    A[maxn];int Scan () {char C;    int Sgn,ret;    if (C=getchar (), c==eof) return 0; while (c!= '-' && (c< ' 0 ' | |    C> ' 9 ')) C=getchar ();    sgn= (c== '-')? -1:1;    ret= (c== '-')? 0: (c ' 0 ');    while (C=getchar (), c>= ' 0 ' &&c<= ' 9 ') ret=ret*10+ (c ' 0 ');    RET *=SGN; return ret;}    int mysort (int l,int r,int k) {if (l==r) {//interval has only one value, that is, the K-value return a[l];    } int key=a[l];    int low=l;    int high=r;        while (Low

  

Acdream 1099 —————— "quick platoon half, input plug-in"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.