"原题462. Minimum Moves to Equal Array Elements II" 题目大意: 给你一串数字,对于每个数字,一次性可以移动一步(数值增加1或者减小1),请问如何在最小的步伐数内使所有的数字都相等 Example Input: [1,2,3] Output: 2 Exp ...
分类:
其他好文 时间:
2018-08-21 21:44:54
阅读次数:
144
1 #include 2 #include 3 #include 4 #include 5 #include 6 #define DEF 0x3f3f3f3f 7 using namespace std; 8 9 int main() 10 { 11 int T; 12 scanf("%d",&T)... ...
分类:
其他好文 时间:
2018-08-21 13:09:59
阅读次数:
181
做响应式网站的时候,一定要在页面头部加入如下的声明: width=device-width 样式中定义的宽度等于设备中定义的宽度 initial-scale=1.0 缩放比例1 minimum-scale=1.0 最大缩小比例1 maximum-scale=1.0 最大放大比例1 上段代码的最终作用 ...
分类:
其他好文 时间:
2018-08-21 11:32:55
阅读次数:
152
rtp协议基于udp传输,流媒体音视频数据被封装在rtp中,通过rtp协议进行实时的传输。 一、rtp协议头格式 The RTP header has a minimum size of 12 bytes. After the header, optional header extensions m ...
分类:
其他好文 时间:
2018-08-14 14:30:23
阅读次数:
213
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as po ...
分类:
其他好文 时间:
2018-08-12 14:04:57
阅读次数:
284
[INS-13001] environment does not meet minimum requirements
分类:
其他好文 时间:
2018-08-11 10:51:51
阅读次数:
207
题意:有N家家店,每家店都对K种货物有需求;同时有M家仓库,对K钟货物有供应。对于每种货物,每个仓库送至每家店都有自己的单位费用。求满足所有店所有货物的最小费用 分析:对于每一种货物,如果总需求大于总费用,那么无解的;否则可以用KM匹配求解每一种货物的最小费用。 因为KM求的是最优匹配,所以建图的时 ...
分类:
其他好文 时间:
2018-08-10 21:27:26
阅读次数:
103
3 Longest Substring Without Repeating Characters https://www.youtube.com/watch?v=dH5t6rWmob0 template https://leetcode.com/problems/minimum-window-sub... ...
分类:
其他好文 时间:
2018-08-10 15:57:11
阅读次数:
187
Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n ...
分类:
移动开发 时间:
2018-08-07 21:58:57
阅读次数:
231
尝试着刷刷一些经典LeetCode题练练手感,随手做了两道看起来不起眼但还是需要一些细节的题: 1. 题目描述 Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the ...
分类:
其他好文 时间:
2018-08-07 17:28:18
阅读次数:
161