bacteria专题

Codeforces 400D Dima and Bacteria(Floyd+并查集)

题目链接:Codeforces 400D Dima and Bacteria 题目大意:给出n,m和k,表示有n个细菌,m种仪器和k种细菌,给出k种细菌的数量ci,然后每个细菌按照种类排成一排(所以有第i种细菌的序号从∑(1≤j≤i-1)cj + 1 到∑(1≤j≤i)cj);接下来给出m种仪器,有u,v,x三个值,表示说从可以在第u,v号细菌之间移动能量,代价为x。请帮助博士判断说这些细

J - Mysterious Bacteria

题目链接:https://cn.vjudge.net/contest/70017#problem/J 题目大意:给你一个数a,你要求出最大的一个数x,满足b的x次方等于a; 题解:根据算数基本定理,一个数可以分为a=p1^x1*p2^x2.......*pn^xn;所以算出x1,x2,.....,xn的最大公因子就行了,但是如果a为负数的情况下求出的x一定要为奇数,如果求出的是偶数,那么就要一

【Code Forces 320A】【二进制拆分】Raising Bacteria 细胞繁殖 每天倍增

【传送门】 http://codeforces.com/contest/579/problem/A 【题意】 在培养皿中,每个细胞每天会繁殖,数量*2 我们可以在任意天加入任意数量的细胞入培养皿中。 想要知道最少加入多少个细胞,可以使得有一天,培养皿中细胞的数量会恰好为x 【类型】 二进制拆分 【分析】 看样例就瞬间想到,这题是求二进制中有多少个1 然而倒着思考也很容易解释—

LightOJ - 1220 Mysterious Bacteria 唯一分解定理

Mysterious Bacteria 题目描述 Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new d

codeforces D.Dima and Bacteria (floyd+并查集) 好题

题目链接:Dima and Bacteria Dima took up the biology of bacteria, as a result of his experiments, he invented ktypes of bacteria. Overall, there are n bacteria at his laboratory right now, and the number