Codeforces 757 C Felicity is Coming!】的更多相关文章

D. Felicity's Big Secret Revealed   The gym leaders were fascinated by the evolutions which took place at Felicity camp. So, they were curious to know about the secret behind evolving Pokemon. The organizers of the camp gave the gym leaders a PokeBlo…
题目大意:有n个训练营,m种宠物,每个训练营里里面有gi 个宠物,现在每只宠物都要完成一次进化,种类 相同的宠物进化之后,种类还是相同,种类不同的宠物不能进化成相同种类,且要求所有宠物进化之后,每个 训练营各个种类的宠物数量不变. 思维题 思路:我们不能一个一个训练营考虑,我们要考虑不同种类宠物的情况,我们统计每种宠物出现在那个训练营 里面且出现几次,统计结果完全一样的宠物种类分为一堆,这一堆里面的宠物如果有x个,则这堆的贡献为x! 将所有堆得结果想乘就是结果. 原来将vector<int>…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It's that time of the year, Felicity is around the corner and you can see people celebrating all around the Himalayan region. The Himalayan regi…
[题目链接]:http://codeforces.com/problemset/problem/757/D [题意] 给你一个01串; 让你分割这个01串; 要求2切..n+1切; 对于每一种切法 所切成的各个部分的二进制,转成十进制之后;假设里面最大的数为m; 问1..m这些数字都出现的切法有多少种; [题解] 可以算一下对于1个75位的数字来说; 最多只可能连续出现 从 1..20 你可以算一下1..20这20个数字的二进制形式恰好占74个; 不能再多一个数字了,因为21的二进制形式的长度肯…
Discription Bash got tired on his journey to become the greatest Pokemon master. So he decides to take a break and play with functions. Bash defines a function f0(n), which denotes the number of ways of factoring n into two factors p and q such that …
Discription It's the turn of the year, so Bash wants to send presents to his friends. There are n cities in the Himalayan region and they are connected by m bidirectional roads. Bash is living in city s. Bash has exactly one friend in each of the oth…
题目连接:http://codeforces.com/contest/757/problem/D D. Felicity's Big Secret Revealed time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output The gym leaders were fascinated by the evolutions which t…
C. Felicity is Coming! time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output It's that time of the year, Felicity is around the corner and you can see people celebrating all around the Himalayan…
题目链接 http://codeforces.com/contest/757/problem/C 题意:给你n组数范围在1-m,可进行变换f(x)=y,就是将所有的x全变成y,最后 要满足变化后每组数的种类和原来一样. 拿样例来说 2 3 2 1 2 2 2 3 1在第一组里,2在第1,2组里,3在第3组里 1能变1或2,1变2后2只能变1,但是第二组里没有1所以不能变, 所以总共只有1种变法. 其实这题就是分集合该样例可分为3个集合 集合1={1},2={1,2},3={2}(集合表示出现在哪…
757D - Felicity's Big Secret Revealed 题目大意:给你一串有n(n<=75)个0或1组成的串,让你划最多n+1条分割线,第一条分割线的前面和最后一条分割线的后面 不算一段.设剩下的段里面的最大值为max,若1-max都在这些段里面出现过则算一个有效划分,问你总共有多少有效划分, 答案对1e9+7取模. 写的时候感觉是个dp,单就是想不出来,看了题解说是状态压缩dp,把出现过哪些数字当做状态,这样才写出来的QAQ. 思路:因为n<=75,我们列一下,最大值肯定…