文件名称:main
-
所属分类:
- 标签属性:
- 上传时间:2014-03-26
-
文件大小:545byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
/*
算法训练
? 算法训练 区间k大数查询 ?
问题描述
给定一个序列,每次询问序列中第l个数到第r个数中第K大的数是哪个。
输入格式
第一行包含一个数n,表示序列长度。
第二行包含n个正整数,表示给定的序列。
第三个包含一个正整数m,表示询问个数。
接下来m行,每行三个数l,r,K,表示询问序列从左往右第l个数到第r个数中,从大往小第K大的数是哪个。序列元素从1开始标号。
输出格式
总共输出m行,每行一个数,表示询问的答案。
样例输入
5
1 2 3 4 5
2
1 5 2
2 3 2
样例输出
4
2
数据规模与约定
对于30 的数据,n,m<=100;
对于100 的数据,n,m<=1000;
保证k<=(r-l+1),序列中的数<=106。
*/-/* Algorithm for training? Algorithms interval training large numbers k query? Problem Descr iption Given a sequence l Always ask first sequence number to the first number in a large number of r Section K is which. Input format The first line contains a number n, expressed sequence length. The second line contains a positive integer n, which means that a given sequence. The third contains a positive integer m, indicates the number of inquiry. Next m lines of three numbers l, r, K, represents the first l ask sequence from left to right number to the number in the first r, from the big to the small section K which large numbers. Sequence of elements from a start label. Total output format output m lines, each a number, which means that asking answers. Sample Input 5123452152232 Sample size and data output 42 to 30 percent of the agreed data, n, m < = 100 100 of the data, n, m < = 1000 ensure that k < = (r-l+1), the sequence number < = 106.* /
算法训练
? 算法训练 区间k大数查询 ?
问题描述
给定一个序列,每次询问序列中第l个数到第r个数中第K大的数是哪个。
输入格式
第一行包含一个数n,表示序列长度。
第二行包含n个正整数,表示给定的序列。
第三个包含一个正整数m,表示询问个数。
接下来m行,每行三个数l,r,K,表示询问序列从左往右第l个数到第r个数中,从大往小第K大的数是哪个。序列元素从1开始标号。
输出格式
总共输出m行,每行一个数,表示询问的答案。
样例输入
5
1 2 3 4 5
2
1 5 2
2 3 2
样例输出
4
2
数据规模与约定
对于30 的数据,n,m<=100;
对于100 的数据,n,m<=1000;
保证k<=(r-l+1),序列中的数<=106。
*/-/* Algorithm for training? Algorithms interval training large numbers k query? Problem Descr iption Given a sequence l Always ask first sequence number to the first number in a large number of r Section K is which. Input format The first line contains a number n, expressed sequence length. The second line contains a positive integer n, which means that a given sequence. The third contains a positive integer m, indicates the number of inquiry. Next m lines of three numbers l, r, K, represents the first l ask sequence from left to right number to the number in the first r, from the big to the small section K which large numbers. Sequence of elements from a start label. Total output format output m lines, each a number, which means that asking answers. Sample Input 5123452152232 Sample size and data output 42 to 30 percent of the agreed data, n, m < = 100 100 of the data, n, m < = 1000 ensure that k < = (r-l+1), the sequence number < = 106.* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
main.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.