插头DP,多条回路求回路数。
可以当作模版来记。注重理解轮廓线。
#include
#include
#include
#include
using namespace std;
const int HASH=10007;
const int STATE=5000; //状态数
const int MAXD=15;
int code[MAXD],maze[MAXD][MAXD];...
分类:
其他好文 时间:
2014-05-15 11:23:33
阅读次数:
344
用 栈 stack 来模拟
题目意思:http://blog.csdn.net/mobius_strip/article/details/12765319
下面的代码有坑,输出格式需要调。
#include
#include
#include
#include
#include
using namespace std;
const int maxn=25+5;
stacks[maxn];
i...
分类:
其他好文 时间:
2014-05-15 07:22:04
阅读次数:
273
OJ题目:click here~~
题目分析:有n条路径逃出洞穴,第i条路径有一个难度值ci。某人开始有战斗值f,每天随机选择某一条路径想要逃出。只要此时的 f 大于所选路径的ci,就能花费ti的天数逃出。这里。否则,等待明天再试吧,但是战斗值能增加ci。求逃出的期望天数。
设dp[ i ] 为战斗值为i时,逃出的期望天数。详细解释见代码。
AC_CODE
int const maxn =...
分类:
其他好文 时间:
2014-05-15 06:38:40
阅读次数:
406
/*
* hdu AC Me
* date 2014/5/13
* state AC
*/
#include
#include
#include
#include
using namespace std;
const int MAXN=100001;
char Arr[MAXN];
int cnt[26];
int main()
{
//cout << "Hello wor...
分类:
其他好文 时间:
2014-05-15 06:16:24
阅读次数:
247
用域名获取IP地址或者用IP获取域名
#include
#include
#include
int main(int argc,char **aggv)
{
struct hostent *host;
char hostname[]="www.163.com";
char hostname2[]="www.baidu.com";
s...
分类:
系统相关 时间:
2014-05-15 06:15:07
阅读次数:
406
#include
#include
using namespace std;
class Teacher
{
public:
Teacher(string nam,int ag,char s,string ad,int num,string t)
{
name=nam;
age=ag;
sex=s;
...
分类:
其他好文 时间:
2014-05-15 04:32:56
阅读次数:
262
插头DP。
题目要求构造出K条回路的方案数,而且不能出现环套环。
Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。
#include
#include
#include
#include
using namespace std;
const int MAXD=15;
const int STATE=1000010;
const i...
分类:
其他好文 时间:
2014-05-15 03:53:23
阅读次数:
272
插头DP。
从左上角到右下角,每个格子都有Val,每个格子只能经过一次,可以不经过,求最大的分数之和。
#include
#include
#include
#include
using namespace std;
const int MAXD=15;
const int HASH=10007;
const int STATE=1000010;
int N,M;
int maz...
分类:
其他好文 时间:
2014-05-15 03:43:02
阅读次数:
175
staticint_osip_message_parse(osip_message_t*sip,constchar*buf,size_tlength,intsipfrag){inti;constchar*next_header_index;char*tmp;char*beg;tmp=osip_malloc(length+2);if(tmp==NULL){OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,"Couldnotallocatememory..
分类:
其他好文 时间:
2014-05-14 16:06:25
阅读次数:
296
/*
* hdu OpenDoorManAndCloseDoorMan
* date 2014/5/13
* state AC
*/
#include
#include
#include
#include
using namespace std;
struct DoorMan
{
char name[20];
int startH,startM,startS;
...
分类:
其他好文 时间:
2014-05-14 14:58:40
阅读次数:
247