上一页 1 2 3 4 5 6 7 8 ··· 22 下一页
摘要: The more, The Better 时限:2000ms Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须 阅读全文
posted @ 2017-07-28 10:58 zprhhs 阅读(174) 评论(10) 推荐(0) 编辑
摘要: Godfather 时限:2000ms Description Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all th 阅读全文
posted @ 2017-07-27 22:44 zprhhs 阅读(286) 评论(20) 推荐(0) 编辑
摘要: 利用树形dp的思想去求树的重心 阅读全文
posted @ 2017-07-27 21:41 zprhhs 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 树形dp求树上任一点的最远距离(树的直径)问题 阅读全文
posted @ 2017-07-27 20:37 zprhhs 阅读(281) 评论(23) 推荐(0) 编辑
摘要: 树形dp,简单状态转移方程,入门级 阅读全文
posted @ 2017-07-27 17:56 zprhhs 阅读(135) 评论(0) 推荐(0) 编辑
摘要: CARDS 时限:1000MS Description Alice and Bob have a set of N cards labelled with numbers 1 ... N (so that no two cards have the same label) and a shuffle 阅读全文
posted @ 2017-07-26 20:57 zprhhs 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Cipher 时限:1000MS Description Bob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their enc 阅读全文
posted @ 2017-07-26 20:09 zprhhs 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1001. Add More Zero 给出m,求解最小的k满足10^k <= 2^m。两边同时取以10为底的对数答案就出来了。 #include "bits/stdc++.h" using namespace std; int main(int argc, char const *argv[]) 阅读全文
posted @ 2017-07-26 18:52 zprhhs 阅读(325) 评论(5) 推荐(0) 编辑
摘要: 题目: http://poj.org/problem?id=2369 题意:给定一个序列,问需要最少需要置换多少次才能变为有序序列。 很水的置换群(线代接触过类似知识,貌似近世代数还要学)。。 求出所有的周期,然后算下lcm。 阅读全文
posted @ 2017-07-26 17:48 zprhhs 阅读(139) 评论(0) 推荐(0) 编辑
摘要: B. Petya and Exam 题意: 给你一个定义为好的字符集合和一个字符串s进行字符匹配。字符s为小写字母、‘*’和‘?’组成。其中‘?’可以任意替换一个好的字符,‘*’可以替换一个由坏的字符组成的串或者去掉‘*’,‘*’最多出现一次。然后给出n个字符串是否匹配。 思路: 直接模拟,要是‘? 阅读全文
posted @ 2017-07-26 11:20 zprhhs 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目链接 题意: 给你一棵树,让你求出树上的两个点之间的距离。 思路: 用LCA解决,求出两个节点到根节点的距离减去两倍的LCA到根节点的距离 阅读全文
posted @ 2017-07-26 09:25 zprhhs 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 康托展开 定义 其中表示ai当前未出现的元素中是排第几个(从0开始)。并且0<=ai<i(1<=i<=n)。它的意义是把一个序列映射成一个数。(来自百度百科) 例如,有一个数组 s = ["A", "B", "C", "D"],它的一个排列 s1 = ["D", "B", "A", "C"],现在要 阅读全文
posted @ 2017-07-20 11:28 zprhhs 阅读(211) 评论(0) 推荐(0) 编辑
摘要: A Sagheer and Crossroads 题意: 给你一个双向行驶的十字路口, 每条道路上都以四个灯, l, s, r, p分别表示如图三个方向上和人行道上的红绿灯。如果汽车在绿灯的时候开车撞到了人行道上的人,就会发生交通意外。现在给你每条路上的红绿灯,判断是否会发生交通意外。 思路: 直接 阅读全文
posted @ 2017-06-03 16:57 zprhhs 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1259 - Goldbach`s Conjecture PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Goldbach's conjecture is one of the oldest uns 阅读全文
posted @ 2017-04-26 20:36 zprhhs 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1341 - Aladdin and the Flying Carpet PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB It's said that Aladdin had to solve se 阅读全文
posted @ 2017-04-26 19:58 zprhhs 阅读(192) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 22 下一页
Power by awescnb