李白打酒
来源:互联网 发布:gta4优化补丁告别卡顿 编辑:程序博客网 时间:2024/05/14 19:42
#include <stdio.h> #include <math.h> int a[14]; int count=0;//t 经过的次数 s 商场 f花 c酒 void backtrace(int t,int s,int f,int c){ if(s>5 || f>9 || c<=0 )//剪枝 return; if(t==14){ if(s==5 && f==9 && c==1) { count++; } return; } else{ a[t]=1;//遇见酒店 backtrace(t+1,s+1,f,c*2); a[t]=0; backtrace(t+1,s,f+1,c-1); } } int main(){ backtrace(0,0,0,2); printf("%d",count); return 0; }
0 0
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 李白打酒
- 有关windows RASDIAL
- centOS 安装 pip
- 基于qq.maps.com的web地图定位导航
- N皇后
- 解决上传大文件失败的问题
- 李白打酒
- mysql动态创建临时表
- 解决iOS调起微信支付,显示系统繁忙
- mac上搭建tensorflow
- 学习php自行开发mvc框架过程(一)
- Python 属性管理(整理转自《Python学习手册》)
- 【java】jvm虚拟机
- [积累] 对一次 crontab 执行失败的调试
- 欢迎使用CSDN-markdown编辑器