2012年7月28日
摘要: 水题,模拟题,贴代码,作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:ttwo 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h> 10 using namespace std; 11 12 int state[10][10][4][10][10][4]; 13 char grid[10][10]; 14 int cow[3]; 15 int farmer[3]; 1 阅读全文
posted @ 2012-07-28 17:31 醉春雨 阅读(132) 评论(0) 推荐(0)
摘要: 好吧,虽然很多人说这是很简单的DP题,但是对我来说还是蛮难的,从一开始的递归超时,到后来的DP超内存,再到后来的DP爆栈,直到现在才过。不过我知道这道题可以有很多种dp方法,还可以加上HASH,可以提速,不管怎么说,DP果然还是要更近一步啊!下面贴代码,以作纪念.View Code 1 /*{ 2 ID:jzy3209981 3 PROG:prefix 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>1 阅读全文
posted @ 2012-07-28 15:18 醉春雨 阅读(196) 评论(0) 推荐(0)