摘要: #include#include#include#include#define N 200010void input(char s[]){ char str[N] = {0}; while(gets(str), strcmp(str, "START"));/****/ while(... 阅读全文
posted @ 2015-06-09 19:26 午夜阳光~ 阅读(388) 评论(0) 推荐(0) 编辑
摘要: /**#include #include #include #include #define N 310using namespace std;int d[8][2] = {{-2, -1}, {-2, 1}, {-1, -2}, {-1, 2}, {1, -2}, {1, 2}, {2, -1},... 阅读全文
posted @ 2015-05-29 09:00 午夜阳光~ 阅读(250) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#define max(a, b)(a > b ? a : b)#define N 30char maps[N][N];int m, n, ans;int d[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1,... 阅读全文
posted @ 2015-05-27 19:26 午夜阳光~ 阅读(178) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#define max(a, b)(a > b ? a : b)#define N 30int a[N], vis[N], n, k, f;void DFS(int s, int m, int d)//s为搜索起点 m为已组成的正方体的... 阅读全文
posted @ 2015-05-27 18:22 午夜阳光~ 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#define N 70int f, vis[N], v, n, a[N];int cmp(const void *a, const void *b){ return *(int *)b - *(int *)a;}void DFS... 阅读全文
posted @ 2015-05-20 20:14 午夜阳光~ 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-05-18 12:32 午夜阳光~ 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#define N 10using namespace std;void Q(int n){ int m; char s[N]; queueQ; while(n--) { scanf("%s"... 阅读全文
posted @ 2015-05-08 10:51 午夜阳光~ 阅读(249) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define N 20using namespace std;int main(){ stackS; int n, i, j, k, a[N]; char s1[N], s2[N]; while(scanf("%d", &n)... 阅读全文
posted @ 2015-05-07 17:59 午夜阳光~ 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#define N 10using namespace std;void Q(int n){ int m; char s[N]; queueQ; while(n--) { scanf("%s"... 阅读全文
posted @ 2015-05-07 16:51 午夜阳光~ 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 背包模板(01背包,完全背包,多重背包)一、01背包:#define N ..///N这个值是根据具体的题目来定的int v; ///v为总的容量int dp[N];void ZeroOnePack(int cost,int weight){ for(int j=v;j>=cost;j--... 阅读全文
posted @ 2015-05-07 15:59 午夜阳光~ 阅读(302) 评论(0) 推荐(0) 编辑