题目链接: 传送门 DZY Loves Chemistry time limit per test1 second     memory limit per test256 megabytes Description DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed gr…
题目链接:Codeforces 444A DZY Loves Physics 题目大意:给出一张图,图中的每一个节点,每条边都有一个权值.如今有从中挑出一张子图,要求子图联通,而且被选中的随意两点.假设存在边,则一定要被选中.问说点的权值和/边的权值和最大是多少. 解题思路:是图论中的一个结论,最多两个节点.所以枚举两条边就能够了.我简单的推了一下,2个点的情况肯定比3个点的优. 如果有3个点a,b,c,权值分别为A,B.C 现a-b,b-c边的权值分别为u.v 那么对于两点的情况有A+Bu,B…
转载请注明出处:http://blog.csdn.net/u012860063/article/details/37509207 题目链接:http://codeforces.com/contest/445/problem/C ----------------------------------------------------------------------------------------------------------------------------------------…
DZY loves colors, and he enjoys painting. On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of thei-th unit of the ribbon is i at first. It is colorful enough, but w…
题目大意:Codeforces 444C DZY Loves Colors 题目大意:两种操作,1是改动区间上l到r上面德值为x,2是询问l到r区间总的改动值. 解题思路:线段树模板题. #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; const int maxn = 5*1e5; typedef long lo…
A. DZY Loves Physics time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density…
A. DZY Loves Physics time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density…
A. DZY Loves Physics 题目连接: http://codeforces.com/contest/444/problem/A Description DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed graph (nodes and edges of th…
题目链接: 传送门 DZY Loves Chemistry time limit per test:1 second     memory limit per test:256 megabytes Description DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and m pairs of them will react. He wants to pour these chemicals…
B. DZY Loves FFT time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves Fast Fourier Transformation, and he enjoys using it. Fast Fourier Transformation is an algorithm used to calculate…