摘要:
#include#include#include#include#define N 200010void input(char s[]){ char str[N] = {0}; while(gets(str), strcmp(str, "START"));/****/ while(... 阅读全文
摘要:
/**#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},... 阅读全文
摘要:
#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,... 阅读全文
摘要:
#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为已组成的正方体的... 阅读全文
摘要:
#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... 阅读全文
摘要:
阅读全文
摘要:
#include#include#include#include#define N 10using namespace std;void Q(int n){ int m; char s[N]; queueQ; while(n--) { scanf("%s"... 阅读全文
摘要:
#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)... 阅读全文
摘要:
#include#include#include#include#define N 10using namespace std;void Q(int n){ int m; char s[N]; queueQ; while(n--) { scanf("%s"... 阅读全文
摘要:
背包模板(01背包,完全背包,多重背包)一、01背包:#define N ..///N这个值是根据具体的题目来定的int v; ///v为总的容量int dp[N];void ZeroOnePack(int cost,int weight){ for(int j=v;j>=cost;j--... 阅读全文