码迷,mamicode.com
首页 >  
搜索关键字:maximum repetition s    ( 4177个结果
Max Points on a Line(6)
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.如何判断点在同一条直线上呢?可以这么办。设定一个初始起点,计算剩余点到起始点直线的斜率,如果存在斜率相...
分类:其他好文   时间:2014-11-07 20:32:32    阅读次数:206
Codesforces 485D Maximum Value
D. Maximum ValueYou are given a sequenceaconsisting ofnintegers. Find the maximum possible value of(integer remainder ofaidiv...
分类:其他好文   时间:2014-11-07 12:59:49    阅读次数:120
Codeforces 484B Maximum Value(高效+二分)
题目链接: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 Tree
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
Codeforces Round #276 (Div. 2)D - Maximum Value(筛法)
就是一种筛法思想的应用。#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#defin...
分类:其他好文   时间:2014-11-07 00:48:28    阅读次数:227
Codeforces Round #276 (Div. 1)Maximum Value
题意很好理解,就是让你搞到两个数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
Codeforces 484(#276 Div 1) B Maximum Value 筛法
题意:给你一个数组,问你其中 对于 1 aj 中 ai % aj 的最大值是多少解题思路:筛法求每个数的倍数 ,并找到数组中存在的在它左边离这个倍数最近的树(可以预处理出来)解题代码: 1 // Author: darkdream 2 // Created Time: 2014年11月06日 星期....
分类:其他好文   时间:2014-11-06 14:41:27    阅读次数:192
Maximum Depth of Binary Tree
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
第二十次codeforces竞技结束 #276 Div 2
真是状况百出的一次CF啊…… 最终还Unrated了,你让半夜打cf 的我们如何释怀(中途茫茫多的人都退场了)……虽说打得也不好…… 在这里写一下这一场codeforces的解题报告,A-E的 题目及AC代码,部分题目有简单评析,代码还算清晰,主要阅读代码应该不难以理解。...
分类:其他好文   时间:2014-11-06 07:06:51    阅读次数:237
Maximum Product Subarray (3)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!