题目的意思:给点区间[a, b],查找第K大的数,和POJ2104题一样,只是HDU上的时间限制5000MS,用我在POJ上的方法,过不了,会超时。
而这一题的代码,改一下main函数的输入,就可以直接AC了POJ上的2104.
这题,用分桶法,WR,纠结了一晚上,最后还是放弃了,实在不知道错在哪里。于是改用了划分树的方法,学习了划分树的建立和查找。
划分树:主要运用于求解序列中区间[a, ...
分类:
其他好文 时间:
2015-07-25 15:20:52
阅读次数:
159
---约束分5种:主键 外键 唯一 非空 检查5类约束Oracle中分列级别约束 与 表级别约束列级别约束:在创建表时再列上面加约束例如:create table table11(stuno number(2) constraint table_pk primary key,tname varcha...
分类:
数据库 时间:
2015-07-25 13:48:22
阅读次数:
152
题意:统计区间 [1,n] 中含有 '13' 且模 13 为 0 的数字有多少个。分析:由(HDU 2089 不要62)和(CF 55D - Beautiful numbers)想到该题做法,dp[i][j][f][mod],长度为i,前缀是否为1,是否已符合条件,余数为mod的数字个数。#incl...
分类:
其他好文 时间:
2015-07-25 12:07:06
阅读次数:
99
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of ...
分类:
其他好文 时间:
2015-07-25 10:45:07
阅读次数:
114
题目的意思是:给你一个N个数的数组,有M条询问,每一次输入3个数,i, j ,k 意思是数组中从第 i 个到第 j 个中的数从小到大排序,第k个数是哪个?输出来。
题目时间限制是20000MS,相对比较宽松,但是如果你用普通的方法来做,还是超时,没询问一次,你就要排一次序,消耗很多时间。我们可以想另外一种方法,也就是只用排一次序的。
我们可以用这样的方法:每一个数,输入的时候,记录它原本的位...
分类:
其他好文 时间:
2015-07-25 10:44:15
阅读次数:
121
问题描述Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. Y...
分类:
其他好文 时间:
2015-07-25 10:37:37
阅读次数:
117
HTML5的vedio和audio元素,二者的兼容性目前不少很好,所以在写的时候要考虑到备用方案;HTML5表单元素:email, url , data, number, range, search, tel, color下面再放一个canvas的小实例:canvas小实例Powered By HT...
分类:
Web程序 时间:
2015-07-25 01:40:41
阅读次数:
143
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5288OO has got a array A of size n ,defined a function f(l,r) represent the number of i (li) satisfy ai...
分类:
其他好文 时间:
2015-07-25 00:07:22
阅读次数:
131
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2015-07-24 23:54:38
阅读次数:
107
For a number written in Roman numerals to be considered valid there are basic rules which must be followed. Even though the rules allow some numbers to be expressed in more than
one way there is alw...
分类:
其他好文 时间:
2015-07-24 22:42:34
阅读次数:
290