- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 zoj 3602 Count the Trees 树的同构
/*二叉树的同构 把每棵子树映射为一个整数如节点n的左右孩子为L,R,那么取子树L对应的整数Ln子树R对应的整数Rn,把pair(Ln,Rn)对应为一个整数就是当前子树的映射*/#include#include#include#include#include#include#includeusing namespace std;const int maxn=10000
2012-08-06 00:54:35 3227
原创 HDU 4313 Matrix 类似 克鲁斯卡尔算法
#include #include #include #include #include #include #include #include #include#includeusing namespace std;set Set;struct Edge{ int x,y,val; bool operator<(const Edge & a)const
2012-08-04 21:37:12 2436
原创 HDU 4323 Magic Number 编辑距离(经典DP)
#include#include#include#include#include#includeusing namespace std;char str[1509][1009],s[1009];int dp[1509][1509];int n,m;int main(){ int ca,len,len2,p,op,ans; scanf("%d",&ca);
2012-08-04 21:35:17 2921
原创 HDU 4337 King Arthur's Knights 稠密图构造汉密尔顿回路
#include#include#includeusing namespace std;const int N=200;int str[N],m[N][N],vis[N];int n,k;void rev(int s,int t){ while(s<t) { swap(str[s],str[t]); s++,t--; }}
2012-08-04 21:33:46 3272
原创 HDU 4339 Query 树状数组
#include#include#include#include#includeusing namespace std;const int maxn=1000009;int c[maxn];char s1[maxn],s2[maxn];struct bit{ int lowbit(int x) { return x&-x; } v
2012-08-04 21:31:05 2107
原创 HDU4331 Image Recognition 树状数组+扫描线
#include#include#include#include#include#includeusing namespace std;const int maxn=1009;int c[maxn];int m[maxn][maxn];int L[maxn][maxn],R[maxn][maxn],U[maxn][maxn],D[maxn][maxn];int n;stru
2012-08-04 21:28:52 2228
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人