2011-11-12 0:13:21 阅读4 评论0 122011/11 Nov12
今天是光棍节,纪念一下,试试水。
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int dp[513][513],flag[513],n,p;
int inf=0x3f3f3f3f;
typedef struct
{
vector<int> adv;
}node;
node nod[513];
int dfs(int x)
{
int i,j,k;
for(v
2011-10-24 21:47:37 阅读10 评论2 242011/10 Oct24
此题对于刚学树形dp的选手来讲比较难,但是静下心来一看,思路也不是没有,只需考虑每个节点是否取即可,两种状态。
本菜的原代码如下:
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
typedef struct
{
vector<int> son;
}node;
node nod[102];
int dp[102][102],vis[102],con[102][102],n,q;
int dfs(int x)
{
int i,j,k;
2011-10-24 21:43:19 阅读4 评论0 242011/10 Oct24
傻逼dp题不解释。
代码如下:
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int dp[513][513],flag[513],n,p;
int inf=0x3f3f3f3f;
typedef struct
{
vector<int> adv;
}node;
node nod[513];
int dfs(int x)
{
int i,j,k;
for
2011-10-24 21:27:43 阅读4 评论1 242011/10 Oct24
其实这道题没什么价值(当你想到bfs时),有位兄弟说是想看看代码,于是本菜就写了一份,代码如下:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
int flag[2000002],n,k;
typedef struct
{
int num,tim;
}node;
node a;
queue<node> q;
int bound(int x)
{
if(x>=0&&x<=2*k)
2011-10-24 21:14:28 阅读3 评论0 242011/10 Oct24
题目连接:http://xiaoyuwendao.blog.163.com/#m=0&t=0
郁闷的一题,原来可以说是无需任何调试就ac的,想不到我一运行程序就报中木马,=。=!后来索性直接交了,果断直接ac。。。
代码如下:
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef struct
{
int fa,re;
}node;
node nod[2002];