摘要: You are given an undirected graph G(V, E). Each vertex has a mark which is an integer from the range [0..231 – 1]. Different vertexes may have the sam 阅读全文
posted @ 2017-05-17 12:53 PIPIBoss 阅读(165) 评论(0) 推荐(1) 编辑
摘要: Description 对,这就是裸的AC自动机。 要求:在规定时间内统计出模版字符串在文本中出现的次数。 Description 对,这就是裸的AC自动机。 要求:在规定时间内统计出模版字符串在文本中出现的次数。 Description 对,这就是裸的AC自动机。 要求:在规定时间内统计出模版字符 阅读全文
posted @ 2017-05-16 16:21 PIPIBoss 阅读(314) 评论(0) 推荐(1) 编辑
摘要: Description 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:  阅读全文
posted @ 2017-05-16 16:10 PIPIBoss 阅读(204) 评论(0) 推荐(1) 编辑
摘要: Description 给一棵有n个节点的树,每条边都有一个长度(小于1001的正整数)。 定义dist(u,v)=节点u到节点v的最短路距离。 给出一个整数k,我们称顶点对(u,v)是合法的当且仅当dist(u,v)不大于k。 写一个程序,对于给定的树,计算有多少对顶点对是合法的。 Descrip 阅读全文
posted @ 2017-05-16 16:00 PIPIBoss 阅读(242) 评论(0) 推荐(1) 编辑
摘要: 1277. Cops and Thieves Time limit: 1.0 secondMemory limit: 64 MB The Galaxy Police (Galaxpol) found out that a notorious gang of thieves has plans for 阅读全文
posted @ 2017-05-16 14:38 PIPIBoss 阅读(257) 评论(0) 推荐(1) 编辑
摘要: Xiao Ming is an expert in computer science and technology, so he can get a lot of projects every month. The projects always bring him a lot of money, 阅读全文
posted @ 2017-05-16 13:08 PIPIBoss 阅读(212) 评论(0) 推荐(2) 编辑
摘要: 题目大意: 一个 N*M 的网格,每个单元都有一块价值 Cij 的宝石。问最多能取多少价值的宝石且任意两块宝石不相邻。(1 <= N, M <= 50, 0 <= Cij <= 40000) 建图方法: 先对网格进行黑白染色, 然后所有黑点到S有一条容量为Cij的边, 白点到T有一条容量为Cij的边 阅读全文
posted @ 2017-05-15 13:42 PIPIBoss 阅读(277) 评论(0) 推荐(2) 编辑
摘要: Jedi knights, Qui-Gon Jinn and his young apprentice Obi-Wan Kenobi, are entrusted by Queen Padmé Amidala to save Naboofrom an invasion by the Trade Fe 阅读全文
posted @ 2017-05-14 22:10 PIPIBoss 阅读(296) 评论(0) 推荐(2) 编辑
摘要: The citizens of a small village are tired of being the only inhabitants around without a connection to the Internet. After nominating the future netwo 阅读全文
posted @ 2017-05-14 20:03 PIPIBoss 阅读(220) 评论(0) 推荐(1) 编辑
摘要: A group of n castle guards are voting to determine whether African swallows can carry coconuts. While each guard has his own personal opinion on the m 阅读全文
posted @ 2017-05-13 13:45 PIPIBoss 阅读(328) 评论(0) 推荐(1) 编辑