ACM: 划分树 poj 2761 在poj2104基…
来源:互联网 发布:mac安装jdk 编辑:程序博客网 时间:2024/06/04 20:30
Description
Your task is to help Jiajia calculate which dog ate the food aftereach feeding.
Input
The second line contains n integers, describe the pretty value ofeach dog from left to right. You should notice that the dog withlower pretty value is prettier.
Each of following m lines contain three integer i,j,k, it meansthat Jiajia feed the k-th pretty dog in this feeding.
You can assume that n<100001 andm<50001.
Output
Sample Input
7 2
1 5 2 6 3 7 4
1 5 3
2 7 1
Sample Output
3
2
题意: jiajia帮Wind喂狗, 找出区间的第K大元素, 但是此题会有附加出现相同元素.
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
#define MAX 100015
int n, m;
int a[MAX], val[30][MAX], num[30][MAX];
int start, end, k;
int cmp(const void *a, const void *b)
{
}
void build_tree(int l, int r, int deep)
{
}
int find(int start, int end, int s, int e, int k, intdeep)
{
}
int main()
{
//
}
- ACM: 划分树 poj 2761 在poj2104基…
- ACM: 划分树 poj 2104
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: polay定理 数论题 poj 1286 …
- ACM: 回文串 dp题 poj 1159 (滚动…
- ACM: 最小堆 poj 2227 最小堆 fro…
- ACM: 最小堆 poj 2274 思路清晰, …
- POj 2379 ACM Rank Table
- ACM: 简单最小生成树 图论题 poj 1…
- ACM: 线段树 poj 1151 足足想了三…
- ACM: 线段树 poj 2828 认真对待每…
- ACM: 线段树 poj 2777 继续熟练线…
- ACM: 线段树 poj 2482 煽情的情书!…
- ACM: 深搜 poj 2676
- ACM: 深搜题 poj 3411
- ACM: poj 1664
- ACM: poj 1050
- ACM: poj 1964
- ARM (二) arm指令分类及其寻址方式
- ARM (三) arm中C/C++及汇编语言的…
- ACM: 动态规划题 poj 2033 (博客好…
- ACM: 动态规划题 poj 1036 问题简…
- ACM: 划分树 poj 2104
- ACM: 划分树 poj 2761 在poj2104基…
- ACM: 最小堆 poj 2227 最小堆 fro…
- ACM: 最小堆 poj 2274 思路清晰, …
- ACM: 线段树 poj 2352
- ACM: 线段树 poj 1151 足足想了三…
- 运算符与表达式
- ACM: 线段树 poj 1177
- 计算机和资料 转载
- ACM: trie树 poj 2513