- 博客(6)
- 收藏
- 关注
转载 洛谷 马的遍历
#include #include #include #include using namespace std;queue qx; //定义横坐标队列queue qy; //定义纵坐标队列int n,m,a[405][405]; //存放步数int i,j,k,dx,dy,p,q;const int dir[8][2]={ //状态转移数组==方向向量
2017-07-03 11:41:24
542
转载 BFS 入门题目 洛谷 P1162 填涂颜色
#include#includeusing namespace std;int dir[4][2]={{0,1},{1,0},{0,-1},{-1,0}};int n,t,a[51][51]; queue qx,qy;int main(){ cin>>n; for(int i=1;i { for(int j=1;j
2017-07-03 10:51:32
707
转载 关于位运算 & | << >> ^ ~ %
主要来源 http://www.linuxidc.com/Linux/2014-03/98362.htm https://zhidao.baidu.com/question/1576758038983362220.html1.&如果两个相应的二进制位都为1,则该位的结果值为1;否则为0。是二进制“与”运算,参加运算的两个数的二进制按
2017-04-25 18:23:40
604
转载 codevs 1294 全排列
#include#include#includeusing namespace std;int a[10],book[10],n;void dfs(int step){ int i; if(step==n+1) { for(i=1;i { printf("%d ",a[i]);
2017-04-11 19:05:26
679
转载 POJ3630(Trie树) PHONE LIST 算法转载
原文 http://www.cnblogs.com/zhourongqing/archive/2011/09/23/2186734.html题目 http://poj.org/problem?id=3630#include#include#include#include#define N 10010using namespace std;string tel[N];bool
2017-04-02 18:33:44
322
转载 POJ 2001 Shortest Prefixes 短的前缀 代码整理
http://hzwer.com/2100.html 源代码http://poj.org/problem?id=2001 题目#include#include#includeusing namespace std;char a[10001][31];int tot;int sz,t[300001][26],s[300001];void insert(char ch[])/
2017-03-31 19:02:30
343
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人