Problem : Given an integer, write a function to determine if it is a power of two. Example 1: Example 2: Example 3: `` Input: 218 Output: false c bool ...
分类:
其他好文 时间:
2020-04-06 00:03:04
阅读次数:
83
题面: There are n courses in the course selection system of Marjar University. The i-th course is described by two values: happiness Hi and credit Ci. I ...
分类:
其他好文 时间:
2020-04-05 22:35:03
阅读次数:
93
1 class Solution: 2 def minSubsequence(self, nums: 'List[int]') -> 'List[int]': 3 nums = sorted(nums,reverse=True) 4 n = len(nums) 5 if n == 1: 6 retu ...
分类:
其他好文 时间:
2020-04-05 13:24:19
阅读次数:
52
源码示例: #include <iostream>#include <vector>#include <algorithm> using namespace std; class IsEven{public: bool operator()(int x) { return x % 2 == 0; } ...
分类:
编程语言 时间:
2020-04-05 00:40:25
阅读次数:
79
请列举你所知道的Python代码检测工具及他们间的区别? pylint :源代码分析器,可以分析python代码中的错误 pyflakes : 检查源文件错误的简单程序,不会检查代码风格。 有一个list["This","is","a","Boy","!"], 所有元素都是字符串, 对他进行大小写无 ...
分类:
其他好文 时间:
2020-04-05 00:23:58
阅读次数:
82
1.列表和元祖 1)列表和元组,都是一个可以放置任意数据类型的有序集合 在绝大多数编程语言中,集合的数据类型必须一致。不过,对于 Python 的列表和元组来说,并无此要求 2)两者区别: 列表是动态的,长度大小不固定,可以随意地增加、删减或者改变元素(mutable) 而元组是静态的,长度大小固定 ...
分类:
编程语言 时间:
2020-04-04 20:52:19
阅读次数:
77
机器视觉缺陷检测实验 一、实验目的 (1)利用python编写程序实现对图像的缺陷检测; (2)通过轮廓对比检测出合格产品与不合格产品; (3)实现在图像上显示文本提示信息; 二、题目描述 (1)读取标准图像并显示; (2)利用for循环读取待测的对比图像; (3)将标准图像与一张待测图像进行中值滤 ...
分类:
编程语言 时间:
2020-04-04 18:48:25
阅读次数:
276
"33. Search in Rotated Sorted Array" ...
分类:
其他好文 时间:
2020-04-04 11:28:53
阅读次数:
59
一、问题描述 sorted set操作执行:print(connect.zadd('grade', 'bob', 98, 'mike' ,100))时报错redis.exceptions.DataError: ZADD allows either 'nx' or 'xx', not both 二、出 ...
分类:
编程语言 时间:
2020-04-04 11:27:13
阅读次数:
94
替换后的最长重复字符。题意是给一个字符串,只有大写字母,允许你替换其中的K个字母,问替换操作完成后能返回的最长字母相同的子串的长度是多少。例子, Example 1: Input: s = "ABAB", k = 2 Output: 4 Explanation: Replace the two 'A ...
分类:
其他好文 时间:
2020-04-04 09:41:15
阅读次数:
68