Codeforces Round #391(div 1+2)】的更多相关文章

传送门:http://codeforces.com/contest/757 A题题意是给你一个字符串,让你在里面找到"Bulbasaur"这样的单词有多少个,字符串可以重排列.实际上统计下"Bulbasaur"里面的字母数,再用原串的字母数去除一下取最小值就行了.可以直接两个map搞.这题被hack了一次是因为我错误地复制了case1,case1比原串多了个字母b.下次要仔细看清. 代码: #include <iostream> #include <…
题目连接: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…
http://codeforces.com/contest/757/problem/C 题目大意:有n个导管,每个体育馆有k种神奇宝贝,然后所有的n个体育馆中,一共有m中神奇宝贝.可知,每个神奇宝贝中都可以相互转化.问,有多少种转化方式,使得每个体育馆里面的所有类型的数目不变(可以所有的不转化) 思路:我第一次知道vector竟然可以通过hash的方式来解决问题!!! 定义vector<int> ve[i]表示第i种神奇宝贝属于哪些道馆,然后我们sort(ve + 1, ve + 1 + m)…
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 region has n gyms. The i-th gym has gi Pokemon in it. There are m distinct Pokemon types in the Himalayan regi…
Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he went to Professor Zulu's Lab. Since Bash is Professor Zulu's favourite student, Zulu allows him to take as many Pokemon from his lab as he pleases. But…
Bash wants to become a Pokemon master one day. Although he liked a lot of Pokemon, he has always been fascinated by Bulbasaur the most. Soon, things started getting serious and his fascination turned into an obsession. Since he is too young to go out…
A =w= B QuQ C 题意:有n个体育场,每个体育场有一些小精灵,一共m种小精灵(n<=1e5,m<=1e6),可以将数字全为i的精灵进化成j(可以互相进化也可以选择不进化),问有多少种进化方案可以让进化后每个体育场小精灵的种类和数量一模一样 分析:数学 若数字i可以和数字j互相调换,那么说明数字i和数字j在所有体育场内的出现个数是一一对应的,挑出所有出现情况相同的集合,每个集合元素个数的阶乘的积就是答案 具体的实现很巧妙 用一个vector g[m]存下每种小精灵出现的体育场 然后so…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…