GO 题意:给一个区间,有n次染色操作,每次将[x1, x2]染为c,求最后每种颜色各有多少线段可以看到。 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #inclu ...
分类:
其他好文 时间:
2019-08-08 00:18:30
阅读次数:
82
//引用类型 Array类型-数组篇总结 // 创建数组两种方式 //-、使用Array构造函数 let colors = new Array(); //创建数组数量 let colors2 = new Array(20); //包含3个字符值的数组 let colors3 = new Array( ...
分类:
编程语言 时间:
2019-06-24 00:38:27
阅读次数:
121
Given an array with *n* objects colored red, white or blue, sort them **in-place** so that objects of the same color are adjacent, with the colors in ... ...
分类:
编程语言 时间:
2019-06-24 00:31:49
阅读次数:
123
护眼色豆沙绿 R=199, G=237, B=204 H= 85, S=123,L=205 设置MATLAB的编辑器为护眼色 1.找到HOME中的Preference键,打开属性框 2. 找到colors,取消Use system colors, 选择自己想要的背景颜色、字体大小等 设置福昕阅读器为 ...
分类:
其他好文 时间:
2019-06-10 19:56:46
阅读次数:
144
看下效果: 一:Options -- Global Options 1.Normal colors 2.Bold colors 二 :Options -- Session Options 1.Use global ANSI color settings 2.ANSI Color 3.字体 ...
分类:
其他好文 时间:
2019-06-06 18:51:47
阅读次数:
97
75. 颜色分类 75. Sort Colors 题目描述 给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。 此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。 注意: 不能使用代码库中的排序函数来解决 ...
分类:
其他好文 时间:
2019-06-01 21:07:49
阅读次数:
94
题目链接 : https://leetcode cn.com/problems/sort colors/ 题目描述: 给定一个包含红色、白色和蓝色,一共 n 个元素的数组, 原地 对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。 此题中,我们使用整数 0、 1 和 2 分别表 ...
分类:
其他好文 时间:
2019-05-31 23:41:41
阅读次数:
129
382. Triangle Count https://www.lintcode.com/problem/triangle-count/description 148. Sort Colors https://www.lintcode.com/problem/sort-colors/descript ...
分类:
其他好文 时间:
2019-05-13 12:37:59
阅读次数:
152
Source: PAT A 1154 Vertex Coloring (25 分) Description: A proper vertex coloring is a labeling of the graph's vertices with colors such that no two ver ...
分类:
其他好文 时间:
2019-05-10 23:36:59
阅读次数:
179
Three Colors 思路:dp 设sum为所有边的总和 不能组成三角形的情况:某条边长度>=ceil(sum/2),可以用dp求出这种情况的方案数,然后用总方案数减去就可以求出答案。 注意当某两条边都为sum/2的时候,dp会多算一次,要减去多算的方案数,多算的方案数也可以用dp求 代码: ...
分类:
其他好文 时间:
2019-05-03 16:23:51
阅读次数:
116