
HUD
VVVGG
不积跬步无以至千里
展开
-
HDU--3333
题意就是让你求给定数的区间和,数值相同只加一次题目链接:HDU-3333主要就是区间右端点排序和这句话“对于要查询的区间,它的右端点固定后,那么重复的数字便是右面开始最后一次出现的”AC代码:#include#include#include#include#includeusing namespace std;#define MM(x,y) memset(x,y,siz原创 2017-07-11 10:53:19 · 354 阅读 · 0 评论 -
HDU 1372——DFS
//点击打开链接//DFS的模板题#include#include#include#include#define MM(x,y) memset(x,y,sizeof(x))using namespace std;struct node{ int x; int y; int pos;};queuea;char e[5],s[5];int vis[30][原创 2017-07-04 13:56:19 · 269 阅读 · 1 评论 -
HDU--1241 简单DFS
题目链接:点击打开链接遍历整个图,把‘@’变成‘*’,统计次数AC代码:#include#include#include#include#includeusing namespace std;typedef long long ll;const int N=1000;struct Node{ int x; int y;};int n,m;#def原创 2017-07-04 15:15:32 · 245 阅读 · 0 评论 -
HDU-1548
坐电梯 只能上和下,走过的楼层是当前所存数乘以1或者-1题目链接:点击打开链接AC代码:#include#include#include#include#define MM(x,y) memset(x,y,sizeof(x))using namespace std;const int N=300;int a[N];struct node{ int x; l原创 2017-07-05 10:59:47 · 237 阅读 · 0 评论 -
HUD_1556_树状数组基础
网上关于树状数组有很多讲解,我就不说了(其实是领悟不够彻底。。。。)先上个题目的链接点击打开链接先向下更新加一遍update(y,1);然后把更新多余的内容在取消掉update(x-1,-1);然后向上取和#include#include#include#define MM(x,y) memset(x,y,sizeof(x))using namespace std;con原创 2017-07-03 09:41:49 · 259 阅读 · 0 评论 -
来一道水题 KMP算法---HDU2087
看了一天的KMP 先来一道水题 试试KMp的水深不深然而还是在CE7次之后才过题目原网址:http://acm.hdu.edu.cn/showproblem.php?pid=2087AC代码:#include#includeusing namespace std;typedef int ll;ll nextval[1010];void getnext(ch转载 2016-04-18 21:44:45 · 326 阅读 · 0 评论 -
杭电1061-弄懂快速幂
杭电1061 快速幂做法源题网址:http://acm.hdu.edu.cn/showproblem.php?pid=1061Problem Description Given a positive integer N, you should output the most right digit of N^N.Input原创 2016-03-15 22:55:34 · 425 阅读 · 0 评论 -
HDU-2717
这题和1548没啥区别,但是中间还是出现了几波迷之错误链接:点击打开链接AC代码:#include #include #include #include #define MM(x,y) memset(x,y,sizeof(x))typedef long long ll;using namespace std; const int N=1000000; int原创 2017-07-05 13:34:47 · 392 阅读 · 0 评论