果枫-国峰

2012年9月1日

hdu 杭电 1016 Prime Ring Problem

摘要: ac代码:View Code #include<iostream>using namespace std;int map[61];int use[21];int ss[22];int n;void dfs(int i){ if(i==n&&map[ss[i-1]+1]==0) { for(int l=0;l<n-1;l++) cout<<ss[l]<<" "; cout<<ss[n-1]<<endl; } else { for(int j=2;j<=n;j++) { ... 阅读全文

posted @ 2012-09-01 09:30 果枫-国峰 阅读(137) 评论(0) 推荐(0) 编辑

hdu 杭电 1045 Fire Net

摘要: 题意:地图中最多能放多少炮台。解法:深搜。ac代码:View Code #include<iostream>using namespace std;char map[8][8];int sum,maxi,n;bool check(int x,int y){ if(map[x][y]=='X')return 0; int i; for(i=x-1;i>=0;i--) { if(map[i][y]=='X')break; if(map[i][y]=='0')return 0; } for(i=y-1;i>=0;i--) { . 阅读全文

posted @ 2012-09-01 09:25 果枫-国峰 阅读(211) 评论(0) 推荐(0) 编辑

导航