摘要:
You have been offered a job in a company developing a large social network. Your first task is connected with searching profiles that most probably be 阅读全文
摘要:
题意:给定N点,M边,求添加最少的边使之变为连通图的方案数。 思路:注意题目给出的M边可能带环,即最后生成的不一定是一棵树。但是影响不大。根据矩阵树定理,我们知道生成树的数量=N^(N-2),即点数^(连通数-2)。 此题把已经连通的看成一个整体,就可以得到数量为N^(cnt-2),然后考虑连通块内 阅读全文
摘要:
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circu 阅读全文
摘要:
De Prezer loves rectangles.He has a n × m rectangle which there is a number in each of its cells. We show the number in the j - th column of the i - t 阅读全文