题目链接:Codeforces 484B Maximum Value
题目大意:给定一个序列,找到连个数ai和aj,ai%aj尽量大,并且ai≥aj
解题思路:类似于素数筛选法的方式,每次枚举aj,然后枚举k,每次用二分找到小于k?aj并且最大的ai,维护答案,过程中加了一些剪枝。
#include
#include
#include
using namespace std;...
分类:
其他好文 时间:
2014-11-07 01:04:41
阅读次数:
244
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:
其他好文 时间:
2014-11-07 00:58:54
阅读次数:
259
就是一种筛法思想的应用。#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#defin...
分类:
其他好文 时间:
2014-11-07 00:48:28
阅读次数:
227
题意很好理解,就是让你搞到两个数a[i],a[j]使得a[i]>a[j]且a[i]%a[j]最大,然后把最大值输出来.然后,我就开始乱搞了,时间复杂度有点高,O(n*sqrt(max(a[i]));很容易得出一个结论 如果a[i]>a[j]且a[i]/p==a[j]/p那么a[j]%p>a[j]%p...
分类:
其他好文 时间:
2014-11-06 19:55:05
阅读次数:
269
题意:给你一个数组,问你其中 对于 1 aj 中 ai % aj 的最大值是多少解题思路:筛法求每个数的倍数 ,并找到数组中存在的在它左边离这个倍数最近的树(可以预处理出来)解题代码: 1 // Author: darkdream 2 // Created Time: 2014年11月06日 星期....
分类:
其他好文 时间:
2014-11-06 14:41:27
阅读次数:
192
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-11-06 12:57:50
阅读次数:
176
真是状况百出的一次CF啊……
最终还Unrated了,你让半夜打cf 的我们如何释怀(中途茫茫多的人都退场了)……虽说打得也不好……
在这里写一下这一场codeforces的解题报告,A-E的 题目及AC代码,部分题目有简单评析,代码还算清晰,主要阅读代码应该不难以理解。...
分类:
其他好文 时间:
2014-11-06 07:06:51
阅读次数:
237
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t...
分类:
其他好文 时间:
2014-11-05 22:59:32
阅读次数:
228
http://jwcooney.com/2012/08/13/asp-net-error-adding-the-specified-count-to-the-semaphore-would-cause-it-to-exceed-its-maximum-count/Justin Cooney / 20...
分类:
Web程序 时间:
2014-11-05 19:29:58
阅读次数:
283
跟踪路由用法: tracert ?? ?[-d]? [-h maximum_hops]? [-j host-list] [-w timeout] [-R]? [-S srcaddr] [-4] [-6]? target_name ??选项: ??? ??? ? ? -d 不将地址解析成主机名。 -h maximum_h...
分类:
其他好文 时间:
2014-11-04 11:17:18
阅读次数:
204