http://acm.hdu.edu.cn/showproblem.php?pid=5461 分析:一开始很撒很撒的分了很多种情况去写了,后来发现可以先储存a*num*num和b*num的值,然后再判断最大值。。 #include <iostream> #include <stdio.h> #inc ...
分类:
其他好文 时间:
2016-08-11 17:54:25
阅读次数:
164
Problem Description Given the sequence A with n integers t1,t2,?,tn. Given the integral coefficients a and b. The fact that select two elements ti and ...
分类:
其他好文 时间:
2016-08-11 17:48:03
阅读次数:
177
找最长的连接的点的数量。用tarjan缩点,思考可知每一个强连通分量里的点要么都选,要么都不选(走别的路),可以动规解决。 ...
分类:
其他好文 时间:
2016-08-07 18:28:02
阅读次数:
181
Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 30914 Accepted: 16846 Description There is a rectangular room, covered with s ...
分类:
其他好文 时间:
2016-08-07 15:30:30
阅读次数:
142
Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. Not ...
分类:
其他好文 时间:
2016-08-05 15:53:05
阅读次数:
94
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or ...
分类:
其他好文 时间:
2016-08-02 11:34:21
阅读次数:
110
传送门 有一个整数数组,请你根据快速排序的思路,找出数组中第K大的数。 给定一个整数数组a,同时给定它的大小n和要找的K(K在1到n之间),请返回第K大的数,保证答案存在。 测试样例: note: 注意手写快排的时候: leetcode: 传送门 215. Kth Largest Element i ...
分类:
其他好文 时间:
2016-08-01 19:13:01
阅读次数:
195
Largest prime factor Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Largest prime factor Description Everybody knows any number ...
分类:
其他好文 时间:
2016-07-30 19:37:52
阅读次数:
126
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [?2,1,?3,4,?1,2, ...
分类:
编程语言 时间:
2016-07-29 19:02:17
阅读次数:
143
368. Largest Divisible Subset Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this sub ...
分类:
其他好文 时间:
2016-07-25 06:56:52
阅读次数:
218