dima专题

【简单题】-CF-390B-Inna, Dima and Song

题目链接:http://codeforces.com/problemset/problem/390/B 题目描述: 两个小盆友弹钢琴,a 数组中的值代表他们分别都能弹到的最高调。如果二者弹出的音调 v1、v2 加起来正好等于 b 数组对应标准音调的话就会增加 v1 * v2 点愉悦值,无法弹出正确音调则愉悦值减一,求愉悦值最大多少? 解题思路: 坑点有二, ①:要用 long long!

CodeForces - 272B Dima and Sequence 函数/思维

Dima and Sequence time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Dima got into number sequences. Now he’s got sequence a1, a2, …, an, co

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。请帮助博士判断说这些细

CF 366E - Dima and Magic Guitar 最远曼哈顿距离

题目:http://codeforces.com/problemset/problem/366/E 其实就是找 n * m 矩阵中数字 x 和 数字 y 的最远距离。 方法参照武森的论文《浅谈信息学中的“0”和“1”》 先约定符号:xi,xj  (i,j)是x的下标,当然,矩阵中的值是可以重复的 上面是武森的论文原文,加上我之前的符号约定,我在做点解释: 其实那个max={四种可能

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