poj 3036 Honeycomb Walk 暴力枚举 dp
来源:互联网 发布:网络直播电视怎么安装 编辑:程序博客网 时间:2024/05/29 18:38
题意:
蜜蜂走n步后回到原始位置的不同走法
分析:
把以正六边形建立坐标系那么(0,0)点可达(1,0)(0,1)(1,1)(0,-1)(-1,0)(-1,-1)
然后暴力循环求解
ACcode:
#include <iostream>#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#define maxn 150005#define inf 0x3f3f3f3f#include <cstring>#define ll long longusing namespace std;ll dp[15][50][50];int dx[]={1,0,1,-1,0,-1};int dy[]={0,1,1,0,-1,-1};int main(){ int n,loop; memset(dp,0,sizeof(dp)); dp[0][7][7]=1; for(int k=1;k<=14;++k) for(int i=0;i<=14;++i) for(int j=0;j<=14;++j) for(int t=0;t<6;++t) dp[k][i][j]+=dp[k-1][i+dx[t]][j+dy[t]]; scanf("%d",&loop); while((loop--)&&scanf("%d",&n)) printf("%I64d\n",dp[n][7][7]); return 0;}
0 0
- poj 3036 Honeycomb Walk 暴力枚举 dp
- POJ 3036 Honeycomb Walk(DP)
- POJ-3036 Honeycomb Walk 简单DP
- HDU--杭电--2323--Honeycomb Walk--DP
- 2489. Honeycomb Walk
- hdu 2323 Honeycomb Walk
- Sicily 1415. Honeycomb Walk
- (POJ 1054)The Troublesome Frog <暴力枚举+剪枝 || DP>
- 南邮 OJ 1498 Honeycomb Walk
- HDU 5001 Walk(暴力+概率DP)
- poj 3102(暴力枚举)
- POJ 2718 暴力枚举
- POJ-----3279暴力枚举
- POJ 3174 暴力枚举
- POJ 2029 DP || 暴力
- poj 3080 暴力法 KMP+暴力枚举
- poj 1248 Safecracker(暴力枚举)
- POJ 1068 Parencodings(暴力枚举)
- linux 学习体验2
- tpshop开源商城,切勿使用?
- Android Fragment的使用 六 适应屏幕大小
- 关于如何处理ubuntu16.04无法连接网络问题
- Beautiful People (zoj 2319)
- poj 3036 Honeycomb Walk 暴力枚举 dp
- java学习之:JDBC(查询)
- 简学jQuery技术
- LL(1)递归下降
- NYOJ 170
- (24)直接插入排序
- 区域的个数(坐标离散化)
- linux shell 中判断文件、目录是否存在
- EA&UML日拱一卒--类图::关联(关联,聚合,组合)