2016年12月5日

Tara's Beautiful Permutations 组合数学

摘要: https://www.hackerrank.com/contests/hourrank-15/challenges/taras-beautiful-permutations 题意是说,给定一个数组,里面的数字最多出现两次,求所有的合法排列,合法排列定义为没有相同的数字排在一起。 首先先统计一下个数 阅读全文

posted @ 2016-12-05 18:19 stupid_one 阅读(376) 评论(0) 推荐(0) 编辑

1032 - A-B 组合数学

摘要: http://www.ifrog.cc/acm/problem/1032 1032 - A-B Time Limit:1s Memory Limit:128MByte Submissions:680Solved:126 1032 - A-B Time Limit:1s Memory Limit:12 阅读全文

posted @ 2016-12-05 16:50 stupid_one 阅读(312) 评论(0) 推荐(0) 编辑

C. Bear and Colors 区间枚举的技巧

摘要: http://codeforces.com/problemset/problem/673/C 先说一个枚举区间的技巧,枚举前缀,不要枚举后缀。 就是下面这个代码是不好的 为什么呢?就是很多东西重复了,而且也被迫用不上。只能老老实实地计算。 但如果考虑下枚举前缀。 则能用上以前的东西 比如[1, 1] 阅读全文

posted @ 2016-12-05 10:07 stupid_one 阅读(262) 评论(0) 推荐(0) 编辑

导航