题目连接:https://pintia.cn/problem-sets/994805046380707840/problems/994805073643683840 题面: 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救 ...
分类:
其他好文 时间:
2020-01-22 11:13:28
阅读次数:
190
1057 数零壹 (20分) https://pintia.cn/problem-sets/994805260223102976/problems/994805270914383872 第一次:段错误 错误代码: 1 #include <cstdio> 2 #include <cstring> 3 ...
分类:
其他好文 时间:
2020-01-22 01:17:53
阅读次数:
95
题目地址 https://leetcode.com/problems/perfect squares/ 题目大意 给定正整数 n ,找到若干个完全平方数(比如 )使得它们的和等于 n 。你需要让组成和的完全平方数的个数最少。 解题思路 动态规划思想,dp[i]表示i的问题解, 对i开方,得到最大的平 ...
分类:
其他好文 时间:
2020-01-21 17:56:39
阅读次数:
59
/** * 42. Trapping Rain Water * https://leetcode.com/problems/trapping-rain-water/description/ * */ class Solution { fun trap(height: IntArray): Int { ...
分类:
移动开发 时间:
2020-01-21 00:39:20
阅读次数:
107
0. Problem There is no memory leak of the following code, but there are problems. void memory_leak(){ ClassA *ptr = new ClassA(); /* if return here, t ...
分类:
编程语言 时间:
2020-01-20 22:46:08
阅读次数:
94
485 最大连续1的个数 给定一个二进制数组, 计算其中最大连续1的个数。 示例 1: 注意: 1. 输入的数组只包含 0 和1。 2. 输入数组的长度是正整数,且不超过 10,000。 来源:力扣(LeetCode) 链接:https://leetcode cn.com/problems/max ...
分类:
其他好文 时间:
2020-01-20 22:28:59
阅读次数:
77
1060 爱丁顿数 (25分) https://pintia.cn/problem-sets/994805260223102976/problems/994805269312159744 1 #include <iostream> 2 #include <cmath> 3 #include <alg ...
分类:
其他好文 时间:
2020-01-20 21:10:03
阅读次数:
75
原题链接在这里:https://leetcode.com/problems/k-closest-points-to-origin/ 题目: We have a list of points on the plane. Find the K closest points to the origin ( ...
分类:
其他好文 时间:
2020-01-20 09:25:46
阅读次数:
72
476 数字的补数 给定一个正整数,输出它的补数。补数是对该数的二进制表示取反。 注意: 1. 给定的整数保证在32位带符号整数的范围内。 2. 你可以假定二进制数不包含前导零位。 示例 1: 示例 2: 来源:力扣(LeetCode) 链接:https://leetcode cn.com/prob ...
分类:
其他好文 时间:
2020-01-19 22:10:37
阅读次数:
127
1068 万绿丛中一点红 (20分) https://pintia.cn/problem-sets/994805260223102976/problems/994805265579229184 题目思路: 题目给定N*M个数字,要求找出只出现一次的数字,并且这个数字的相邻的数字都和他的差值必须大于给 ...
分类:
其他好文 时间:
2020-01-19 19:33:54
阅读次数:
68