码迷,mamicode.com
首页 >  
搜索关键字:numbers range    ( 16974个结果
同步锁2
1 import threading 2 import time 3 4 num = 100 5 def add(): 6 global num 7 s = num 8 time.sleep(0.02) 9 num = s - 1 10 11 l = list() 12 for i in range ...
分类:其他好文   时间:2020-04-13 00:22:13    阅读次数:65
leetcode-184周赛-5381-查询带键的排列
题目描述: 自己的提交: class Solution: def processQueries(self, queries: List[int], m: int) -> List[int]: l = [i for i in range(1,m+1)] ans = [] for i in querie ...
分类:其他好文   时间:2020-04-12 20:55:18    阅读次数:67
leetcode-184周赛-5380-数组中的字符串匹配
题目描述: 自己的提交: class Solution: def stringMatching(self, words: List[str]) -> List[str]: def strStr(haystack: str, needle: str) -> int: if not needle:ret ...
分类:编程语言   时间:2020-04-12 20:41:27    阅读次数:67
560. Subarray Sum Equals K
问题: 给定数组(含有正数负数),求连续子集合和=k的子集合数。 Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Note: The length of the array is in range [1, 20,000]. The range of ...
分类:其他好文   时间:2020-04-12 20:20:03    阅读次数:72
Vus the Cossack and Numbers CF-1186D(思维)
题意: 给一个浮点数序列$a$,其和为$0$。求一个序列$b$,满足$b[i]=ceil(a[i])$或者$b[i]=floor(a[i])$。 思路: 全部数字向下取整,赋值给$b$,统计$b$的和,若和不为$0$,则使原本不为整数的$a[i]$对应的$b[i]+1$,直到和为$0$。 代码: 1 ...
分类:其他好文   时间:2020-04-12 18:40:06    阅读次数:77
ssm整合redis
# 1.ssm整合redis 1. 导入依赖2. 编写配置文件,修改配置文件的ip,和端口 ![1586566250656](assets/1586566250656.png) 3. 让spring的配置文件加载redis的配置 ![1586566304923](assets/15865663049 ...
分类:其他好文   时间:2020-04-12 16:23:58    阅读次数:72
扔鸡蛋
"887. 鸡蛋掉落" 你将获得 K 个鸡蛋,并可以使用一栋从 1 到 N 共有 N 层楼的建筑。 每个蛋的功能都是一样的,如果一个蛋碎了,你就不能再把它掉下去。 你知道存在楼层 F ,满足 0 本题是谷歌用于面试的一道经典面试题之一。由于本题过于经典,谷歌公司已经不再将这题作为面试的候选题目了。 ...
分类:其他好文   时间:2020-04-12 14:09:37    阅读次数:82
1112. 寻找数据错误
1112. 寻找数据错误 中文English 集合S中原本包含数字1到n。但不幸的是,由于数据错误集合中的一个数变成了集合中的另一个数,这导致集合中有两个重复的数,并且集合中缺失了1到n的某个数。 给定数组nums,表示发生错误后的数组,以数组的形式返回重复的数值和缺失的数值。 样例 样例 1: 输 ...
分类:其他好文   时间:2020-04-12 12:25:01    阅读次数:68
异常 巩固1
1.索引异常 IndexError: list index out of range 2.语法异常 SyntaxError 3.缩进异常 IndentationError: unexpected indent 4.try 语句完整形态:try except else finally 5.try 内的 ...
分类:其他好文   时间:2020-04-12 12:15:41    阅读次数:73
leetcode 2 两数相加
地址:https://leetcode cn.com/problems/add two numbers/submissions/ 大意:给定两个链表,返回一个由这两个链表相加而得到的新链表 ` ` ...
分类:其他好文   时间:2020-04-12 07:53:08    阅读次数:55
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!