HDOJ
yo_haha
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2550百步穿杨
Problem Description 时维九月,序属三秋,辽军大举进攻MCA山,战场上两军正交锋.辽军统帅是名噪一时的耶律-James,而MCA方则是派出了传统武将中草药123.双方经过协商,约定在十一月八日正午十分进行射箭对攻战.中草药123早早就开始准备,但是他是武将而不是铁匠,造弓箭的活就交给聪明能干的你了,现在告诉你每种弓箭规格,即箭身的长度,以及每种规格弓箭所需要的数目,要求你把需要的原创 2015-04-14 12:24:58 · 474 阅读 · 0 评论 -
hdu 1754 I hate it
http://acm.hdu.edu.cn/showproblem.php?pid=1754#include <cstdio> using namespace std; const int maxx=200000; int sum[maxx<<2]; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 int MAX(int a, int b) {原创 2015-05-31 23:53:23 · 250 阅读 · 0 评论 -
hdu 1394 线段树求逆序数
http://acm.hdu.edu.cn/showproblem.php?pid=1394#include <cstdio> using namespace std; const int maxx=5100; int sum[maxx<<2]; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 void pushup(int rt) { s原创 2015-06-01 08:40:00 · 249 阅读 · 0 评论 -
hdu 1195 双向bfs
http://acm.hdu.edu.cn/showproblem.php?pid=1195 这代码好长,不过好多重复的内容。#include <iostream> #include <queue> #include <cstring> using namespace std; struct node { int x, step; }; int vis[10000]; node q1[10原创 2015-06-19 18:07:57 · 319 阅读 · 0 评论 -
hdu 2899 二分
http://acm.hdu.edu.cn/showproblem.php?pid=2899在[0,100]上F’x单调增 所以求F’(x0)=0 将x0代入F(x) 即为答案#include <cstdio> #include <cmath> #include <iostream> using namespace std; const double res=1e-6; double ans(d原创 2015-06-04 21:41:12 · 332 阅读 · 0 评论 -
hdu 1251 字典树
http://acm.hdu.edu.cn/showproblem.php?pid=1251 MLE了无数次…最后换了种方法#include <iostream> #include <cstring> #include <cstdio> using namespace std; struct node { int num; int next[26]; void ini()原创 2015-06-08 14:55:29 · 306 阅读 · 0 评论 -
hdu 1671 字典树
http://acm.hdu.edu.cn/showproblem.php?pid=1671 简单的字典树 注意每次要释放内存 不然会MLE#include <iostream> #include <cstring> #include <string> #include <algorithm> using namespace std; struct node { int sign;原创 2015-06-08 23:48:25 · 319 阅读 · 0 评论 -
hdu 1686 Oulipo
http://acm.hdu.edu.cn/showproblem.php?pid=1686 简单kmp#include <cstdio> #include <cstring> using namespace std; int Next[10005]; char c[1000005]; char t[10005]; int main() { int num; scanf("%d",原创 2015-06-09 22:04:57 · 256 阅读 · 0 评论 -
hdu 1358 period
http://acm.hdu.edu.cn/showproblem.php?pid=1358 求某个前缀含几个循环 用kmp的next数组#include <cstdio> #include <cstring> using namespace std; int Next[1000005]; char c[1000005]; int main() { int len; int cnt原创 2015-06-09 21:17:39 · 388 阅读 · 0 评论 -
hdu 1166 敌兵布阵
http://acm.hdu.edu.cn/showproblem.php?pid=1166 线段树模板题#include <cstdio> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxx=55555; int sum[maxx<<2]; void PushUp(int rt原创 2015-05-31 22:50:38 · 282 阅读 · 0 评论 -
dp hdu 1160 FatMouse's Speed
http://acm.hdu.edu.cn/showproblem.php?pid=1160#include <iostream> #include <algorithm> #include <cstdio> using namespace std; struct mice { int w,s,num,p; }; bool cmp(mice a, mice b) { if(a.w==原创 2015-05-29 21:00:14 · 263 阅读 · 0 评论 -
dp hdu 1003 maxsum
http://acm.hdu.edu.cn/showproblem.php?pid=1003#include <iostream> using namespace std; int a[100001]; int main() { int t,n,b,e,rb,maxx,sum,k; cin>>t; k=1; while(t--) { cin>>原创 2015-05-29 20:59:12 · 236 阅读 · 0 评论 -
HDU 1106 排序
Problem Description 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。Input 输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字原创 2015-04-14 12:31:00 · 256 阅读 · 0 评论 -
HDU 2136 Largest prime factor
Problem Description Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is 2原创 2015-04-27 08:13:29 · 258 阅读 · 0 评论 -
二分图匹配 hdu 1150
http://acm.hdu.edu.cn/showproblem.php?pid=1150#include <iostream> #include <cstring> using namespace std; const int maxx=102; int gra[maxx][maxx]; int cx[maxx];int cy[maxx]; int sy[maxx]; int m,n,ans,k原创 2015-05-27 01:29:44 · 268 阅读 · 0 评论 -
二分图匹配 hdu 2063
http://acm.hdu.edu.cn/showproblem.php?pid=2063#include <iostream> #include <cstring> using namespace std; const int maxx=502; int gra[maxx][maxx]; int sx[maxx];int sy[maxx]; //记录是否被访问过 int cx[maxx];int原创 2015-05-27 00:50:39 · 295 阅读 · 0 评论 -
dp hdu 1159 最大公共子序列
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=3§ionid=2&problemid=2 dp[i][j]=max(dp[i-1][j],dp[i][j-1]) s1[i]!=s2[j] dp[i][j]=dp[i-1][j-1]+1 s1[i]==s2[j]#include<stdio.h> #includ原创 2015-05-27 00:58:38 · 254 阅读 · 0 评论 -
数论 hdu 1060 n^n最高位
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=2§ionid=1&problemid=11 对一个数num可写为 num=10^n * a, 即科学计数法,使a的整数部分即为num的最高位数字num^num=10^n + a 这里的n与上面的n不等两边取对数: num*lg(num) = n + lg(a);因为原创 2015-05-27 01:02:07 · 368 阅读 · 0 评论 -
dfs hdu 1016
http://acm.hdu.edu.cn/showproblem.php?pid=1016#include <cstdio> #include <cstring> using namespace std; int prime[40]={0}; int n,count; int ans[21]; int vis[21]; void dfs(int x) { if(count==n&&!pri原创 2015-05-27 10:39:04 · 255 阅读 · 0 评论 -
二分图匹配 hdu 1045
http://acm.hdu.edu.cn/showproblem.php?pid=1045#include <iostream> #include <cstring> using namespace std; const int maxx=102; int cx[maxx];int cy[maxx]; int sx[maxx];int sy[maxx]; char gra[maxx][maxx];原创 2015-05-27 00:46:20 · 280 阅读 · 0 评论 -
dp hdu 1176
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=3§ionid=2&problemid=8 自底向上 状态转移方程为:dp[i][j]=max(dp[i+1][j-1],dp[i+1][j],dp[i+1][j-1])+pie[i][j]#include<stdio.h> #include<string.h.>原创 2015-05-27 00:52:24 · 236 阅读 · 0 评论
分享