Hot Search : Source embeded web remote control p2p game More...
Location : Home Downloads SourceCode Mathimatics-Numerical algorithms Data structs

verse K-th problem

  • Category : Data structs
  • Tags :
  • Update : 2017-07-07
  • Size : 132kb
  • Downloaded :0次
  • Author :孤独的****
  • About : Nobody
  • PS : If download it fails, try it again. Download again for free!
Introduction - If you have any usage issues, please Google them yourself
FancyCoder raises problem called "Reverse K-th Problem". The description is also simple: given an array of N integers A[1],A[2],...,A[n] and some queries, each query asks for the number of continuous subsequences of the array in which the K-th largest element is X. The first line contains an integer T (1 <= T <= 5), indicating the number of test cases. For each test case: The first line contains two integers N and Q (1 <= N <= 2,000, 1 <= Q <= 2,000,000), indicating there are N integers in the array and Q queries. The second line contains N integers between 1 and N, indicating the element of the array. Then Q lines follow, the i-th line contains two integers Ki and Xi (1 <= Ki,Xi <= N), indicating that the i-th query asks for the number of continuous subsequences of the array in which the Ki-th largest element is Xi. For each test case: Output Q lines, the i-th line contains one integer, indicating the answer to the i-th query.
Packet file list
(Preview for download)
新建文件夹\2015级第5组_《计算机高级语言》 课程设计报告.doc
新建文件夹\verse K-th problem.cpp
Related instructions
  • We are an exchange download platform that only provides communication channels. The downloaded content comes from the internet. Except for download issues, please Google on your own.
  • The downloaded content is provided for members to upload. If it unintentionally infringes on your copyright, please contact us.
  • Please use Winrar for decompression tools
  • If download fail, Try it againg or Feedback to us.
  • If downloaded content did not match the introduction, Feedback to us,Confirm and will be refund.
  • Before downloading, you can inquire through the uploaded person information

Nothing.

Post Comment
*Quick comment Recommend Not bad Password Unclear description Not source
Lost files Unable to decompress Bad
*Content :
*Captcha :
CodeBus is the largest source code store in internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.