摘要:
描述万圣节的早上,小Hi和小Ho在经历了一个小时的争论后,终于决定了如何度过这样有意义的一天——他们决定去闯鬼屋!在鬼屋门口排上了若干小时的队伍之后,刚刚进入鬼屋的小Hi和小Ho都颇饥饿,于是他们决定利用进门前领到的地图,找到一条通往终点的最短路径。鬼屋中一共有N个地点,分别编号为1..N,这N个地... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 struct node 8 { 9 int next[26];10 int cnt;11 void init()12 {13 ... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int N=3000010; 8 int n, p[N]; 9 char s[N], str[N];10 11 #define _min(x,... 阅读全文
摘要:
1 #include 2 #include 3 4 const int maxn = 100; 5 6 int n; 7 char a[maxn], b[maxn]; 8 9 void dfs(int la, int ra, int lb, int rb) {10 if (la ... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define MAXN 1000010 7 int c[MAXN]; 8 int fa[MAXN]; 9 int vis[MAXN];10 int s[MAX... 阅读全文
摘要:
DongGua: Save our SWJTU!Time Limit:2000MS Memory Limit:65536KTotal Submit:46 Accepted:22 Description One night ,Desgard_Duan was caught by an alien na... 阅读全文
摘要:
经典剪枝题目,注释的别人代码。还是得自己多敲。反思,反思! 1 #include "iostream" 2 #include "algorithm" 3 #include "memory.h" 4 using namespace std; 5 6 int sticks[64],n,len,num;... 阅读全文
摘要:
C. Vasya and Basketballtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya follows a basketbal... 阅读全文
摘要:
//简单搜索,只要走遍所有可达的路径BFS版:#include "iostream"#include "cstdio"#include "memory.h"#include "queue"using namespace std;const int MAX = 22;const int dx[] = ... 阅读全文
摘要:
//经典搜索题 #include #include using namespace std;int primelist[38] = {0,0,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1};//素数表,... 阅读全文