Alternating Sum
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is a digit string S with infinite length. In addition, S is periodic and it can be formed by concatenating infinite re...
分类:
其他好文 时间:
2014-09-09 13:28:48
阅读次数:
210
ZOJ Problem Set - 3811
Untrusted Patrol
Time Limit: 3 Seconds
Memory Limit: 65536 KB
Edward is a rich man. He owns a large factory for health drink production. As a matter of course, ...
分类:
其他好文 时间:
2014-09-09 13:27:39
阅读次数:
232
题目链接:zoj 3810 A Volcanic Island
题目大意:给定n,要求用n块面积为n的拼图铺满n?n的矩阵,任意两块拼图形状不能相同(包括旋转和镜像),并且n块拼图只能有4中颜色,相邻两块拼图颜色不能相同。
解题思路:构造,n = 2,3,4时是不存在的。然后对于n >= 5的直接构造,具体看代码。注意这种构造方式构造6的时候会出现相同的拼图,所以特判。
#inclu...
分类:
其他好文 时间:
2014-09-09 13:22:38
阅读次数:
185
题目链接:点击打开链接
学弟是厉害啊。。
#include
#include
#include
#include
#include
using namespace std;
int vis[110][110],a[110][110],n;
void fuck1()
{
for(int ii=1;ii<=n/2;ii++)//7
{
int i=n,j=ii;
in...
分类:
其他好文 时间:
2014-09-09 13:22:28
阅读次数:
159
题目链接:zoj 3811 Untrusted Patrol
题目大意:给定n,m,k,表示有n个仓库,m条通道,k个传感器,现在给定n个传感器的位置和m条通道,现在要最这n个仓库进行巡逻,要求一次进过给定具有传感器的仓库,每个仓库经过的次数不限,单要求至少进过1次。
解题思路:首先判断是否为联通图,不连通的话肯定到不了。其次判断l是否等于k,如果不等于的话,说明至少有一个仓库到不了,...
分类:
其他好文 时间:
2014-09-09 13:21:58
阅读次数:
223
题目链接:zoj 3816 Generalized Palindromic Number
题目大意:给定n,找一个最大的数x,保证x小于n,并且x为palindromic number
解题思路:枚举前i个放于n相同的数,然后去构造后半部分即可。
#include
#include
#include
using namespace std;
typedef unsigned...
分类:
其他好文 时间:
2014-09-09 13:20:28
阅读次数:
131
Alternating Sum
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is a digit string S with infinite length. In addition, S is periodic and it can be formed by concatenating infinite repeti...
分类:
其他好文 时间:
2014-09-09 13:10:58
阅读次数:
164
# include
# include
# include
# define MAX 55
using namespace std;
int L;
char a[MAX];
int vis[MAX];
int judge1()//ababa
{
int i,j;
int xx,yy,zz;
char x[MAX],y[MAX],z[MAX];
for(i=2...
分类:
其他好文 时间:
2014-09-09 13:05:58
阅读次数:
197
ZOJ 3810 A Volcanic Island(四色定理模板)...
分类:
其他好文 时间:
2014-09-09 13:05:18
阅读次数:
255
poj 1543 & HDU 1334 & ZOJ 1331 Perfect Cubes(数学 暴力大法好)...
分类:
其他好文 时间:
2014-09-09 13:01:48
阅读次数:
235