摘要: 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) 编辑
Power by awescnb