" D. Shichikuji and Power Grid " 参考: "Codeforces Round 597 (Div. 2)" 思路:一个很裸的最小生成树。把建立基站看成是,城市与源点(虚构的)建边。由此建立最小生成树,即可得出答案。 代码: cpp // Created by CAD o ...
分类:
其他好文 时间:
2019-11-02 16:00:00
阅读次数:
85
CF1245D: Shichikuji and Power Grid 题意描述: + 给定$n$个点$(n\leq2000)$,在第$i$个点上建立一个基站需要$c_i$的代价,连接两个点需要$(|x_i x_j|+|y_i y_j|) (k_i+k_j)$的代价。对于一个点要么建立基站,要么连接建 ...
分类:
其他好文 时间:
2019-11-02 13:33:44
阅读次数:
130
题意: 二维平面上n个点,每个点可以建厂,也可以与其他点连边,建厂花费为$c_i$,与j连边花费为$(k_i+k_j) dis(i,j)$,dis为两点之间的欧式距离,求让每个点都通电的最小花费与方案 思路: 维护使这个点通电的花费的优先队列,一开始先把建厂放进去,然后每次拿出最小花费的点i,再用i ...
分类:
其他好文 时间:
2019-11-02 13:28:49
阅读次数:
79
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; us... ...
一、pipeline的用法 pipeline可以用于把多个estimators级联成一个estimator,这么 做的原因是考虑了数据处理过程中一系列前后相继的固定流程,比如feature selection->normalization->classification pipeline提供了两种服 ...
分类:
其他好文 时间:
2019-10-31 18:43:20
阅读次数:
134
python3使用matplotlib画图,因python3默认使用中unicode编码,所以在写代码时不再需要写 plt.xlabel(u’人数’),而是直接写plt.xlabel(‘人数’)。 注意: 在有中文的地方加上中文相关的字体,不然会因为没有字体显示成放框,因为默认的使用的字体里没有中文 ...
分类:
其他好文 时间:
2019-10-31 18:28:16
阅读次数:
83
首先要对问题的描述有一个大概认知, 什么是性能? 什么影响性能? 如何最大化的提高性能? 影响WPF应用程序性能的方面 1.硬件 Dx版本(WPF 基于DX渲染,也可以CPU)RenderCapability.Tier属性允许你在应用程序运行时检索呈现层 2.使用高效的panel ,Grid sta ...
function(button, e) { debugger; // 中断调试指令,可以手动删除它 var me = this; // this 为列表视图控制器 var viewModel = this.getViewModel(); // 获取视图模型 var grid = this.getVi... ...
分类:
其他好文 时间:
2019-10-29 15:47:22
阅读次数:
113
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p ...
分类:
其他好文 时间:
2019-10-26 15:17:26
阅读次数:
95
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. ...
分类:
其他好文 时间:
2019-10-26 14:57:10
阅读次数:
55