HUST 1354 Rubiks】的更多相关文章

1354 - Rubiks 时间限制:1秒 内存限制:64兆 452 次提交 102 次通过 题目描述 Isun is a genius. Not only he is an expert in algorithm, but also he plays damn-good in many funny games. Besides, he can recover a Rubik in 16 seconds or even less. The man is very crazy about Rubi…
背包.注释写详细了. 本想这样写:每个组内各自做背包,然后组间做背包,但是由于这题M=10000,时间复杂度太大. #include<cstdio> #include<cstring> #include<cmath> #include<queue> #include<vector> #include<iostream> #include<algorithm> #include<bitset> #include&…
1017 - Exact cover 时间限制:15秒 内存限制:128兆 自定评测 5584 次提交 2975 次通过 题目描述 There is an N*M matrix with only 0s and 1s, (1 <= N,M <= 1000). An exact cover is a selection of rows such that every column has a 1 in exactly one of the selected rows. Try to find o…
#HUST deb http://mirrors.hust.edu.cn/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.hust.edu.cn/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.hust.edu.cn/ubuntu/ xenial-updates main restricted u…
1017 - Exact cover Problem's Link:   http://acm.hust.edu.cn/problem/show/1017 Mean: 给定一个由0-1组成的矩阵,是否能找到一个行的集合,使得集合中每一列都恰好包含一个1 analyse: 初学DLX. 这是DLX处理的最简单的问题,也是模板题. Time complexity: O(n*d) Source code:  #include <stdio.h> #include <string.h> #…
题目链接:http://acm.hust.edu.cn/problem/show/1010 KMP失配指针的利用: next数组前缀和后缀最长公共长度,这样len - next[len];就是最短的循环节点. #include <stdio.h> #include <string.h> using namespace std; #define maxn 1000005 void getFail(char *P,int *f) { int m = strlen(P); f[] = ;…
1354 - IP Checking   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two I…
1354 - IP Checking   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two I…
题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=65998#problem/A 题意:求01矩阵的精确覆盖. DLX学习资料:http://www.cnblogs.com/grenet/p/3145800.html http://blog.csdn.net/mu399/article/details/7627862 #include <cstdio> #include <cstring> #include <…
DESCRIPTION There is an N*M matrix with only 0s and 1s, (1 <= N,M <= 1000). An exact cover is a selection of rows such that every column has a 1 in exactly one of the selected rows. Try to find out the selected rows. INPUT There are multiply test ca…