ACM
文章平均质量分 58
Never_More
这个作者很懒,什么都没留下…
展开
-
poj 1979 Red and Black
这道题目是最简单的广度优先搜索了,题目要求是原创 2014-05-14 23:59:25 · 235 阅读 · 0 评论 -
hdu-1829 A Bug's Life
种类并查集,注意矢量的关系就OK了。原创 2014-11-17 13:01:50 · 209 阅读 · 0 评论 -
Lcs hdu1159 Common Subsequence
#include #include #include using namespace std;const int maxn = 1300;char str1[maxn];char str2[maxn];int dp[maxn][maxn];int Lcs(){ memset(dp,0,sizeof(dp)); int length1 = strlen(str1+1); i原创 2014-11-13 22:15:30 · 209 阅读 · 0 评论 -
hdu_1025(二分+LIS)
这道题一开使用结构题存储加排序,各种wa,折腾好意正在原创 2014-11-08 17:30:50 · 226 阅读 · 0 评论 -
hdu_3038 How Many Answers Are Wrong
有点晕,关系很快就想好了,但是在getfather的是原创 2014-11-17 17:57:56 · 216 阅读 · 0 评论 -
hdu_1272 小希的迷宫
并查集,不仅仅要查询,链接的两点原创 2014-11-18 15:17:41 · 187 阅读 · 0 评论 -
hdu_1198 Farm Irrigation
自己本来写的很乱,看了一下fanxing1的博客,仿照写了一下原创 2014-11-19 13:20:21 · 190 阅读 · 0 评论 -
hdu_1856 More is better
水题一个,1A,跑得有点慢,C++ 500的样子。原创 2014-11-18 21:37:38 · 199 阅读 · 0 评论 -
poj_1631 Bridging signals
最终转化为最长上升子序列。#include #include #include #include using namespace std;const int maxn = 40000+100;int n;int m;int stack[maxn];int a[maxn];int b_search(int low,int high,int goal){ while(lo原创 2014-11-27 20:05:48 · 182 阅读 · 0 评论 -
poj_2481 Cows
#include #include #include #include using namespace std;const int maxn = 100000+100;int m;struct cow{ int s; int e; int index;};cow cw[maxn];int ans[maxn];int arr[maxn];bool cmp(cow原创 2014-11-27 20:18:28 · 227 阅读 · 0 评论 -
poj_2051 Argus
堆排序,可以用stl里的函数,但是还是复习一下,堆排序的原理吧,先贴代码,再说堆的原理。#include #include #include #include #include #include using namespace std;const int maxn = 1000+10;struct Node{ int id; int time; int转载 2014-11-29 21:55:28 · 227 阅读 · 0 评论 -
poj-1330 Nearest Common Ancestors
#include #include #include #include using namespace std;const int maxn = 10000+1000;std::vector tree[maxn];int indeg[maxn];int root;int ancestor[maxn];bool vst[maxn];void BuildTree(int no原创 2014-12-17 19:22:36 · 214 阅读 · 0 评论 -
关于全排列
最近在Tc上遇到全排列的问题,于是找出最近原创 2014-11-07 21:54:00 · 206 阅读 · 0 评论 -
hdu-1213 How Many Tables
并查集的模板题目原创 2014-11-16 16:52:16 · 235 阅读 · 0 评论 -
hdu1010 Tempter of the Bone
#include #include #include #include #include #define N 8using namespace std;int row;int col;int step;int sx,sy,ex,ey;bool can;char maze[N+1][N+1];int dir[4][2]={1,0,-1,0,0,1,0,-1};void D原创 2014-05-16 01:24:37 · 177 阅读 · 0 评论 -
poj 3256 Cow Picnic
DFS水题,开始直接DFS,近800ms,然后使用vector优化原创 2014-05-20 00:20:18 · 252 阅读 · 0 评论 -
poj 1101 The Game
这个题,discuss里说可能数据比较水,我用了原创 2014-05-18 11:55:44 · 262 阅读 · 0 评论 -
*Hdu 1026-Ignatius and the Princess I
题目思想比较简单,但是题目要求输出路径比较麻烦,学习了原创 2014-05-17 00:41:42 · 417 阅读 · 0 评论 -
poj 1731 Orders
全排列,根据字典序,可以使用next_permutation原创 2014-05-25 23:37:40 · 206 阅读 · 0 评论 -
poj 1298 The Hardest Problem Ever
题目很水,十分水,之所以要做,是想一下STL,原创 2014-05-28 01:17:28 · 201 阅读 · 0 评论 -
最大公约数与最小公倍数
最近在TC上做了一道题,才发现自己q原创 2014-07-25 17:52:22 · 234 阅读 · 0 评论 -
hdu_1358 period
不多说,就一个求kmp循环节的水题。原创 2014-10-23 17:18:37 · 154 阅读 · 0 评论 -
hdu_3746 Cyclic Nacklace
循环节,主要还是Next数组原创 2014-10-28 13:05:04 · 188 阅读 · 0 评论 -
hdu-2473 Junk-Mail Filter
并查集删点操作以前没有做过这种的,原创 2014-11-16 20:15:05 · 211 阅读 · 0 评论 -
poj_2309 BST
lowbit 的应用,思路大于代码。#include int main(){ int N; scanf("%d",&N); while(N--) { int a; scanf("%d",&a); int b = a & (-a); b--; printf("%d %d\n",a-原创 2014-12-02 20:58:39 · 215 阅读 · 0 评论