给出n个数,n
卡内存的神题,用数组存下来刚好1mb,再加上运行时消耗内存,马上爆。因此我们用优先队列存储一半的数。网上的某些代码,用priority_queue全爆内存。我存的125000长度的数组,加上STL的make_heap()
#include
#include
using namespace std;
int a[125010];
int main()
{
in...
分类:
其他好文 时间:
2015-08-16 15:16:36
阅读次数:
126
Flip and ShiftTime Limit: 2 Seconds Memory Limit: 65536 KBThis puzzle consists of a random sequence of m black disks and n white disks on an oval-s...
分类:
其他好文 时间:
2015-08-16 15:13:15
阅读次数:
126
Word Ladder II描述Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from startto end, such that:? Only one...
分类:
编程语言 时间:
2015-08-16 15:12:33
阅读次数:
266
Given is a set of integers and then a sequence of queries. A query gives you a number and asks to ?nd a sum of two distinct numbers from the set, whic...
分类:
其他好文 时间:
2015-08-16 15:06:46
阅读次数:
94
UVA 10534 - Wavio Sequence定义一种 Wavio 的序列。其长度为2*n+1,前n+1严格递增,后n+1个严格递减。
求在给的序列中找一个最长的 Wavio 子序列。输出长度。正向LIS求出每个点以该点为结尾的最长上升子序列长度p[i],然后反向LIS求出以该点位开头的最长递减子序列长度q[i]。然后枚举 Wavio 子序列的中点,该店的 Wavio 长度为 2 * min...
分类:
其他好文 时间:
2015-08-16 00:38:33
阅读次数:
155
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma...
分类:
其他好文 时间:
2015-08-15 22:48:01
阅读次数:
130
Description
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal ...
分类:
其他好文 时间:
2015-08-15 18:27:35
阅读次数:
153
Y sequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1192 Accepted Submission(s): 265
Problem Description
Yellowstar likes int...
分类:
其他好文 时间:
2015-08-15 18:22:18
阅读次数:
123
F -FTime Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uDescriptionA subsequence of a given sequence is the given sequence with some ele...
分类:
其他好文 时间:
2015-08-15 18:10:19
阅读次数:
108
原题:DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the...
分类:
其他好文 时间:
2015-08-15 18:09:44
阅读次数:
130