Paint the Grid AgainTime Limit:2 Seconds Memory Limit:65536 KBLeo has a grid withN×Ncells. He wants to paint each cell with a specific color (either b...
分类:
其他好文 时间:
2014-09-13 18:44:15
阅读次数:
260
亏大了,当时没做,被另一道题目题意给坑了,其实把他建成一个双向图,首先l
看题解多数使用了并查集,不过也有几个题解的的思路 差不多也是这个样子,解法挺多的
int t;
int n,m,k;
int nnum[100000 + 55];
bool vis[100000 + 55];
bool flag[100000 + 55];
vector G[100000 + 55];
set...
分类:
其他好文 时间:
2014-09-12 22:12:24
阅读次数:
245
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3811解题报告:一个无向图上有n个点和m条边,其中有k个点上安装了传感器,当有人第一次从安装了传感器的点上经过时,在控制室就会收到一个信号,现在保安制定 了一条路线目...
分类:
其他好文 时间:
2014-09-12 20:40:04
阅读次数:
220
Damn CouplesTime Limit:1 Second Memory Limit:32768 KBAs mentioned in the problem "Couples", so many new words appear on the internet. Another special ...
分类:
其他好文 时间:
2014-09-12 18:39:54
阅读次数:
326
ZOJ 3229 Shoot the Bullet
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3229
题意:一个屌丝给m个女神拍照,计划拍照n天,每一天屌丝最多给C个女神拍照,每天拍照数不能超过D张,而且给每个女神 i 拍照有数量限制[Li,Ri],对于每个女神n天的拍照总和不能超过Gi,如果有解求...
分类:
其他好文 时间:
2014-09-12 15:11:50
阅读次数:
164
Generalized Palindromic Number
Time Limit: 2 Seconds
Memory Limit: 65536 KB
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For ...
分类:
其他好文 时间:
2014-09-12 11:59:43
阅读次数:
186
题意:在某些点上安装首次访问时候会报警的机器,给出报警嗲你的顺序,问是否合法。
思路:按所给的序列,每个进来时判断这个点目前能否达到(第一个可达总是),若能,则该点进行扩展遍历所有没有报警器的点,遇到有的报警器的标记可达就返回。
预判:判断原图连图性。
#include
#include
#include
#include
#include
using namespace s...
分类:
其他好文 时间:
2014-09-12 10:17:53
阅读次数:
240
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5349
比赛的时候没看这道题,遗憾,不过想到算法不难,但是写代码比较考代码能力,我自己写了两次都不行,还是看了别人代码,写下了这个
学到:
1、hash字符串第一个下表为0的空起来,写起来方便
2、hash匹配的全部情况就是以text串的所有位置为起点做匹配,当text比...
分类:
其他好文 时间:
2014-09-12 02:25:22
阅读次数:
258
暴力模拟细节处理很重要。。。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 char s1[100],s[100]; 7 int len1,len; 8 int t; ...
分类:
其他好文 时间:
2014-09-11 23:44:42
阅读次数:
430