题意: 一棵 n 个点的无权树,求最?点覆盖 思路: 那么,我们考虑一个结点可以被谁染色,不难想出,可以有3种情况:被自己染色,被儿子染色,被父亲染色 我们不妨设: f[i][0] 代表被自己染色 f[i][1] 代表被父亲染色 f[i][2] 代表被儿子染色 设当前节点是 u ,儿子节点是 v 我 ...
分类:
移动开发 时间:
2020-02-20 23:40:14
阅读次数:
89
前面几章介绍了处理适量适中的图形内容的最佳方法。通过使用几何图形、图画和路径,可以降低2D图形的开销。即使正在使用复杂的具有分层效果的组合形状和渐变画刷,这种方法也仍然能够正常得很好。 然而,这样设计不适合需要渲染大量图形元素的绘图密集型应用程序。例如绘图程序、演示粒子碰撞的物理模型程序或横向卷轴形 ...
一、多线程编程简介 1、为什么需要并发编程我们知道目前我们计算机基本是基于X86架构的,而基于X86架构的机器主频超不过4GHz,随着信息时代的来临,我们需要处理的数据越来越大,因此对程序的性能也要求越来越高,提高程序的性能,一方面需要提高运行环境的配置,也就是配性能更好的机器,更快的CPU更大的内 ...
分类:
编程语言 时间:
2020-02-19 14:59:10
阅读次数:
62
1. EXCEL中获得工作表(sheet)的名称: RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename"))) =MID(CELL("filename",$A$1),FIND("]",CELL("filename" ...
分类:
其他好文 时间:
2020-02-19 13:27:47
阅读次数:
220
Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise. Return the number of negative numbers in grid. Exampl ...
分类:
其他好文 时间:
2020-02-18 13:04:04
阅读次数:
75
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 ...
分类:
其他好文 时间:
2020-02-17 22:33:36
阅读次数:
99
Largest product in a grid In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 ...
分类:
其他好文 时间:
2020-02-17 19:50:33
阅读次数:
116
Pavel loves grid mazes. A grid maze is an n?×?m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only ...
分类:
其他好文 时间:
2020-02-17 12:32:11
阅读次数:
113
操作Excel通常是用如下三个扩展体:importxlrdimportxlwtimportopenpyxlxlrd(读)和xlwt(写)是一对。openpyxl独立,即可读也可写。正常读都没有问题,只是读有公式的cell时,会出现如题症状。对此,xlrd似乎没答案,而openpyxl开出的方子如下:wb1=openpyxl.load_workbook(xlsxFileWithFullPath,da
分类:
编程语言 时间:
2020-02-17 09:21:06
阅读次数:
237
王者之心,金汤玉固,藏污纳垢,豁达快意 #include<bits/bits/stdc++.h> using namespace std; class Solution { public: int shortestDistance(vector<vector<int>>& grid) { //res ...
分类:
其他好文 时间:
2020-02-17 00:42:31
阅读次数:
61