码迷,mamicode.com
首页 >  
搜索关键字:hdu 2602    ( 30933个结果
HDU 4588 Count The Carries(找规律,模拟)
题目大意:求二进制的a加到b的进位数。思路:列出前几个2进制,找规律模拟。#include #include #include #include #include #include #include using namespace std;int main(){ int a,b,id; ...
分类:其他好文   时间:2014-07-08 22:58:23    阅读次数:295
AC 自动机在这里
HDU 3065,模板(备忘录)#include#include#include#include#includeusing namespace std;#define M 2222222char sx[1111][128];int n;char s[M];struct Trie{ ...
分类:其他好文   时间:2014-07-08 22:48:34    阅读次数:192
HDU 1014 Uniform Generator 题解
找到规律之后本题就是水题了,不过找规律也不太容易的,证明这个规律成立更加不容易。 本题就是求step和mod如果GCD(最大公约数位1)那么就是Good Choice,否则为Bad Choice 为什么这个结论成立呢? 因为当GCD(step, mod) == 1的时候,那么第一次得到序列:x0, x0 + step, x0 + step…… 那么mod之后,必然下一次重复出现比x0大的数必...
分类:其他好文   时间:2014-07-08 19:16:21    阅读次数:227
HDU 2829 Lawrence(动态规划-四边形不等式)
HDU 2829 Lawrence(动态规划-四边形不等式) 题目大意: 有n个点连在一起,m个炸弹可以阻断它们的相连,问你全部用完炸弹后的最小值。 解题思路: 四边形不等式是一种比较常见的优化动态规划的方法: 设m[i,j]表示动态规划的状态量。 m[i,j]有类似如下的状态转移方程: m[i,j]=opt{m[i,k]+m[k,j]}(i≤k≤j) 如果对于任意的a≤b≤c≤d,有m[a,c]+m[b,d]≤m[a,d]+m[b,c],那么m[i,j]满足四边形不等式。 以上是适用这种优化方法的必要...
分类:其他好文   时间:2014-07-08 18:07:15    阅读次数:273
HDU 1020:Encoding
Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25691    Accepted Submission(s): 11289 Problem Description Given a string ...
分类:其他好文   时间:2014-07-08 17:23:00    阅读次数:183
hdu1466 计算直线的交点数(找规律+数学)
hdu1466 计算直线的交点数(找规律+数学)...
分类:其他好文   时间:2014-07-08 16:54:57    阅读次数:173
HDU 2040:亲和数
亲和数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20775    Accepted Submission(s): 12590 Problem Description 古希腊数学家毕达哥拉斯在自然数研究中...
分类:其他好文   时间:2014-07-08 16:07:07    阅读次数:160
hdu 4717 The Moving Points(三分)
http://acm.hdu.edu.cn/showproblem.php?pid=4717 大致题意:给出每个点的坐标以及每个点移动的速度和方向。问在那一时刻点集中最远的距离在所有时刻的最远距离中最小。 比赛时一直以为是计算几何,和线段相交什么的有关。赛后队友说这是道三分,仔细想了想确实是三分,试着画画图发现它是一个凸性函数,存在一个最短距离。然后三分时间就可以了。 ...
分类:其他好文   时间:2014-07-08 16:05:41    阅读次数:234
HDU 4403 A very hard Aoshu problem (DFS暴力)
题意:给你一个数字字符串,问在字符串中间加‘=’、‘+’使得‘=’左右两边相等。 1212  : 1+2=1+2,   12=12; 12345666 : 12+3+45+6=66,  1+2+3+4+56=66; #include #include #include #include #include #include #include #include #include #inc...
分类:其他好文   时间:2014-07-08 14:41:26    阅读次数:243
HDU 1013 Digital Roots 题解
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process ...
分类:其他好文   时间:2014-07-08 14:12:32    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!