暴搜
文章平均质量分 77
yan_____
不跟你介绍
展开
-
hdu 2514 Another Eight Puzzle 枚举
将8个数字填进图中,让相邻的点上的数字不相邻,8个数字全排列枚举即可 要注意全排列的求法 #include do{ ………… } while(next_permutation(a,a+8)); Another Eight Puzzle Time Limit : 2000/1000ms (Java/Other) Memory Limit : 3276原创 2013-01-25 14:30:28 · 1005 阅读 · 0 评论 -
uvalive4467
E - Electric Bill Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Description It's year 2100. Electricity has become very expensive. Recently, yo原创 2013-04-07 00:14:16 · 710 阅读 · 0 评论 -
uva 10391复合词 字符串哈希
head的下标是哈希值,head[哈希值]=字符串的下标,拉链处理矛盾 要注意字符串哈希值的取法 #include #include char st[121000][30],temp[30]; int head[10000019],next[121000]; int hash(char *str) { int seed=31,v=0; while(*str) {原创 2013-04-16 10:47:18 · 769 阅读 · 0 评论 -
uva 10317 调整等式中数字的位置使等式成立
uva 10317 记录把等式移项后正数的位置,让这些正数之和等于sum/2,dfs搜索这些正数,再把剩余的数依次放入负数的位置,按照输入输出即可 #include #include #include #define N 17 int num[N],n,zh; int flag[N],end,sum; char ch[100]; int ok; void dfs(int w,int t原创 2013-04-17 14:35:13 · 718 阅读 · 0 评论